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
codestring requiredLength: 64 to 64 characters. Pattern:^[a-f0-9]{64}$
Generated sample
{
"code": "string"
}Responses
200 Exchange succeeded.
application/json object
tokenstring requiredWrite onlyuserUserResource required
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
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
422 The code is missing or malformed; validation_error.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
429 Route rate limit exceeded.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
text/html string