Skip to main content
PUT
https://api.bunship.com
/
api
/
v1
/
users
/
me
/
password
Change Password
curl --request PUT \
  --url https://api.bunship.com/api/v1/users/me/password \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "currentPassword": "<string>",
  "newPassword": "<string>"
}
'
{
  "message": "Password changed successfully"
}
Changes the user’s password. Requires the current password for verification. After a successful change, all other sessions are invalidated — only the current session remains active.

Auth

Requires a valid Bearer token.

Request Body

currentPassword
string
required
The user’s current password. Minimum 8 characters.
newPassword
string
required
The new password. Minimum 8 characters, maximum 128 characters. Must be different from the current password.

Response

message
string
Confirmation message.
{
  "message": "Password changed successfully"
}

Errors

StatusCodeDescription
400VALIDATION_ERRORNew password does not meet requirements or matches the current password
401AUTHENTICATION_ERRORCurrent password is incorrect

Example

curl -X PUT https://api.bunship.com/api/v1/users/me/password \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{
    "currentPassword": "OldP@ssw0rd",
    "newPassword": "NewSecureP@ssw0rd"
  }'