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

# Handle API Errors

> Branch on stable Layarva error codes and preserve correlation IDs for support.

Queue API errors use:

```json theme={null}
{
  "error": {
    "code": "SERVICE_NOT_ALLOWED",
    "message": "Credential is not authorized for this service."
  }
}
```

Never parse the human-readable message.

| Status | Representative codes                                                     |
| ------ | ------------------------------------------------------------------------ |
| 400    | `REPLAY_PROTECTION_REQUIRED`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_JSON` |
| 401    | `AUTHENTICATION_REQUIRED`, `INVALID_CREDENTIAL`, `STALE_REQUEST`         |
| 403    | `INSUFFICIENT_SCOPE`, `LOCATION_NOT_ALLOWED`, `SERVICE_NOT_ALLOWED`      |
| 404    | `SERVICE_NOT_FOUND`, `TICKET_NOT_FOUND`                                  |
| 409    | `REPLAY_DETECTED`, `IDEMPOTENCY_CONFLICT`, `QUEUE_UNIT_EDGE_MANAGED`     |
| 413    | `REQUEST_TOO_LARGE`                                                      |
| 422    | `VALIDATION_ERROR`                                                       |
| 429    | `RATE_LIMITED`                                                           |

Log the stable code, HTTP status, correlation ID, and operation identity. Do not log API keys, raw PINs, or webhook secrets.

## Related guides

* [Queue API Quickstart](/developers/queue-api)
* [Authenticate Queue API Requests](/developers/authentication)
* [Queue API Rate Limits](/developers/rate-limits)
