API reference

One-time codes

Send a sign-in code by email or SMS and exchange it for a session.

A one-time code signs a person in with a code sent to their email or phone. An email identifier gets an email code, a phone identifier gets an SMS code.

For email, the app's email method has to be set to codes; with sign-in links selected, these routes return 403 sign_in_method_disabled with details.method email_code. For phone, phone sign-in has to be on for the app and SMS on for the workspace.

Send a code#

POST/v1/auth/:app_id/otps/loginNone
identifierstringrequired
Email address, or phone number in E.164 format.
user_metaobject
Values for the app's user fields, keyed by field name.
cURLbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/otps/login \  -H "Content-Type: application/json" \  -d '{"identifier": "+14155551234"}'
Response 200json
{  "otp": {    "success": true,    "sent_at": "2026-11-19T14:04:05.000+00:00",    "id": "ch_zN4kP2qX9wT5aB3xY9QkLm7RsT2uVw8E"  },  "user_id": "ch_zN4kP2qX9wT5aB3xY9QkLm7RsT2uVw8E",  "user_meta_errors": null}

otp.id and user_id carry the same value: the token of the code's challenge. Send it back as user_id when you verify.

Statuserror_codeWhen
400invalid_identifierMissing or invalid email or phone.
403sign_in_method_disabledEmail or phone sign-in, or email codes, are off for the app.
422sms_unavailableSMS is off for the workspace.
422sms_country_not_allowedThe app does not allow texts to this country.
422sms_not_configuredNo SMS provider is set up for the app.
422invalid_phone_numberThe SMS provider rejected the number.
429More than 5 sends to the same identifier in a minute.
503sms_delivery_failedThe SMS could not be sent. Try again.

The sign-in refusals apply.

Verify a code#

POST/v1/auth/:app_id/otps/verifyNone
user_idstringrequired
The user_id from the send response. An app user ID also works: Scute then uses that person's latest pending sign-in code.
otpstringrequired
The code the person typed.
cURLbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/otps/verify \  -H "Content-Type: application/json" \  -d '{"user_id": "ch_zN4kP2qX9wT5aB3xY9QkLm7RsT2uVw8E", "otp": "482913"}'

Returns a token set with status 200, or the next sign-in step.

Statuserror_codeWhen
400otp_requiredotp is missing.
400invalid_otpWrong or expired code. On an app with sign-up closed, also an unknown user_id.
403security_blockAttack protection refused the sign-in.
404challenge_not_foundNo sign-in code matches user_id.
404user_not_foundThe code has no person attached.
429More than 30 code submissions from one IP address in a minute.

Only sign-in codes are accepted. A code created for another purpose (step-up, contact confirmation, a verification) is never exchanged for a session here.