Skip to main content

Change Password

Change the authenticated user's account password. Both the current password and the new password are required.

Endpoint

PUT /v2/auth/password

Request Body

FieldTypeRequiredConstraintsDescription
currentPasswordstringYesMust match the current password on fileThe user's existing password
newPasswordstringYesSee password policy belowThe desired new password

Password policy: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z0-9]).+$

The new password must contain at least one lowercase letter, one uppercase letter, one digit, and one special character.

{
"currentPassword": "OldP@ssword1",
"newPassword": "NewP@ssword2!"
}

Response

Returns a success confirmation when the password has been updated.

{
"success": true,
"data": null,
"errorCode": "",
"message": "Password updated successfully."
}

:::caution Active sessions Changing your password does not automatically invalidate existing active tokens. If you suspect a credential compromise, call Logout after changing the password to terminate the current session, and consider resetting all sessions via Reset Sessions. :::

Code Examples

curl -X PUT "https://rest.ecgrid.io/v2/auth/password" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "currentPassword": "OldP@ssword1", "newPassword": "NewP@ssword2!" }'

See Also

  • Login — authenticate after a password change
  • Logout — invalidate the current session
  • Generate Password — generate a compliant password for a user
  • Reset Sessions — force-terminate all active sessions for a user