API referenceTutorialsmarkdownbrain.ai

Errors

A refusal is a status code and a JSON body in one shape:

{ "error": { "code": "conflict", "message": "VERSION_MISMATCH: the file changed since you read it", "details": { } } }
  • code is one of the codes below, and is what a program should branch on.
  • message is a sentence for a person, and can change between releases.
  • details is present only for a refusal whose message is itself a JSON document, such as a quote that matches more than once and the candidates it matched. It is the same document, already parsed.

Status codes

CodeStatus
invalid_argument400
forbidden403
not_found404
conflict409
too_large413
limited429
unavailable503
internal500

Two more answers come before an operation runs. An unusable credential is 401 with the code unauthenticated (see Authentication), and an address under /v1 that names no route is 404 with not_found.

An argument that fails its operation's schema is 400 invalid_argument, and the message names the argument at fault. An argument the operation does not take is refused the same way rather than ignored.