A failed call returns a 4xx or 5xx status and a JSON body. Branch on the status and error_code, not on the error text, which can change.
Error shape#
{ "error": "This M2M token can't make this call: it needs the write scope", "error_code": "insufficient_scope", "details": { "required_scope": "write", "scopes": ["read"] }}| Field | Description |
|---|---|
| error | A readable message. On a validation failure it can be an array of messages. |
| error_code | A stable code for the failure. Not every error has one. |
| details | Extra fields for some errors, such as required_fields, sso_login_url or required_scope. |
A few endpoints differ:
- An authentication failure returns {"error": "Not authorized"} with no code, on purpose.
- Some validation failures return {"errors": [...]} with a list of messages.
- The OAuth server returns OAuth errors: {"error": "invalid_grant", "error_description": "..."}.
- A rate-limited call returns the body under Rate limits.
Status codes#
| Status | Meaning |
|---|---|
| 200, 201 | Success. |
| 204 | Success with no body. |
| 400 | The request is malformed or a required parameter is missing or invalid. |
| 401 | No credential, or the key or token is unknown, expired or revoked. |
| 403 | The credential is valid but may not make this call. |
| 404 | The app, user or object does not exist, or the credential cannot see it. |
| 409 | The request conflicts with the current state. |
| 422 | The request is well formed but cannot be done: a validation failure or a plan limit. |
| 429 | Rate limit exceeded. |
| 500 | An unexpected error on Scute's side. Internal details are not returned. |
| 503 | A provider Scute depends on (such as the SMS provider) failed. Retry later. |
| 504 | The request timed out. Retry. |
Common error codes#
| Status | error_code | When |
|---|---|---|
| 400 | invalid_identifier | The email or phone number is not valid. |
| 401 | authentication_required | The endpoint needs a token in X-Authorization and none was sent. |
| 401 | workspace_api_key_required | The endpoint takes a workspace key and got something else. |
| 401 | m2m_session_required | The endpoint takes only an M2M token. |
| 401 | user_session_required | The endpoint needs a person's access token, not an M2M token. |
| 403 | insufficient_scope | The M2M token lacks the scope. details.required_scope names it. |
| 403 | app_not_in_scope | The M2M token's app does not reach the app in the path. |
| 403 | workspace_access_denied | The credential does not reach the workspace in the path. |
| 403 | workspace_admin_required | The change needs a workspace owner or admin. |
| 403 | read_only_role | The signed-in team member has a read-only role. |
| 403 | impersonating | The call is not allowed in a session opened as another person. |
| 403 | feature_not_available | The workspace's plan does not include the feature. feature names it. Some writes return this with 422. |
| 404 | app_not_found | No app with the ID in the path. |
| 422 | sms_not_configured | No SMS provider is set up for the app. |
| 422 | invalid_phone_number | The SMS provider rejected the number. |
| 422 | unreachable_phone_number | The SMS provider could not reach the number. |
| 422 | sms_region_not_enabled | SMS to the number's region is not enabled. |
| 422 | recipient_unsubscribed | The number replied STOP. |
| 422 | sms_undeliverable | SMS cannot be delivered to the number. |
| 422 | not_sms_capable | The number cannot receive SMS. |
| 503 | sms_delivery_failed | The SMS provider failed for another reason. Retry. |
Sign-in routes have their own refusals (sso_required, signup_disabled, user_banned and others). See Sign-in refusals. Each endpoint page lists the codes it returns.
Rate limits#
Scute limits requests per IP address, per identifier and per app. A limited call returns 429 with a Retry-After header in seconds:
{ "error": "Rate limit exceeded. Please try again later.", "retry_after": 60, "rule": "verify_send/identifier"}rule names the limit that was hit. Responses carry no remaining-count headers.
| Rule | Limit | Applies to |
|---|---|---|
| api/ip | 600 / minute / IP | Every /v1 call not covered by a more specific bucket |
| verify_send/identifier | 5 / minute / email or phone | Sends: magic_links/login, magic_links/register, otps/login, challenges, challenges/:token/resend, password_resets, and POST /v1/verify/:app_id/verifications and its resend |
| verify_send/app_id | 60 / minute / app | POST /v1/verify/:app_id/verifications and its resend |
| verify_send/ip | 30 / minute / IP | POST /v1/verify/:app_id/verifications and its resend |
| verify_submit/ip | 30 / minute / IP | Code submits: otps/verify, challenges/:token/verify, password_resets/:token/code and complete, verifications/:id/verify |
| identifier_lookup/ip | 30 / minute / IP | GET /v1/auth/:app_id/users and webauthn/login/initialize |
| identifier_lookup/identifier | 10 / minute / identifier | The same two routes |
| password_resets/ip | 30 / minute / IP | Non-GET calls under /v1/auth/:app_id/password_resets |
| impersonation_handoff/ip | 20 / minute / IP | POST /v1/auth/:app_id/impersonation/exchange |
| saml/ip | 60 / minute / IP | /v1/auth/:app_id/saml/login, acs and slo |
| oauth/ip | 120 / minute / IP | /v1/oauth/:app_id/authorize, token, revoke and requests/*, when sent without an Authorization header |
| oauth_register/ip | 20 / hour / IP | POST /v1/oauth/:app_id/register |
| workspace_challenges/ip | 6000 / minute / IP | /v1/workspaces/:id/challenges and /v1/workspaces/:id/challenges/:id (instead of api/ip) |
| scim/ip | 120 / minute / IP | /v1/workspaces/:id/scim/* |
The per-identifier send limit reads the identifier from identifier, email, phone, contact_email or contact_phone in the body or query string. The per-IP limits key on the caller's address, so on calls your server makes for many people, the api/ip limit applies to your server.
A challenge also has its own attempt limit (max_attempts, 3 by default), separate from these rate limits.