---
title: "Confirms an account with the six-digit code mailed at signup, and signs it in."
method: POST
path: "/api/auth/confirm"
tags: ["auth"]
---

# Confirms an account with the six-digit code mailed at signup, and signs it in.

`POST /api/auth/confirm`

## 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/confirm`
- Auth: none declared

## Request body

- ConfirmAccountRequest: Request body for `POST /api/auth/confirm`.
  - `code` string, required: The six-digit code from the confirmation email.
  - `email` string, required: The address the account was registered under.
  - `preview_token` string, nullable: The `preview_token` of the check the visitor ran on this address before signing up: that check becomes the account's first job.

## Response `200`

Email address confirmed; authenticated.

- ConfirmAccountResponse: Response body for `POST /api/auth/confirm`: the session of the confirmed account.
  - `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.
  - `first_job_uuid` string, uuid, nullable: The job recording the check the visitor ran on their address before signing up, readable through `GET /api/jobs/{uuid}`. Present only when `preview_token` named one.

## Other responses

- `401`: The code does not confirm an account (`confirm_account.invalid_code`).

---

[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)
