Skip to content

changePassword

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 '{ "newPassword": "example", "currentPassword": "example", "revokeOtherSessions": true }'

Change the password of the user

Media typeapplication/json
object
newPassword
required

The new password to set

string
currentPassword
required

The current password is required

string
revokeOtherSessions

Must be a boolean value

boolean
Examplegenerated
{
"newPassword": "example",
"currentPassword": "example",
"revokeOtherSessions": true
}

Password successfully changed

Media typeapplication/json
object
token

New session token if other sessions were revoked

string
nullable
user
required
object
id
required

The unique identifier of the user

string
email
required

The email address of the user

string format: email
name
required

The name of the user

string
image

The profile image URL of the user

string format: uri
nullable
emailVerified
required

Whether the email has been verified

boolean
createdAt
required

When the user was created

string format: date-time
updatedAt
required

When the user was last updated

string format: date-time
Examplegenerated
{
"token": "example",
"user": {
"id": "example",
"email": "hello@example.com",
"name": "example",
"image": "https://example.com",
"emailVerified": true,
"createdAt": "2026-04-15T12:00:00Z",
"updatedAt": "2026-04-15T12:00:00Z"
}
}

Bad Request. Usually due to missing parameters, or invalid parameters.

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}

Unauthorized. Due to missing or invalid authentication.

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}

Forbidden. You do not have permission to access this resource or to perform this action.

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}

Not Found. The requested resource was not found.

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}

Too Many Requests. You have exceeded the rate limit. Try again later.

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}

Internal Server Error. This is a problem with the server that you cannot fix.

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}