Skip to navigation

Verify OTP (2FA Login)

Complete the two-factor authentication step during login. Called after POST /session, POST /session/google_auth, or POST /session/apple_auth returns otp_required: true. Passkey sign-in does not go through this step.

Authentication: Public — uses the temporary OTP token from login.

Request body:

  • otp_token (required) — The temporary token returned by the login endpoint (expires after 5 minutes)
  • code (required) — 6-digit TOTP code from the authenticator app, OR one of the backup codes

Response: Same as a successful login:

  • token — JWT auth token
  • location — Redirect URL
  • the member’s profile fields at the top level of data (id, first_name, last_name, name, initials, email, avatar_url, status, bio, phone, website, social handles, otp_enabled, passkey_registered, last_seen_at, created_at, updated_at, …) — there is no nested user object

Side effects:

  • If a backup code is used, it is consumed and cannot be reused
  • Triggers a UserLogin event

Errors:

  • 422 — Invalid verification code
  • 401 — Invalid or expired OTP token

Request

This endpoint expects an object.
otp_tokenstringOptional
codestringOptional

Response

OK