Palbase Auth API · API
/auth/otpSend a sign-in code by SMS
Sends a one-time sign-in code to the phone number. The answer is the same whether or not the number belongs to an account. Phone sign-in must be enabled for the project (provider_not_enabled otherwise). Sending is limited per number (429 rate_limited) and per IP address.
Called by your app, with the publishable key.
Request body
auth_request_idstring · optionalThe pending /oauth/authorize request the code is for: one that is not waiting is refused with 400 `auth_request_invalid` before a text is sent. Name it again on `POST /auth/otp/verify`.channel"sms" · optionalDelivery channel. Only `sms` is supported.phonestring · requiredThe phone number in international form: a leading `+`, then at most 15 digits. Spaces, dashes, dots and parentheses are ignored; any other character is refused.curl -X POST "https://<your-ref>.palbase.studio/auth/otp" \
-H "apikey: $PALBASE_PUBLISHABLE_KEY" \
-H "content-type: application/json" \
-d '{"phone":"+905551234567"}'Responses
200Code sent
400Validation failed or required field missing
401Missing, invalid, or expired credentials
403Authenticated but not permitted (banned, hook denial, role mismatch)
429Rate limit exceeded
502The project's verification service (or the notifications module before it) failed; retrying is safe
503Downstream dependency unavailable (typically HIBP / breach service)
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation RequestPhoneOTP of auth's contract.