> ## Documentation Index
> Fetch the complete documentation index at: https://docs.provisionapp.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> The error envelope, every error code the API returns, and which ones to retry.

Every error comes back in the same envelope, with an HTTP status and a machine-readable `code`:

```json theme={null}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "filters: Invalid filters, limit: Too big"
  }
}
```

* **Branch on `code`**, not on `message`. Codes are stable; messages are written for people and can change.
* **Log `message`.** For `400` errors it names every field that failed, as `field: problem`, separated by commas.
* **Keep the request id.** Errors from the API gateway (`401`, most `403`s, `429`) also carry `requestId` in the body. Every response carries it in the `x-amzn-RequestId` header. Include it when you email [help@onevisionresources.com](mailto:help@onevisionresources.com).

## Error codes

| Status and `code` | What happened | Retry? |
| - | - | - |
| `400` `BAD_REQUEST` | A path parameter, query parameter, or body field is missing or invalid. This includes malformed `filters`, an unknown `include` value, and an unknown or mistyped custom property. | No. Fix the request. |
| `400` `INVALID_LABEL` | A client email or phone number has a `label` name that doesn't exist. | No. |
| `401` `UNAUTHORIZED` | No `x-api-key` header was sent. | No. Send the key. |
| `403` `ACCESS_DENIED` | The key is unknown, revoked, or was rotated out. | No. |
| `403` `INVALID_API_KEY` | A new or regenerated key hasn't finished activating. | Yes, for a few minutes. |
| `403` `FORBIDDEN` | The key is valid but lacks the [scope](https://docs.provisionapp.io/permissions.md) this endpoint needs, or your partner doesn't have access to ProVision Projects. | No. Add the scope. |
| `404` `NOT_FOUND` | The record doesn't exist, was deleted, or belongs to another partner. | No. |
| `409` `CONFLICT` | The request clashes with an existing record. `POST /v1/user` returns it when the email already belongs to a user. | No. Use a different email. |
| `422` `UNPROCESSABLE_ENTITY` | The request is well formed but ProVision couldn't carry it out. The message says why. | No. |
| `422` `UNIQUE_CONSTRAINT` | A client update would duplicate a value that must be unique. | No. |
| `422` `DUPLICATE_SITE` | A site with this address already exists. | No. Use the existing site. |
| `422` `USER_INACTIVE` | The user is deactivated, so its permission groups cannot be changed. | No. |
| `422` `UPLOAD_NOT_FOUND` | A site file was registered before its upload finished. See [Site files](https://docs.provisionapp.io/site-files.md). | Yes, after the upload completes. |
| `422` `DUPLICATE_SITE_FILE` | That `fileKey` is already registered on the site. | No. |
| `429` `THROTTLED` | The key went over its rate limit. See [Rate limits](https://docs.provisionapp.io/rate-limits.md). | Yes. Honour `Retry-After`. |
| `500` `AUTHORIZER_FAILURE` | The key couldn't be checked because of a temporary internal failure. | Yes, with backoff. |
| `500` `INTERNAL_SERVER_ERROR` | Something failed on our side. | Yes, with backoff. |

> [!NOTE]
>
> A record that belongs to another partner returns `404`, not `403`. The API never confirms
> that a record you can't access exists.

## Retrying safely

Retry only the codes marked **Yes** above. Use exponential backoff with jitter, and give up after a few attempts.

Every other `4xx` will fail the same way again, so retrying it only uses up your [rate limit](https://docs.provisionapp.io/rate-limits.md).

> [!WARNING]
>
> A `500` on a request that creates something, like `POST /v1/conversation/submit` or `POST
>     /v1/client`, can arrive after the record was saved. Before you retry, check whether the
> record exists, for example by listing with a `search` or `filters` that would find it.

Updates (`PATCH`), and applying or removing labels and links (`PUT` / `DELETE`), are safe to repeat: sending the same request twice leaves the record in the same state.

## Common causes of `400`

* **`filters` isn't URL-encoded.** Encode the JSON array. With curl, use `-G --data-urlencode`. See [Listing and filtering](https://docs.provisionapp.io/listing-and-filtering.md#filters).
* **An attribute isn't in the list's allowed set.** Each list has its own [filter and sort fields](https://docs.provisionapp.io/listing-and-filtering.md#what-each-list-supports).
* **A custom property id is unknown, or its value has the wrong type.** The message names the property, for example `customProperties.region: unknown custom property`. See [Custom properties and labels](https://docs.provisionapp.io/custom-properties-and-labels.md).
* **An id has the wrong format.** Record ids are UUIDs, except user ids, which start with `ovuid-`.
* **The conversation is closed.** A closed conversation can't be updated. See [Conversation status](https://docs.provisionapp.io/conversation-status.md#closed-conversations).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.