---
title: "Sign in and receive a session cookie"
method: POST
path: "/api/auth/login"
tags: ["auth"]
---

# Sign in and receive a session cookie

`POST /api/auth/login`

## Request

- Base URL: `https://telawiki.com`
- URL: `https://telawiki.com/api/auth/login`
- Auth: none required

Rate-limited to 5 attempts per minute per client IP. An account whose email is not yet confirmed is refused with `403 email_unverified`.

## Request body

- object
  - `identifier` string: Email address or username. Preferred over `username`.
  - `username` string: Legacy alias for `identifier`.
  - `password` string, required

## Response `200`

Signed in. Sets the `tela_session` cookie (HttpOnly, SameSite=Lax, 30 days).

- object
  - `user` User, required: The signed-in user. `POST /api/auth/login` populates only the identity fields; `GET /api/auth/me` fills in the rest.
    - `id` integer, required
    - `username` string, required: Also the public handle.
    - `display_name` string
    - `email` string, nullable, required: Null on legacy username-only accounts, which skip the email gate.
    - `email_verified` boolean, required
    - `is_instance_admin` boolean, required
    - `bio` string
    - `mcp_connected` boolean: Whether this account has ever authenticated an MCP client.
    - `trial` object: Present only inside the trial-notification window.
      - `plan_key` string
      - `plan_name` string
      - `ends_at` string
      - `grace_ends_at` string
      - `ended` boolean
    - `feedback_unseen` integer: Instance admins only.

## Other responses

- `400`: Malformed request. `code` is usually `bad_request` or `invalid_json`.
- `401`: `unauthorized` — invalid credentials. Missing fields, unknown account, and a wrong password are one indistinguishable response.
- `403`: `email_unverified` (confirm your email first) or `sso_required` (this account or domain must sign in through the identity provider).
- `429`: `rate_limited` — retry after the interval in the `Retry-After` header.
- `500`: `internal` — server error.

---

[API](https://skmtc.dev/telawiki/apis/tela-rest-api.md) · [All operations](https://skmtc.dev/telawiki/apis/tela-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/telawiki/apis/tela-rest-api/revisions/f316f31f6fcb?raw)
