> For the complete documentation index, see [llms.txt](https://docs.aohwv.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aohwv.dev/developer-and-api/errors-and-rate-limits.md).

# Errors & Rate Limits

## Error format

All API errors return a JSON body with a single `error` field describing what went wrong:

```json
{
  "error": "missing or invalid API key"
}
```

The HTTP status code tells you the category of error; the `error` string gives the specifics.

## HTTP status codes

| Status code | Meaning                                                                 |
| ----------- | ----------------------------------------------------------------------- |
| `200`       | Request succeeded.                                                      |
| `201`       | Resource created (e.g. webhook subscription).                           |
| `202`       | Request accepted for asynchronous processing (e.g. sync job triggered). |
| `204`       | Resource deleted — no response body.                                    |
| `400`       | Bad request — the request body is missing required fields or malformed. |
| `401`       | Missing or invalid `X-API-Key` header.                                  |
| `404`       | The requested resource does not exist.                                  |
| `500`       | Internal server error — something went wrong on AOH Sync's side.        |

## Common error scenarios

### 401 — Missing or invalid API key

This is returned whenever the `X-API-Key` header is absent or the key is not recognised. The `/v1/health` endpoint is the only route that does not require a key.

```bash
curl -s "https://api.cloudsync.io/v1/identities"
# → 401 {"error":"missing or invalid API key"}
```

### 400 — Bad request

Returned when a required field is missing from a request body or a value is invalid. For example, calling `POST /v1/webhooks` without a `callback_url` or `events` array returns 400.

```json
{
  "error": "callback_url is required"
}
```

### 404 — Not found

Returned when you reference an ID that does not exist in your tenant, or that belongs to a different tenant.

### 500 — Internal error

These are unexpected server-side failures. If you receive repeated 500 responses, contact AOH Sync support with the request details and timestamp.

## Rate limits

## Related

* [API Overview & Authentication](/developer-and-api/developer-api.md)
* [Public API Reference](/developer-and-api/reference.md)
* [Webhooks](/developer-and-api/webhooks.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.aohwv.dev/developer-and-api/errors-and-rate-limits.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
