Errors, retries and idempotency
Available in the APIAvailable in the API on every endpoint. Each problem's doc_url points at its code's row on this page.
Problem details
A field out of range
curl https://api.arabinames.assentify.com/v1/transliterate \
-H "Authorization: Bearer $ARABINAMES_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Rami","max_results":50}'{
"type": "https://arabinames.assentify.com/docs/errors#validation_error",
"title": "Validation error",
"status": 422,
"code": "validation_error",
"detail": "Number must be less than or equal to 20",
"param": "max_results",
"request_id": "req_example",
"doc_url": "https://arabinames.assentify.com/docs/errors#validation_error"
}The gateway's answer, with its request id replaced. Errors bill zero units.
| Field | Type | Meaning |
|---|---|---|
| type, doc_url | string | A link to the code's entry below. |
| title | string | Short and stable per code. |
| status | integer | The HTTP status, repeated. |
| code | string | The stable identifier. Branch on this, not on title or detail. |
| detail | string | What to change, in plain words. Never the name you sent. |
| param | string | The field at fault, when there is one. Idempotency-Key for a bad header. |
| request_id | string | Also in the X-Request-Id header of every response. Quote it to support. |
| positions | integer[] | For invalid_name_characters: where the refused characters are. |
| errors | object[] | For batch_invalid: index, custom_id, code and param per bad item. |
Errors are sent as application/problem+json with Assentify-Units: 0. A Retry-After header, in seconds, comes with the codes that can be retried after a wait.
Every error code
| Status | Code | Meaning | Retry |
|---|---|---|---|
| 400 | invalid_json | The body is not valid JSON. | After a fix |
| 400 | invalid_encoding | The body is not valid UTF-8. | After a fix |
| 400 | key_in_query_string | The key was sent in the URL. Send it in the Authorization header, then rotate it: URLs end up in logs. | After a fix |
| 401 | missing_api_key | No Authorization: Bearer header (or X-API-Key header). | After a fix |
| 401 | invalid_api_key | The key is malformed, its checksum does not match, or it is unknown. | After a fix |
| 401 | api_key_revoked | The key was revoked. Use another key. | No |
| 401 | api_key_expired | The key passed its expiry date. Use another key. | No |
| 403 | ip_not_allowed | The calling address is not in the key's IP allowlist. | After a fix |
| 403 | insufficient_scope | The key lacks the scope this endpoint needs, for example webhooks:manage. | After a fix |
| 403 | plan_feature_unavailable | The feature is not on your plan, or not available yet (extended variants). | No |
| 403 | account_suspended | The account is suspended. Contact support. | No |
| 403 | https_required | The call came over plain HTTP. Use HTTPS. | After a fix |
| 404 | not_found | Unknown path, or an id that is not yours. | No |
| 405 | method_not_allowed | The path exists with other methods; the Allow header lists them. | After a fix |
| 409 | idempotency_conflict | The Idempotency-Key was used with a different body or operation. Use a new key. | After a fix |
| 409 | idempotency_in_progress | The first request with this key is still running. Retry after Retry-After (1 second). | Yes |
| 409 | batch_not_cancellable | The batch has already ended. | No |
| 410 | batch_results_expired | The results were deleted at results_expire_at. Run the batch again. | No |
| 413 | payload_too_large | The body is over 64 KB (2 MB for batches). | After a fix |
| 415 | unsupported_media_type | Send Content-Type: application/json. | After a fix |
| 422 | validation_error | A field is missing, of the wrong type or out of range. param names it. | After a fix |
| 422 | invalid_name_characters | The name holds a control character, a digit, a symbol or another refused character. positions says where. | After a fix |
| 422 | empty_after_normalisation | Nothing is left once invisible and control characters are removed. | After a fix |
| 422 | name_too_long | Over 200 characters after cleaning. | After a fix |
| 422 | too_many_tokens | Over 12 tokens after cleaning. | After a fix |
| 422 | mixed_script_token | One token mixes Arabic and Latin letters and cannot be split. | After a fix |
| 422 | unsupported_script | Letters outside Arabic and Latin script. | No |
| 422 | unsupported_name_type | name_type other than person. | After a fix |
| 422 | scoring_version_unavailable | A match scoring_version that is not served. GET /v1/meta lists the served versions. | After a fix |
| 422 | batch_invalid | At least one batch item failed validation; errors[] lists each by index and custom_id. | After a fix |
| 429 | rate_limited | Over your plan's requests per second. Wait for Retry-After. | Yes |
| 429 | quota_exceeded | The Free plan used its monthly units. Retry-After is 3600; calls work again next month or after an upgrade. | Later |
| 429 | spend_cap_reached | A paid account's overage reached its spend cap for the month. Retry-After is 3600; calls work again next month or once the account owner raises the cap. | Later |
| 429 | concurrency_limited | Too many batches running for your plan. Retry after Retry-After (10 seconds). | Yes |
| 500 | internal_error | Unexpected error on our side. Retry once with the same Idempotency-Key; quote the request id if it persists. | Yes |
| 502 | engine_error | The engine returned an error. Retry with backoff. | Yes |
| 502 | engine_output_invalid | The engine returned no well-formed name in the target script. A retry gives the same answer; quote the request id. | No |
| 503 | engine_unavailable | The engine is unavailable. Retry with backoff. | Yes |
| 503 | maintenance | Planned maintenance. In the catalogue; the gateway does not return it yet. | Later |
| 504 | engine_timeout | The engine did not answer in time. Retry with backoff. | Yes |
When to retry
- Yes:
429 rate_limited,429 concurrency_limited,409 idempotency_in_progress,500 internal_error,502 engine_error,503 engine_unavailable,504 engine_timeout, and network failures where no answer arrived. - Wait at least
Retry-Afterwhen it is present (2 seconds on the engine codes), then back off exponentially with jitter. Cap the attempts; five is plenty for a sync call. - Send every retry with the same
Idempotency-Keyand the same body, so a call that did succeed is never billed twice. - No: any other
4xxgives the same answer until you change the request, the key or the plan.502 engine_output_invalidalso repeats for the same input.
Idempotency
Add an Idempotency-Key header to any POST: 1 to 255 printable ASCII characters, unique per logical operation. A UUID per attempt chain works.
A retry with the same key and body is not billed again
curl https://api.arabinames.assentify.com/v1/transliterate \
-H "Authorization: Bearer $ARABINAMES_KEY" \
-H "Idempotency-Key: order-4821-attempt" \
-H "Content-Type: application/json" \
-d '{"text":"Rami Haddad","max_results":2}'Assentify-Units: 0
{
"id": "tr_example",
"object": "transliteration",
"source_script": "latn",
"target_script": "arab",
"results": [
{
"text": "رامي حداد",
"rank": 1
}
],
"tokens": null,
"hints": {
"dialect": "auto",
"orthography": "auto",
"source": "default",
"applied": "none"
},
"warnings": [],
"engine_version": "mock-1",
"units": 0
}Fixture spellings (engine_version mock-1), which is what a test key returns. A live key returns the engine's spellings in the same fields and bills the units shown; a test key bills 0.
- Sync endpoints (
/transliterate,/variants,/normalise, and/matchonce it opens): a repeat with the same key and the same JSON body within 24 hours is computed again and returnsunits: 0. The response itself is never stored; only hashes of the key and body and the units are kept. - Batches: a repeat within 24 hours returns the batch the first call created, with
202, instead of a second batch. - Keys are scoped to your account and the key's environment (live or test), not to one API key, so rotating a key keeps retry protection.
- Field order in the JSON body does not matter; any other change does.
The same key with a different body
curl https://api.arabinames.assentify.com/v1/transliterate \
-H "Authorization: Bearer $ARABINAMES_KEY" \
-H "Idempotency-Key: order-4821-attempt" \
-H "Content-Type: application/json" \
-d '{"text":"Rami Khoury","max_results":2}'{
"type": "https://arabinames.assentify.com/docs/errors#idempotency_conflict",
"title": "Idempotency key reused with a different body",
"status": 409,
"code": "idempotency_conflict",
"detail": "Use a new idempotency key for a different body or operation.",
"request_id": "req_example",
"doc_url": "https://arabinames.assentify.com/docs/errors#idempotency_conflict"
}The gateway's answer, with its request id replaced. Errors bill zero units.
Idempotency edge cases
- A repeat while the first call is still running gets
409 idempotency_in_progresswithRetry-After: 1. - A first call that failed releases the key, so the retry that succeeds is billed once.
- The same key on another endpoint is a conflict, even with the same body.
- A malformed header (empty, too long, non-ASCII) is
422 validation_errorwithparam: "Idempotency-Key". - Retries still count toward your rate limit.
Errors and units
An error bills zero units, whatever the code, and says so in Assentify-Units: 0. Errors on the name endpoints still show in GET /v1/usage as calls and errors, with zero units.