Nest Authbeta

POST /auth/change-password

Change Password

Change Password

POST/auth/change-password

Request body

NestAuthChangePasswordRequestDto

FieldTypeRequiredDescription
currentPasswordstringrequiredCurrent password
Example: DemoOwner1!
newPasswordstringrequiredNew password
Example: DemoOwner1!New

Examples

Example
{
  "currentPassword": "DemoOwner1!",
  "newPassword": "DemoOwner1!New"
}

Responses

200

MessageResponseDto

FieldTypeRequiredDescription
messagestringrequiredResponse message

Example response

{
  "message": "string"
}
400Validation failed (bad input).

ApiErrorResponseDto

FieldTypeRequiredDescription
statusCodenumberrequiredHTTP status code
Example: 401
errorstringrequiredHTTP status text / exception name
Example: Unauthorized
messagestringrequiredHuman-readable message
Example: Invalid credentials
codestringrequiredStable, 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

FieldTypeRequiredDescription
statusCodenumberrequiredHTTP status code
Example: 401
errorstringrequiredHTTP status text / exception name
Example: Unauthorized
messagestringrequiredHuman-readable message
Example: Invalid credentials
codestringrequiredStable, 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"}'

On this page