---
title: "Errors and status codes | Hostemi"
description: "The error shape, every status code, the codes in the body and what to do about each. Step-by-step help from the Hostemi docs for vacation rental hosts."
canonical: https://hostemi.com/docs/api/errors
source: https://hostemi.com/docs/api/errors.md
---

# Errors and status codes

The error shape, every status code, the codes in the body and what to do about each.

#### On this page

1. [The error shape](#the-error-shape)
2. [Status codes](#status-codes)
3. [Codes in the body](#codes-in-the-body)
4. [Not found is not forbidden](#not-found-is-not-forbidden)

## 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**

```json
{
  "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**

```json
{
  "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](https://hostemi.com/docs/api/operations). | 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.

Documentation pages

Something missing from this page? Write to [hello@hostemi.com](mailto:hello@hostemi.com), or use the form on the [Help](https://hostemi.com/help) page.
