Skip to content

Change Password

POST
/api/auth/change-password
curl --request POST \
--url https://example.com/api/auth/change-password \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "current_password": "example", "new_password": "example" }'

Change the authenticated user’s password.

Authenticated endpoint — requires the current password and a new password of at least 8 characters.

Media type application/json
ChangePasswordBody
object
current_password
required
Current Password
string
new_password
required
New Password
string
Example generated
{
"current_password": "example",
"new_password": "example"
}

Successful Response

Media type application/json
ChangePasswordResponse

Response from POST /auth/change-password.

The change-password endpoint does NOT re-issue a full LoginResponse (which requires access_token + user). It returns a minimal {"changed": true} body, optionally accompanied by a fresh access_token when a JWT service is available. Refresh tokens are set as HttpOnly cookies (D6 fix, May 2026), never returned in the body.

NOTE: this model corrects the response_model mismatch introduced when response_model=LoginResponse was added in the May 8 audit agents commit — LoginResponse’s required fields would force a 500 on every successful password change.

object
changed
required
Changed
boolean
access_token
Any of:
string
key
additional properties
any
Example generated
{
"changed": true,
"access_token": "example"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}