Docs Errors and limits
Errors and limits
Errors use HTTP status codes and one JSON shape. Program against code; message is written for people and can change.
{
"error": {
"code": "invalid_phone",
"message": "Enter the phone number with its country code, for example +20 100 123 4567.",
"request_id": "rid_tA1n7Pq0…"
}
}Codes
| Status | Code | Meaning |
|---|---|---|
| 401 | unauthorized | Missing, malformed, wrong or revoked key. |
| 402 | plan_required | Live mode needs an active plan. |
| 402 | quota_exceeded | This month's live captures are used up. |
| 402 | test_quota_exceeded | This month's test captures are used up. |
| 403 | ip_not_allowed | The key is limited to other IP addresses. |
| 403 | test_key_required | The simulator works only with a test key. |
| 404 | not_found | No such object in this account and mode. |
| 405 | method_not_allowed | Wrong HTTP method for this path. |
| 409 | not_open | Only open requests can be canceled. |
| 409 | request_closed | The request is no longer open. |
| 409 | not_ready | The capture is not sealed yet. |
| 409 | live_request | Live requests cannot be simulated. |
| 409 | idempotency_in_progress | The first call with this Idempotency-Key is still running. |
| 409 | already_has_credentials | The photo already carries Content Credentials. |
| 409 | unsupported_format | Content Credentials are added to JPEG photos only. |
| 422 | invalid_template | Unknown template. |
| 422 | invalid_shots | No usable shots. |
| 422 | invalid_phone | The phone number could not be read. |
| 422 | invalid_email | The email address is not valid. |
| 422 | invalid_idempotency_key | The Idempotency-Key header is too long or has invalid characters. |
| 422 | idempotency_mismatch | The Idempotency-Key was used with a different body. |
| 422 | invalid_hash | Not a SHA-256 hex string. |
| 429 | rate_limited | Too many requests. See Retry-After. |
| 500 | server_error | Our fault. Safe to retry; quote the request_id if it persists. |
When to retry
- Retry
429afterRetry-Afterseconds, and5xxor network errors with growing delays. - Do not retry
4xxerrors other than 429 without changing the request. - Send an
Idempotency-KeyonPOST /v1/requestsso a retry never creates a duplicate.