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:
{
"type": "urn:origami:problem:already_exists",
"title": "Already exists",
"status": 409,
"code": "already_exists",
"detail": "There is a file at docs/a.md."
}| Field | |
|---|---|
code | What a program should branch on. The list below is closed |
status | The HTTP status, the same as the response's |
title | A fixed name for the code |
detail | What happened this time, for people. It may change between releases |
type | The code as a URN |
Codes
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The request is malformed: a missing or wrong field, a bad parameter |
| 400 | invalid_path | A path with an empty, . or .. segment, a NUL, or too long |
| 400 | precondition_not_supported | A condition header the API doesn't honour, such as If-Match |
| 401 | unauthorized | No API key, or one that isn't valid |
| 403 | forbidden | Known, but not allowed to do this |
| 404 | not_found | No such workspace in your organization, no such entry, or no such route |
| 404 | parent_not_found | The directory an entry would go into doesn't exist |
| 409 | already_exists | Something is already there: a workspace name, or an entry at a path |
| 409 | is_a_directory | A file was expected, and a directory is there |
| 409 | not_a_directory | A directory was expected, and a file is there |
| 409 | directory_not_empty | A directory with entries, where an empty one is needed |
| 409 | invalid_move | A directory into itself, or the root |
| 409 | symlink_loop | More than 40 symlinks in a path |
| 412 | precondition_failed | If-None-Match: *, and something exists |
| 413 | too_large | A body over the limit |
| 416 | invalid_range | A range outside the file |
| 500 | internal | Anything else. Try again; if it persists, tell us |
| 503 | busy | Another client holds what's needed and didn't hand it over in time. Try again |
| 503 | store_unavailable | The 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.