Errors and status codes
The error shape, every status code, the codes in the body and what to do about each.
The error shape
Every error is JSON. Errors raised by Hostemi carry msg, a sentence for a person, and where a program has to tell cases apart a code (with more fields that belong to it). A request that fails validation gets the framework's shape, with one line per field:
Hostemi error
{
"code": "SCOPE_REQUIRED",
"scope": "pms:write",
"msg": "This API key is missing the required permission: pms:write",
"required": [
"pms:write"
],
"granted": [
"pms:read"
],
"role": "MEMBER"
}Validation
{
"statusCode": 400,
"message": [
"from must be a valid ISO 8601 date string"
],
"error": "Bad Request"
}Status codes
| Status | Meaning | Retry? |
|---|---|---|
| 200, 201 | Done. | |
| 202 | APPROVAL_REQUIRED: stored for the host, nothing changed. Changes and approvals. | no: follow the change |
| 400 | The body or a parameter did not validate, or a preview feature is not on for the workspace (FEATURE_NOT_AVAILABLE). | no: fix the request |
| 401 | No credential, an unknown one, or a token for another resource. | no: fix the credential |
| 403 | SCOPE_REQUIRED, PLAN_REQUIRED or HUMAN_ONLY (below). | no |
| 404 | No such object in this workspace (also for an object in another workspace), or a preview route the workspace does not have. | no |
| 409 | A conflict: an Idempotency-Key in use or reused, or a change the object cannot take now (moving a platform booking). | depends: read msg |
| 429 | Rate limited. | yes, after Retry-After |
| 500 | Our failure. | yes, with backoff |
Codes in the body
| code | What to do |
|---|---|
SCOPE_REQUIRED | The key lacks scope; required, granted and the owner's role are in the body. Use a key with that scope. |
PLAN_REQUIRED | The plan does not include this. With plan, reason, message and fix. No plan or Basic: every call but /status; a plan that ended: every write (reads still work); the CSV export needs Complete. |
HUMAN_ONLY | Only the host can do this, in the app; appUrl is the page. |
APPROVAL_REQUIRED | (In a 202.) Waits for the host. |
FEATURE_NOT_AVAILABLE | An option of a preview feature this workspace does not have. |
UNCLASSIFIED_WRITE | A write route the approval policy does not know: our bug. Nothing ran; tell us. |
Not found is not forbidden
An id from another workspace answers 404, exactly like one that never existed: an id is not a way to find out what exists elsewhere.
Something missing from this page? Write to [email protected], or use the form on the Help page.