Errors, retries and idempotency

Available in the API
Every error is an RFC 9457 problem with a stable code and the request id. No error ever contains the name you sent, and no error is billed. This page lists every code, says when a retry helps, and shows how an Idempotency-Key makes retries safe.

Available 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}'
Response 422
{
  "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.

FieldTypeMeaning
type, doc_urlstringA link to the code's entry below.
titlestringShort and stable per code.
statusintegerThe HTTP status, repeated.
codestringThe stable identifier. Branch on this, not on title or detail.
detailstringWhat to change, in plain words. Never the name you sent.
paramstringThe field at fault, when there is one. Idempotency-Key for a bad header.
request_idstringAlso in the X-Request-Id header of every response. Quote it to support.
positionsinteger[]For invalid_name_characters: where the refused characters are.
errorsobject[]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

StatusCodeMeaningRetry
400invalid_jsonThe body is not valid JSON.After a fix
400invalid_encodingThe body is not valid UTF-8.After a fix
400key_in_query_stringThe key was sent in the URL. Send it in the Authorization header, then rotate it: URLs end up in logs.After a fix
401missing_api_keyNo Authorization: Bearer header (or X-API-Key header).After a fix
401invalid_api_keyThe key is malformed, its checksum does not match, or it is unknown.After a fix
401api_key_revokedThe key was revoked. Use another key.No
401api_key_expiredThe key passed its expiry date. Use another key.No
403ip_not_allowedThe calling address is not in the key's IP allowlist.After a fix
403insufficient_scopeThe key lacks the scope this endpoint needs, for example webhooks:manage.After a fix
403plan_feature_unavailableThe feature is not on your plan, or not available yet (extended variants).No
403account_suspendedThe account is suspended. Contact support.No
403https_requiredThe call came over plain HTTP. Use HTTPS.After a fix
404not_foundUnknown path, or an id that is not yours.No
405method_not_allowedThe path exists with other methods; the Allow header lists them.After a fix
409idempotency_conflictThe Idempotency-Key was used with a different body or operation. Use a new key.After a fix
409idempotency_in_progressThe first request with this key is still running. Retry after Retry-After (1 second).Yes
409batch_not_cancellableThe batch has already ended.No
410batch_results_expiredThe results were deleted at results_expire_at. Run the batch again.No
413payload_too_largeThe body is over 64 KB (2 MB for batches).After a fix
415unsupported_media_typeSend Content-Type: application/json.After a fix
422validation_errorA field is missing, of the wrong type or out of range. param names it.After a fix
422invalid_name_charactersThe name holds a control character, a digit, a symbol or another refused character. positions says where.After a fix
422empty_after_normalisationNothing is left once invisible and control characters are removed.After a fix
422name_too_longOver 200 characters after cleaning.After a fix
422too_many_tokensOver 12 tokens after cleaning.After a fix
422mixed_script_tokenOne token mixes Arabic and Latin letters and cannot be split.After a fix
422unsupported_scriptLetters outside Arabic and Latin script.No
422unsupported_name_typename_type other than person.After a fix
422scoring_version_unavailableA match scoring_version that is not served. GET /v1/meta lists the served versions.After a fix
422batch_invalidAt least one batch item failed validation; errors[] lists each by index and custom_id.After a fix
429rate_limitedOver your plan's requests per second. Wait for Retry-After.Yes
429quota_exceededThe Free plan used its monthly units. Retry-After is 3600; calls work again next month or after an upgrade.Later
429spend_cap_reachedA 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
429concurrency_limitedToo many batches running for your plan. Retry after Retry-After (10 seconds).Yes
500internal_errorUnexpected error on our side. Retry once with the same Idempotency-Key; quote the request id if it persists.Yes
502engine_errorThe engine returned an error. Retry with backoff.Yes
502engine_output_invalidThe engine returned no well-formed name in the target script. A retry gives the same answer; quote the request id.No
503engine_unavailableThe engine is unavailable. Retry with backoff.Yes
503maintenancePlanned maintenance. In the catalogue; the gateway does not return it yet.Later
504engine_timeoutThe 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-After when 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-Key and the same body, so a call that did succeed is never billed twice.
  • No: any other 4xx gives the same answer until you change the request, the key or the plan. 502 engine_output_invalid also 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}'
Response 200
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 /match once it opens): a repeat with the same key and the same JSON body within 24 hours is computed again and returns units: 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}'
Response 409
{
  "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_progress with Retry-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_error with param: "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.