Skip to content
Select themeSelect language

POST /api/auth/reset/consume — set a new password using a reset token. The token holder is authenticated by possession of the single-use token. Returns 200 on success; 400 for a weak password or an invalid/expired/used token. The password is validated and the token consumed BEFORE the expensive Argon2 hash, so a bad token cannot be used to force hashing work.

POST
/api/auth/reset/consume
curl --request POST \
--url https://example.com/api/auth/reset/consume \
--header 'Content-Type: application/json' \
--data '{ "password": "example", "token": "example" }'
Media typeapplication/json
object
password
required
string
token
required
string
Examplegenerated
{
"password": "example",
"token": "example"
}

Password reset consumed and password updated

Media typeapplication/json
object
ok
required
boolean
Examplegenerated
{
"ok": true
}

Invalid token or weak password

Media typeapplication/json

The canonical JSON body of every error response — the single source of truth the frontend binds to. Every AppError serializes as this exact shape, and the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is what the frontend error schema is generated from, so there is no hand-written error schema on either end.

object
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden bad_request unprocessable precondition_failed conflict method_not_allowed rate_limited quota_exceeded database_error docker_error vault_error internal_error
details
One of:
null
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
Example
{
"code": "not_found"
}

Structured server error

Media typeapplication/json

The canonical JSON body of every error response — the single source of truth the frontend binds to. Every AppError serializes as this exact shape, and the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is what the frontend error schema is generated from, so there is no hand-written error schema on either end.

object
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden bad_request unprocessable precondition_failed conflict method_not_allowed rate_limited quota_exceeded database_error docker_error vault_error internal_error
details
One of:
null
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
Example
{
"code": "not_found"
}