Errors

Non-2xx responses use this envelope. Branch on error.code, not on the English message.

{
  "error": {
    "code": "not_found",
    "message": "Project not found",
    "request_id": "…"
  }
}

Always log request_id and send it to support. The same value is also on the X-Request-ID response header.

Optional extras on the envelope include required / available / shortfall on payment_required, and current_status on not_awaiting_payment (intelligence resume) when the project status is known.

Do not parse a top-level detail string — that shape is gone on /v1.

Validation

400 / 422 with validation_failed may include field_errors:

{
  "error": {
    "code": "validation_failed",
    "message": "…",
    "request_id": "…",
    "field_errors": [
      {
        "field": "source_language_code",
        "message": "Field required",
        "type": "missing"
      }
    ]
  }
}

field is the public field name (source_language_code, workflow.0, …). It is null when the offending name has no public equivalent.

field_errors is not always there, and when it is missing the key is absent — not null. You get it when the request failed against the request schema. You do not get it when the rejection is a rule about the request as a whole:

  • an unknown language code on POST /v1/projects (unknown_locale_codes: …)
  • an unknown source language on POST /v1/projects (unknown source_language: …)
  • the source language also listed as a target (source_in_targets: …)
  • an invalid workflow (invalid_workflow: …)
  • target_language_codes that is not a JSON array of strings
  • an unsupported query parameter on GET /v1/projects

All of those return validation_failed with the detail in error.message and no field_errors key at all. Read error.message in that case, and always reach for it defensively — error.get("field_errors", []), never error["field_errors"].

On POST /v1/text/translate an unknown language code is not an error: that target comes back unsupported. A code that is not a language code at all, or one text naming a target language twice, is a 422 with a field_errors entry for each offending code, such as texts.0.target_language_codes.1. See Language codes.

Requester required

If your API key is set to require a requester, a create or translate call without one is rejected with 422:

{
  "error": {
    "code": "validation_failed",
    "message": "This API key requires a requester on every write.",
    "request_id": "6ca2ac1f-1409-494c-9f37-f3c5fd2824cf",
    "field_errors": [
      {
        "field": "requester",
        "message": "This API key requires a requester on every write.",
        "type": "missing"
      }
    ]
  }
}

Send a requester and retry. See Requester.

Common codes

Code Status Meaning
invalid_api_key 401 Missing, unknown, or revoked key
insufficient_scope 403 Valid key, missing scope (required_scope is set)
forbidden 403 Authenticated, but not allowed for this resource
trial_expired 403 The organisation's free trial has ended and it has no subscription. Creating projects and resuming them is refused; reads and downloads still work
subscription_expired 403 The organisation's subscription has ended. Creating projects and resuming them is refused; reads and downloads still work. Contact your account manager to renew
not_found 404 Resource missing or not visible to this key — including an unknown project
method_not_allowed 405 Wrong verb on a real route
gone 410 Route removed on purpose; the body names the replacement when there is one
validation_failed 400 / 422 Bad body or query — see the note on field_errors above
missing_api_version 400 You sent X-API-Version with a value other than 1 (omitting the header is fine)
payment_required 402 Credits short — envelope also has required, available, shortfall
not_awaiting_payment 409 Resume called when the project is not parked for payment — envelope may include current_status on the intelligence-credit path
payload_too_large 413 Upload over 200 MB total or 100 files
idempotency_in_progress 409 Idempotency-Key already used — in flight, or its outcome is unknown
idempotency_conflict 409 Generic 409 fallback. Create never emits it
conflict 409 A ref was reused for a different text on POST /v1/text/translate. Send a new ref when the text changes.
reference_in_use 409 POST /v1/projects: the reference is already used by a project in your organisation that this key can't open. Nothing is created; send a different reference.
delivery_in_progress 409 POST /v1/webhooks/{id}/deliveries/{delivery_id}/redeliver: the delivery is already queued. Wait for it to be sent, then redeliver if it still failed.
subscription_disabled 409 POST /v1/webhooks/{id}/deliveries/{delivery_id}/redeliver: the webhook isn't active. Re-enable it first.
rate_limited 429 Honor Retry-After and X-RateLimit-*
upstream_unavailable 502 / 503 / 504 Safe to retry idempotent calls
internal_error 500 Unexpected failure — include request_id

What to do

  1. Read error.code.
  2. For validation, walk field_errors.
  3. For 402, top up credits and call the matching resume route.
  4. For 429, wait for Retry-After / X-RateLimit-Reset.
  5. Keep request_id when you open a ticket.