API reference

Errors

The error response shape, the status codes Scute returns, common error codes and rate limits.

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#

Response 403json
{  "error": "This M2M token can't make this call: it needs the write scope",  "error_code": "insufficient_scope",  "details": {    "required_scope": "write",    "scopes": ["read"]  }}
FieldDescription
errorA readable message. On a validation failure it can be an array of messages.
error_codeA stable code for the failure. Not every error has one.
detailsExtra 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#

StatusMeaning
200, 201Success.
204Success with no body.
400The request is malformed or a required parameter is missing or invalid.
401No credential, or the key or token is unknown, expired or revoked.
403The credential is valid but may not make this call.
404The app, user or object does not exist, or the credential cannot see it.
409The request conflicts with the current state.
422The request is well formed but cannot be done: a validation failure or a plan limit.
429Rate limit exceeded.
500An unexpected error on Scute's side. Internal details are not returned.
503A provider Scute depends on (such as the SMS provider) failed. Retry later.
504The request timed out. Retry.

Common error codes#

Statuserror_codeWhen
400invalid_identifierThe email or phone number is not valid.
401authentication_requiredThe endpoint needs a token in X-Authorization and none was sent.
401workspace_api_key_requiredThe endpoint takes a workspace key and got something else.
401m2m_session_requiredThe endpoint takes only an M2M token.
401user_session_requiredThe endpoint needs a person's access token, not an M2M token.
403insufficient_scopeThe M2M token lacks the scope. details.required_scope names it.
403app_not_in_scopeThe M2M token's app does not reach the app in the path.
403workspace_access_deniedThe credential does not reach the workspace in the path.
403workspace_admin_requiredThe change needs a workspace owner or admin.
403read_only_roleThe signed-in team member has a read-only role.
403impersonatingThe call is not allowed in a session opened as another person.
403feature_not_availableThe workspace's plan does not include the feature. feature names it. Some writes return this with 422.
404app_not_foundNo app with the ID in the path.
422sms_not_configuredNo SMS provider is set up for the app.
422invalid_phone_numberThe SMS provider rejected the number.
422unreachable_phone_numberThe SMS provider could not reach the number.
422sms_region_not_enabledSMS to the number's region is not enabled.
422recipient_unsubscribedThe number replied STOP.
422sms_undeliverableSMS cannot be delivered to the number.
422not_sms_capableThe number cannot receive SMS.
503sms_delivery_failedThe 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:

Response 429json
{  "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.

RuleLimitApplies to
api/ip600 / minute / IPEvery /v1 call not covered by a more specific bucket
verify_send/identifier5 / minute / email or phoneSends: 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_id60 / minute / appPOST /v1/verify/:app_id/verifications and its resend
verify_send/ip30 / minute / IPPOST /v1/verify/:app_id/verifications and its resend
verify_submit/ip30 / minute / IPCode submits: otps/verify, challenges/:token/verify, password_resets/:token/code and complete, verifications/:id/verify
identifier_lookup/ip30 / minute / IPGET /v1/auth/:app_id/users and webauthn/login/initialize
identifier_lookup/identifier10 / minute / identifierThe same two routes
password_resets/ip30 / minute / IPNon-GET calls under /v1/auth/:app_id/password_resets
impersonation_handoff/ip20 / minute / IPPOST /v1/auth/:app_id/impersonation/exchange
saml/ip60 / minute / IP/v1/auth/:app_id/saml/login, acs and slo
oauth/ip120 / minute / IP/v1/oauth/:app_id/authorize, token, revoke and requests/*, when sent without an Authorization header
oauth_register/ip20 / hour / IPPOST /v1/oauth/:app_id/register
workspace_challenges/ip6000 / minute / IP/v1/workspaces/:id/challenges and /v1/workspaces/:id/challenges/:id (instead of api/ip)
scim/ip120 / 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.