Skip to content

changePassword

POST
/change-password
curl --request POST \
--url http://localhost:4000/api/auth/change-password \
--header 'Content-Type: application/json' \
--cookie better-auth.session_token=<better-auth.session_token> \
--data '{ "newPassword": "example", "currentPassword": "example", "revokeOtherSessions": true }'

Change the password of the user

With revokeOtherSessions: true, also revokes every OAuth refresh token the user has.

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

Example generated

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

Password successfully changed

Media typeapplication/json
object
token

New session token if other sessions were revoked

string | null
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 | null format: uri
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

Example generated

{
"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

Example generated

{
"message": "example"
}

Unauthorized. Due to missing or invalid authentication.

Media typeapplication/json
object
message
required
string

Example generated

{
"message": "example"
}

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

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

Not Found. The requested resource was not found.

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

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

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

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

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}