Getting started

Errors

Every error is JSON with a stable machine-readable code and a human-readable message. Branch on the code, show the message.

The envelope

{
  "error": {
    "code": "quota_exceeded",
    "message": "This check needs 720 credits; 300 remain. Buy a credit pack from your account."
  }
}

code is stable and safe to branch on. message is written for a person and may change; show it, do not parse it. Throttled responses also carry a Retry-After header in seconds.

Codes

StatusCodeFamilyMeaning
400invalid_bodyRequestThe body failed validation; the message names the field.
400invalid_viewRequestview was not summary or full.
400no_inputDocumentNeither text nor file was sent.
400multiple_inputsDocumentBoth text and file were sent; send one.
400too_short, too_longDocumentThe word count is outside the per-check range. Judged at submission, for files too.
400unsupported_typeDocumentThe bytes are no format the API reads; the message lists what it does.
400unreadable_file, invalid_fileDocumentA supported format that could not be parsed.
400unsupported_languageDocumentWritten mostly in a script without spaces between words.
413file_too_largeDocumentOver the upload cap; the message says the cap.
401unauthorized, invalid_api_keyAuthMissing, unknown or revoked key.
403insufficient_scopeAuthThe key lacks the scope this call needs.
403key_not_permittedAuthThe endpoint is not part of the public API.
402quota_exceeded, no_active_planBillingNot enough credits for this check.
404not_foundLookupNo such check on this account.
409concurrent_limitThrottleToo many checks in flight; wait for one or cancel it.
409still_runningStateYou tried to delete a check that has not finished.
409already_finalStateYou tried to cancel a check that already finished.
429rate_limitedThrottleToo many requests; honor Retry-After.
5xxinternalServerSomething broke on our side. Safe to retry with backoff.

Refusals never cost credits

A 400, 402, 413 or 429 at submission means no check was created and nothing was charged. A check that reaches rejected or failed after acceptance releases its credit reservation too, and its rejection.code says why.

Idempotent retries

A network failure after POST /v1/checks leaves you unsure whether the check was created. Send an Idempotency-Key header and retry with the same key: the API answers the first check's id with Idempotent-Replayed: true and never starts or charges a second check. See Idempotent requests.

On this page