> 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

REST — error codes, response shape.

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