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.
400invalid_jsonRequestThe body was sent as JSON but does not parse.
400invalid_optionsRequestoptions was not valid JSON, named a key the API does not know, or held a value of the wrong type; the message names the key.
400invalid_citation_styleRequestcitationStyle was not APA, MLA or Chicago.
400invalid_includeRequestinclude named a report part that does not exist; the message lists the parts.
400invalid_cursorRequestcursor on GET /v1/checks was not the nextCursor of a previous page.
400invalid_idempotency_keyRequestThe Idempotency-Key header was empty or over 200 characters.
400invalid_source_ruleRequestA source rule failed validation; the message names the field.
400no_checks_selectedRequestEvery pass in options was off; turn on at least one.
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: damaged, password-protected, or a scan with no readable text.
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.
402payment_past_dueBillingThe plan's last payment failed; plan checks resume once the card is updated.
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