Skip to content

Reset password​

POST
/cognito/reset-password

Set a new password using a reset code. Account-bound application codes contain eight digits, expire after 10 minutes and allow five attempts; they are consumed once, before changing the same Cognito identity's password. Existing Cognito codes remain supported. Recovery never changes email addresses or their verified flags. A federated account retains Apple/Google sign-in when it gains a password option.

The code an address receives is one of two lengths, depending on the account; GET /cognito/auth-policy lists them (passwordResetCode.lengths), the same for every caller, so a code field accepts any of them.

Save and sign in. With signIn: true, a successful reset also signs the person in with the new password: Cognito checks it as POST /cognito/signin does, and the same access_token, id_token and refresh_token httpOnly cookies are set. The answer then carries signedIn. signedIn: false means the reset is done but no session was opened (the account needs a further step); sign in with the new password. Without the flag nothing but the reset happens and no cookie is set.

Request Body​

application/json
JSON
{
"email": "string",
"code": "string",
"newPassword": "string",
"signIn": true
}

Responses​

Password reset

application/json
JSON
{
"message": "string",
"signedIn": true,
"user": {
},
"expiresIn": 0
}

Playground​

Server
Body

Samples​

Powered by VitePress OpenAPI

Built with VitePress