> For the complete documentation index, see [llms.txt](https://docs.layerlens.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layerlens.ai/more-in-this-section-9/errors.md).

# Errors

## Status codes

| Status          | Meaning                                |
| --------------- | -------------------------------------- |
| 200             | OK                                     |
| 201             | Created                                |
| 202             | Accepted (async work queued)           |
| 400             | Validation error                       |
| 401             | Unauthenticated                        |
| 403             | Forbidden (wrong org or missing scope) |
| 404             | Not found                              |
| 409             | Conflict                               |
| 422             | Unprocessable (semantic validation)    |
| 429             | Rate limited                           |
| 500             | Server error                           |
| 502 / 503 / 504 | Transient — retry                      |

## Error body

```json
{
 "error": {
 "code": "validation_error",
 "message": "...",
 "request_id": "req_..."
 }
}
```

## X-Request-ID

Every response — success or error — includes an `X-Request-ID` response header and (for errors) a `request_id` field in the body. Capture it on every call and log it alongside your own request log.

**Why:** when filing a support ticket, the request ID lets us look up the exact server-side log line for your call. Without it, support starts with "what time roughly did this happen and from which IP?"

```typescript
const r = await fetch(url, { headers: { "X-API-Key": key }});
const requestId = r.headers.get("X-Request-ID");
console.log({ requestId, status: r.status });
```

```python
r = httpx.get(url, headers={"X-API-Key": key})
print({"request_id": r.headers["X-Request-ID"], "status": r.status_code})
```

Include the request ID in any support ticket you file with <support@layerlens.ai>.

## See also

* [SDK: errors](/more-in-this-section-9/errors-1.md)
* [Rate limits](/more-in-this-section-9/rate-limits.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.layerlens.ai/more-in-this-section-9/errors.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.
