# Errors

The API uses standard HTTP status codes. All errors return the same JSON envelope, for example:

```json
{"code": "PERMISSION_DENIED", "message": "Permission denied"}
```

Some responses include a `context` object with structured details. Every response carries a `request-id` header, share it with support when reporting issues.

Status
Code
Description
400
VALIDATION
Malformed JSON or invalid field constraints. 
context.constraints
lists per-field failures.
401
UNAUTHENTICATED
Invalid or missing API key.
403
PERMISSION_DENIED
Key lacks the required scope, or channel-bound key calling outside its channels.
404
NOT_FOUND
Resource does not exist.
404
ENDPOINT_NOT_FOUND
Endpoint does not exist.
409
IDEMPOTENCY_KEY_IN_USE
A request with the same idempotency key is still in progress. Retry after the first request completes.
422
varies
Request conflicts with current business or system state, for example 
ENDPOINT_ALREADY_EXISTS
or 
IDEMPOTENCY_KEY_REUSED
.
429
RATE_LIMIT
Quota exhausted. Check 
context.next_try_at
.
500
INTERNAL
Server-side failure.
For help, contact us.