ResilientLang docsDeveloper documentation (draft, product name is a placeholder)

Errors

Errors are RFC 9457 application/problem+json: type, title, status, optional detail, errors (per-field messages) and instance. Branch on status, and on type for the codes listed below. The table at the bottom of this page is generated from the OpenAPI file and is the complete list.

402: plan, allowance or licence#

When a plan limit, the AI-word allowance or the licence state blocks an action, the API answers 402 with Retry-After where a reset time is known. Permission problems stay 403. The type is urn:resilientlang:problem:<code> like every other API error, and all of these codes are in the generated table at the end of this page.

CodeMeaningWhat to do
site-limitThe plan's site limit is reachedRemove a site or change plan
language-limitToo many target languages for the planRemove a language or change plan
ai-words-exhaustedThe plan's AI-word allowance is used upAdd a word pack, wait for the period to renew, or bring your own provider key
quota-exhaustedThe AI-word allowance for this period is used up (quota gate); see Retry-After and resetsOnAs above
machine-translation-disabledMachine translation is not available because the licence is not activeRenew to translate new strings
daily-ceilingDaily translation limit reachedRetry after Retry-After (next UTC day)
strings-capThe plan limit on submitted strings is reachedChange plan or wait for the next period
lapsed-publish-blockedPublishing is blocked because the plan or licence has lapsedRenew; published bundles stay live
licence-inactiveThe licence does not allow translate, add a language or publishRenew; published bundles stay live
feature-unavailableThe plan does not include this featureChange plan

Existing translations and published bundles are never affected by a 402. To see where you stand before you hit a limit, call GET /v1/usage/quota (plan, period, used and remaining words, and a state of ok, soft or exhausted). It answers 404 on a deployment where quotas are not enabled.

Entitlement problems (the plan checks) also carry code, limit, used and remaining as numbers only.

403: suspended account#

account-suspended means the account or site is suspended. Writes are refused; reads and already-published translations keep working. Other 403 types are insufficient-scope (the key lacks the scope shown in the reference), site-restricted-key, origin-not-allowed (discover) and test-key-cannot-issue.

503: a check could not be completed#

gate-unavailable means a plan, quota, licence or suspension check could not run. The API fails closed: it refuses the request rather than letting work through unchecked, and sends Retry-After: 5. Retry shortly. If usage metering cannot write its ledger, translation fails the same way so usage is never silently lost.

service-unavailable means the service could not reach its database (or the call timed out) and nothing was changed. Public pages and published bundles keep working. The API answers 503 with Retry-After: 30; retry after that many seconds.

In the SDKs#

The Python, PHP and Go SDKs expose these fields and a hint for 402, 403 and 503: see SDK error handling.

Rate limits and idempotency#

429 carries Retry-After. A repeated write with the same Idempotency-Key returns the stored response with Idempotent-Replayed: true; the same key with a different request is 422; the same key while the first request is still running is 409.

Problem types in the control-plane API#

Generated from the x-problem-types list in openapi.json:

StatusTypeMeaning
400urn:resilientlang:problem:validationOne or more fields are invalid; see errors{field: [messages]}.
400urn:resilientlang:problem:bad-jsonThe body is not valid JSON for this endpoint.
400urn:resilientlang:problem:bad-requestMalformed request (missing body, malformed multipart, too many parts).
400urn:resilientlang:problem:no-allowed-originsThe site has no allowed origins, so it cannot be scanned.
400urn:resilientlang:problem:import-formatThe uploaded file could not be read (malformed, not UTF-8, DTD, over limits).
401urn:resilientlang:problem:unauthorizedMissing, malformed, unknown, expired or revoked secret key.
403urn:resilientlang:problem:insufficient-scopeThe key lacks the scope this endpoint requires.
403urn:resilientlang:problem:account-suspendedThe account or site is suspended: writes are refused, reads and already-published translations keep working.
403urn:resilientlang:problem:site-restricted-keyThe key is restricted to one site and cannot do this.
403urn:resilientlang:problem:origin-not-allowedDiscover: unknown site key or the request Origin is not allowed.
403urn:resilientlang:problem:test-key-cannot-issueTest keys cannot create keys.
404urn:resilientlang:problem:not-foundThe resource does not exist or is not accessible with this key.
405urn:resilientlang:problem:method-not-allowedWrong HTTP method for the path.
402urn:resilientlang:problem:quota-exhaustedThe AI-word allowance for this period is used up. See Retry-After and resetsOn; add a word pack or bring your own provider key.
402urn:resilientlang:problem:machine-translation-disabledMachine translation is not available (licence not active).
402urn:resilientlang:problem:daily-ceilingDaily translation limit reached; retry after Retry-After.
402urn:resilientlang:problem:strings-capThe plan limit on submitted strings is reached.
402urn:resilientlang:problem:site-limitThe plan allows no more sites.
402urn:resilientlang:problem:language-limitThe plan allows no more target languages.
402urn:resilientlang:problem:ai-words-exhaustedThe plan's AI-word allowance is exhausted.
402urn:resilientlang:problem:lapsed-publish-blockedPublishing is blocked because the plan or licence has lapsed.
402urn:resilientlang:problem:feature-unavailableThe plan does not include this feature.
402urn:resilientlang:problem:licence-inactiveThe licence does not allow this action (translate, add_language, publish); already-published bundles keep being served.
409urn:resilientlang:problem:idempotency-in-flightA request with the same Idempotency-Key is still running; retry after Retry-After.
413urn:resilientlang:problem:payload-too-largeThe body or file exceeds the limit.
415urn:resilientlang:problem:unsupported-media-typeUse application/json (or multipart/form-data for import).
422urn:resilientlang:problem:idempotency-key-reusedThe Idempotency-Key was used with a different request.
422urn:resilientlang:problem:import-rejectedThe import has errors; nothing was written. See issues[].
429urn:resilientlang:problem:rate-limitedToo many requests; wait Retry-After seconds.
429urn:resilientlang:problem:limit-reachedA hard abuse ceiling that does not depend on the plan was reached (for example the number of source strings one site may hold, ResilientLang:Limits:MaxStringsPerSite).
503urn:resilientlang:problem:gate-unavailableA plan, quota, licence or suspension check could not be completed (fails closed); retry after Retry-After.
503urn:resilientlang:problem:service-unavailableThe service could not reach its database (or it timed out); nothing was changed. Retry after Retry-After.
500urn:resilientlang:problem:internalUnexpected error; quote the reference in detail when reporting it.