Skip to main content
Verify Email
Verifies a user’s email address with a code. It confirms two kinds of code:
  • A code from Send Verification Email (mode: "code"), sent to a signed-in user. Send it in token alone. It lasts 5 minutes.
  • A sign-up code, sent when the project requires email verification before sign-in and the app chose emailVerification: { mode: "code" } on Sign Up or Sign In. Send it in token together with the verificationId that call returned. It lasts 24 hours.
On success, the user’s isVerified field is set to true and the code is invalidated. Verifying doesn’t sign anyone in: after confirming a sign-up code, the user signs in. This endpoint is unauthenticated — the code itself proves identity.

Body Parameters

string
required
The code from the email. Must match exactly, including case.
string
The verificationId returned with a sign-up code, by the 202 from Sign Up or the 403 auth/email-not-verified from Sign In. Required for those codes: a sign-up code can’t be confirmed without it. Leave it out for a code from Send Verification Email.

Response

204 No Content on success, with no body.

Sign-up codes

A sign-up code is 6 digits and allows 5 wrong tries. After the fifth wrong try it stops working, and so does its verificationId. A new code (sent by signing in again with the email and password) replaces the previous one, with a new verificationId and a fresh set of tries. Keep the verificationId in memory on the screen that asks for the code. If the user loses it, runs out of tries, or a correct code is refused (a repeated sign-up answers with an ID that doesn’t match the code already emailed), sign in again with the same email and password. Within 10 minutes of the last confirmation email, that sends nothing new and returns the verificationId of the code already sent; after that, or once a code has run out of tries, it sends a new code with a new verificationId (still limited to one email every 10 minutes, so a code that ran out soon after a sign-in sent it is replaced only once those 10 minutes pass). Resetting the password also works, and confirms the email. When sign-in returns no verificationId (for example after switching from a link to a code within those 10 minutes, or past the daily limit of five emails), sign in again later or reset the password.

Error Codes

Codes are single-use. Once consumed, the same code returns a 400 error.

See Also