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

# Errors

Errors use the same envelope structure as successful responses.

```json theme={null}
{
  "data": null,
  "error": {
    "code": "validation_error",
    "message": "Request payload is invalid",
    "details": {}
  },
  "request_id": "req_..."
}
```

## Common status codes

| Status | Meaning                                                                        |
| ------ | ------------------------------------------------------------------------------ |
| `400`  | The request payload, path parameter, or query parameter is invalid.            |
| `401`  | The caller is not authenticated or the session is invalid.                     |
| `404`  | The requested resource does not exist in the current workspace or environment. |

## Request IDs

Include `request_id` when you report API issues.

## Authentication failures

Protected routes require a workspace API key in `Authorization: Bearer <api_key>`.

## Environment mistakes

Environment-scoped routes default to `sandbox`. always pass `environment=live` explicitly when operating on
live workspace resources.
