Origami

Errors

The shape of an error, and every code the API answers with.

Every error is an RFC 9457 problem document, with the content type application/problem+json:

JSON
{
  "type": "urn:origami:problem:already_exists",
  "title": "Already exists",
  "status": 409,
  "code": "already_exists",
  "detail": "There is a file at docs/a.md."
}
Field
codeWhat a program should branch on. The list below is closed
statusThe HTTP status, the same as the response's
titleA fixed name for the code
detailWhat happened this time, for people. It may change between releases
typeThe code as a URN

Codes

StatusCodeWhen
400invalid_requestThe request is malformed: a missing or wrong field, a bad parameter
400invalid_pathA path with an empty, . or .. segment, a NUL, or too long
400precondition_not_supportedA condition header the API doesn't honour, such as If-Match
401unauthorizedNo API key, or one that isn't valid
403forbiddenKnown, but not allowed to do this
404not_foundNo such workspace in your organization, no such entry, or no such route
404parent_not_foundThe directory an entry would go into doesn't exist
409already_existsSomething is already there: a workspace name, or an entry at a path
409is_a_directoryA file was expected, and a directory is there
409not_a_directoryA directory was expected, and a file is there
409directory_not_emptyA directory with entries, where an empty one is needed
409invalid_moveA directory into itself, or the root
409symlink_loopMore than 40 symlinks in a path
412precondition_failedIf-None-Match: *, and something exists
413too_largeA body over the limit
416invalid_rangeA range outside the file
500internalAnything else. Try again; if it persists, tell us
503busyAnother client holds what's needed and didn't hand it over in time. Try again
503store_unavailableThe workspace's storage isn't configured or can't be reached

Retrying

busy, internal and store_unavailable are worth retrying after a short wait, with backoff. Everything else fails the same way again until the request changes.

A failed command isn't an error of the API: exec answers 200 with the command's exit code.