Answer a sign-in challenge
Finish a sign-in that came back with a challenge instead of a token. Send the session from that response together with the answer the challenge asks for — the SMS code, or the new password.
Answer with the token in mind, not the step: this endpoint returns the same body shape as /v1/signin, so it can hand back another challenge rather than a token. A user on first access with two-step verification really does go NEW_PASSWORD_REQUIRED → SMS_MFA → token, each step handing you a fresh session. Loop until id_token shows up.
The session belongs to the sign-in attempt that produced it and is not built to be kept — there is nothing to persist and nothing to resume. Once it stops being accepted, call /v1/signin again, which sends a new code.
Body
Which field carries the answer depends on challenge. Sending the wrong one — or leaving it out — is a 400 before the request ever reaches Cognito.
SMS_MFA only. The code from the text message.
Send it as a string, always. Codes can begin with a zero, and "012345" arriving as the JSON number 12345 is a different code — which is why a number here is rejected outright instead of being coerced into an intermittent "wrong code" for one user in ten.
"123456"
NEW_PASSWORD_REQUIRED only. The password the user chose. It has to satisfy the account's password policy — if it does not, the call comes back 400 InvalidPasswordException and the user needs to pick another one. Retry with the same session; if that is refused too, the attempt is spent and the way back is /v1/signin.
"••••••••"
Response
Either a token, or the next challenge in the chain.
- Option 1
- Option 2
Sign-in completed.