palbaseDocs

Palbase Auth API · API

POST/auth/otp/verify

Sign in with an SMS code

Checks the code sent by POST /auth/otp. A correct code signs the phone's owner in; an unknown number gets a new account when the project allows phone sign-ups (403 signup_disabled otherwise) and takes new users at all (403 signups_closed otherwise). A user with a second factor enrolled gets the mfa_required envelope instead of tokens and finishes with mfa_token at /auth/mfa/*. Codes are single-use; too many wrong attempts (otp_max_attempts) or an expired code (otp_expired) means requesting a new one.

Called by your app, with the publishable key.

Request body

auth_request_idstring · optionalThe pending /oauth/authorize request the sign-in completes: at `urn:nist:800-63:aal1` (amr `sms`), and the answer names the callback (`oidc_callback_url`). A request that needs aal2 asks the account's authenticator app (or passkey) next — a second text adds nothing — and the challenge completes it; an account with neither, or a number with no account yet, is refused with 400 `auth_request_invalid`.
phonestring · requiredThe same number the code was sent to (same format rules as `POST /auth/otp`).
tokenstring · requiredThe code the user received.
curl
curl -X POST "https://<your-ref>.palbase.studio/auth/otp/verify" \
  -H "apikey: $PALBASE_PUBLISHABLE_KEY" \
  -H "content-type: application/json" \
  -d '{"phone":"string","token":"string"}'

Responses

200Signed in, or a second factor is required

400Validation failed or required field missing

401Missing, invalid, or expired credentials

403Authenticated but not permitted (banned, hook denial, role mismatch)

429Rate limit exceeded

502The SMS verification provider failed; the code was not judged. Retrying is safe.

503Downstream dependency unavailable (typically HIBP / breach service)

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation VerifyPhoneOTP of auth's contract.