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

# Error Codes

> HTTP status codes and error response formats

## HTTP Status Codes

| Status Code | Meaning               | Description                                   |
| ----------- | --------------------- | --------------------------------------------- |
| `200`       | OK                    | Request successful                            |
| `201`       | Created               | Resource created successfully (CMS POST)      |
| `400`       | Bad Request           | Invalid request parameters or body            |
| `401`       | Unauthorized          | Missing or invalid authentication credentials |
| `403`       | Forbidden             | Insufficient permissions for this operation   |
| `404`       | Not Found             | Resource does not exist                       |
| `429`       | Too Many Requests     | Rate limit exceeded                           |
| `500`       | Internal Server Error | Server-side error                             |

## Error Response Format

### CDS Errors

```json theme={null}
{
  "detail": "Invalid Auth Credentials"
}
```

### CMS Errors

```json theme={null}
{
  "error": {
    "code": "BAD_REQUEST_ERROR",
    "description": "Something Went Wrong"
  }
}
```

## Common Error Scenarios

### 401 Unauthorized

<Expandable title="Details">
  **Cause:** Missing or invalid authentication credentials.

  **Solution:** Ensure your `Authorization` header is present and uses valid Base64-encoded credentials.

  ```bash theme={null}
  # Correct
  -H 'Authorization: Basic <BASE64_AUTH_TOKEN>'

  # Wrong - header missing or wrong scheme
  -H 'Authorization: Bearer token'  # Not supported
  ```
</Expandable>

### 400 Bad Request

<Expandable title="Details">
  **Cause:** Invalid request body or missing required fields.

  **Common triggers:**

  * Missing required fields (`name`, `english_name` for categories; `title`, `type`, `status`, `primary_category` for posts)
  * Invalid field types (string where integer expected)
  * Invalid enum values (wrong `type` or `status` value for posts)
</Expandable>

### 404 Not Found

<Expandable title="Details">
  **Cause:** The requested resource does not exist.

  **Common triggers:**

  * Invalid ID or slug in URL path
  * Resource was deleted
  * Wrong `publisher_id`
</Expandable>

### 429 Too Many Requests

<Expandable title="Details">
  **Cause:** Rate limit exceeded.

  **Solution:** Implement exponential backoff and caching. See [Rate Limits](/dxp/documentation/reference/rate-limits).
</Expandable>
