---
title: "POST /api/auth/login"
method: POST
path: "/api/auth/login"
tags: ["auth"]
---

# POST /api/auth/login

`POST /api/auth/login`

## Request

- Base URL: `https://api.pricklymails.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pricklymails.com/api/auth/login`
- Auth: none declared

## Request body

- LoginRequest: Request body for `POST /api/auth/login`.
  - `email` string, required: The email address of the account.
  - `password` string, required: The account password.

## Response `200`

Authenticated, or a 2FA challenge requiring a follow-up call to `/api/auth/2fa/verify`.

- union: Response returned by the login endpoint.
  - AuthResponse: Response body for authentication endpoints.
    - `access_token` string, required: Access token (JWT), sent as a Bearer credential.
    - `expires_in` integer, required: Access token lifetime in seconds.
    - `user` UserResponse, required: Public representation of a user.
      - `created_at` string, required: Account creation timestamp (ISO 8601).
      - `email` string, required: Email address.
      - `email_verified` boolean, required: Whether the email has been verified.
      - `locale` string, required: Language of the account's emails (`"en"` or `"fr"`).
      - `role` string, required: User role (`"user"` or `"admin"`).
      - `uuid` string, required: Public UUID.
  - object: 2FA is required; the client must call `/api/auth/2fa/verify` with the temp token.
    - `requires_2fa` boolean, required: Always `true` when this variant is returned.
    - `temp_token` string, required: A short-lived token to send to `POST /api/auth/2fa/verify` with the code.

## Other responses

- `401`: Invalid credentials, banned account, or deleted account.
- `403`: Correct password, but the account's email is not confirmed yet.
- `429`: Account temporarily locked after repeated failed attempts.

---

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