POST /auth/change-password
Change Password
Change Password
/auth/change-passwordRequest body
NestAuthChangePasswordRequestDto
| Field | Type | Required | Description |
|---|---|---|---|
currentPassword | string | required | Current password Example: DemoOwner1! |
newPassword | string | required | New password Example: DemoOwner1!New |
Examples
Example
{
"currentPassword": "DemoOwner1!",
"newPassword": "DemoOwner1!New"
}Responses
200
MessageResponseDto
| Field | Type | Required | Description |
|---|---|---|---|
message | string | required | Response message |
Example response
{
"message": "string"
}400Validation failed (bad input).
ApiErrorResponseDto
| Field | Type | Required | Description |
|---|---|---|---|
statusCode | number | required | HTTP status code Example: 401 |
error | string | required | HTTP status text / exception name Example: Unauthorized |
message | string | required | Human-readable message Example: Invalid credentials |
code | string | required | Stable, machine-readable error code — branch on this, not the message Example: INVALID_CREDENTIALS |
Example response
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid credentials",
"code": "INVALID_CREDENTIALS"
}401Missing, invalid, or expired authentication.
ApiErrorResponseDto
| Field | Type | Required | Description |
|---|---|---|---|
statusCode | number | required | HTTP status code Example: 401 |
error | string | required | HTTP status text / exception name Example: Unauthorized |
message | string | required | Human-readable message Example: Invalid credentials |
code | string | required | Stable, machine-readable error code — branch on this, not the message Example: INVALID_CREDENTIALS |
Example response
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid credentials",
"code": "INVALID_CREDENTIALS"
}Try it
curl -X POST 'https://api.example.com/auth/change-password' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-d '{"currentPassword":"DemoOwner1!","newPassword":"DemoOwner1!New"}'