Skip to content

Errors

Every error from /v1 has the same shape:

{
"error": {
"type": "invalid_request_error",
"code": "validation_failed",
"message": "name is required.",
"request_id": "req_8c1f"
}
}
  • type groups errors by HTTP status: invalid_request_error (400, 413, 415, 422), authentication_error (401), permission_error (403), not_found_error (404), conflict_error (409), rate_limit_error (429), api_error for anything else.
  • code is stable and safe to match on.
  • message is for people. Do not match on it.
  • request_id identifies the call in your request logs. Quote it when you contact support.

The app API under /api returns the shorter { "code": "...", "message": "..." }.

CodeStatusMeaningWhat to do
validation_failed400The request body or a parameter is wrong. The message says which.Fix the request. Retrying will not help.
unauthorized401Missing, expired or wrong credentials, or a wrong authenticator code.Check the credentials. For a signed-in session, sign in again.
email_not_verified401Sign-in worked but the email address is not verified yet.Verify the email, then sign in.
invalid_api_key401The Bearer key is not a valid AirFone key.Check for a revoked, rolled or mistyped key.
forbidden403You are authenticated but not allowed.Use a key or role with the right access.
insufficient_credit402The wallet balance is too low for this. The message says by how much.Add funds, then repeat the request.
sandbox_workspace403Asked of a sandbox organization, such as a live key.Use your business’s own organization.
missing_scope403A restricted key lacks the scope this call needs, or a publishable key was used outside the widget.Use a key with the scope named in the message.
reauthentication_required403A sensitive action needs your password again.Call POST /api/auth/step-up, then retry the same request within five minutes. See Teams and roles.
production_requires_administrator403Making, rolling or revoking a live key needs an admin. A role with only developer.manage is not enough.Ask an admin to do it.
not_found404The resource does not exist in your organization.Check the id and the organization.
conflict409The request clashes with the current state, such as a taken email or a sole owner with members.Read the message and change the state first.
idempotency_in_progress409A request with this Idempotency-Key is still running.Retry after a short wait.
idempotency_key_reused422This Idempotency-Key was already used for a different request (method, path or body differ).Use a new key for a new request. Reuse a key only to retry the identical request.
idempotency_key_too_long400The Idempotency-Key header is too long.Use a shorter key.
unknown_version400The AirFone-Version header names a version that does not exist.Use the version in the message.
body_too_large413A POST with an Idempotency-Key had a body over 1 MB.Send a smaller body.
rate_limited429Too many requests, or too many failed sign-in or step-up attempts.See below.
wrong_cell421The organization lives in another region cell. The message is that cell’s API base.Send the request to that base.
internal500Something failed on our side. Some of these use 501 or 503, for example when payments are not configured.Retry with backoff. Quote the request_id if it persists.
  • API calls are limited per key (each key has its own requests per minute), or per IP when no key is sent. A refused call returns 429 with Retry-After: 60.
  • Ten wrong passwords or wrong sign-in codes lock sign-in for that account for 15 minutes.
  • Five wrong passwords or codes at step-up lock step-up for 15 minutes. The message is “Too many wrong tries. Try again in 15 minutes.”
  • Resending a verification message too often also returns 429.

A sandbox organization only takes test keys. Asking for a live key there is refused with 403 sandbox_workspace and the message “A sandbox only takes test keys. Make live keys in your business’s own organization.” Create the live key in your business’s own organization.

Live use is paid from the organization’s wallet. When the balance is too low, the call is refused with HTTP 402 and a message such as “Your balance is short by Rs 400.00. Add funds and try again.” The code is insufficient_credit. Add funds, then repeat the request.