Skip to content
Sign in Create account

Exchange an email-verification code for a bearer token

POST /api/auth/finalize-exchange

Consumes the one-time 64-character lowercase hexadecimal code from the email-verification redirect. A used, expired, or unknown code returns 400.

This operation needs no authentication.

Request body

application/json object

  • code string required
    Length: 64 to 64 characters. Pattern: ^[a-f0-9]{64}$

Generated sample

{
  "code": "string"
}

Responses

200 Exchange succeeded.

application/json object

Generated sample

{
  "token": "string",
  "user": {
    "created_at": "2026-01-01T00:00:00Z",
    "email": "user@example.com",
    "id": 0,
    "name": "string",
    "balance_micros": 0
  }
}
400 The code is unknown, expired, or already used. error.code is invalid_or_expired_code.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

422 The code is missing or malformed; validation_error.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

429 Route rate limit exceeded.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

text/html string