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"
}

Status codes

StatusMeaningRetry?
200, 201Done.
202APPROVAL_REQUIRED: stored for the host, nothing changed. Changes and approvals.no: follow the change
400The body or a parameter did not validate, or a preview feature is not on for the workspace (FEATURE_NOT_AVAILABLE).no: fix the request
401No credential, an unknown one, or a token for another resource.no: fix the credential
403SCOPE_REQUIRED, PLAN_REQUIRED or HUMAN_ONLY (below).no
404No such object in this workspace (also for an object in another workspace), or a preview route the workspace does not have.no
409A conflict: an Idempotency-Key in use or reused, or a change the object cannot take now (moving a platform booking).depends: read msg
429Rate limited.yes, after Retry-After
500Our failure.yes, with backoff

Codes in the body

codeWhat to do
SCOPE_REQUIREDThe key lacks scope; required, granted and the owner's role are in the body. Use a key with that scope.
PLAN_REQUIREDThe 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_ONLYOnly the host can do this, in the app; appUrl is the page.
APPROVAL_REQUIRED(In a 202.) Waits for the host.
FEATURE_NOT_AVAILABLEAn option of a preview feature this workspace does not have.
UNCLASSIFIED_WRITEA 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.