Phase 2 part 2: Split auth and user endpoints - Authentication: register, login, refresh_token, logout - Users: get_profile, update_profile, update_theme, change_password - Each endpoint in separate markdown file - Include request/response examples and error codes
804 B
804 B
Change Password
Change the current user's password.
Endpoint: PUT /api/users/me/password
Auth: Required
Content-Type: application/json
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| current_password | string | Yes | Current password |
| new_password | string | Yes | New password (min 8 chars) |
Example Request
{
"current_password": "oldPassword",
"new_password": "NewSecureP@ss123!"
}
Response (204 No Content)
Password changed successfully.
Error Responses
| Code | Description |
|---|---|
| 400 | Invalid input or weak password |
| 401 | Current password is incorrect |
| 401 | Invalid or expired token |