> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bunship.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Change Password

> Change the authenticated user's password

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

<Note>Requires a valid Bearer token.</Note>

## Request Body

<ParamField body="currentPassword" type="string" required>
  The user's current password. Minimum 8 characters.
</ParamField>

<ParamField body="newPassword" type="string" required>
  The new password. Minimum 8 characters, maximum 128 characters. Must be different from the current
  password.
</ParamField>

## Response

<ResponseField name="message" type="string">
  Confirmation message.
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "message": "Password changed successfully"
  }
  ```
</ResponseExample>

## Errors

| Status | Code                   | Description                                                             |
| ------ | ---------------------- | ----------------------------------------------------------------------- |
| `400`  | `VALIDATION_ERROR`     | New password does not meet requirements or matches the current password |
| `401`  | `AUTHENTICATION_ERROR` | Current password is incorrect                                           |

## Example

```bash theme={null}
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"
  }'
```
