Skip to main content
POST
https://example.com
/
api
/
auth
/
change-password
cURL
curl --request POST \
  --url https://example.com/api/auth/change-password \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "currentPassword": "<string>",
  "newPassword": "<string>"
}
'
{
  "user": {
    "createdAt": "2023-11-07T05:31:56Z",
    "email": "jsmith@example.com",
    "emailVerified": true,
    "id": "<string>",
    "name": "<string>",
    "updatedAt": "2023-11-07T05:31:56Z",
    "image": "<string>"
  },
  "token": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

application/json
currentPassword
string
required

The current password is required

newPassword
string
required

The new password to set

revokeOtherSessions
boolean | null

Must be a boolean value

Response

Password successfully changed

user
object
required
token
string | null

New session token if other sessions were revoked