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

# Error Responses

> Standardized error format and status codes used by the Magne API.

# Error Responses

All Magne API errors follow a consistent JSON format:

```json theme={null}
{
  "error": "Human-readable error message"
}
```

## Status Codes

| Code  | Name                  | Description                                                                                                            |
| ----- | --------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `400` | Bad Request           | Invalid input, missing required fields, or validation failure                                                          |
| `401` | Unauthorized          | Missing or invalid authentication token                                                                                |
| `403` | Forbidden             | Authenticated but insufficient permissions for the action                                                              |
| `404` | Not Found             | The requested resource does not exist                                                                                  |
| `409` | Conflict              | Resource already exists (e.g., duplicate username or email)                                                            |
| `429` | Too Many Requests     | Rate limit exceeded — see [Rate Limits](/developers/rate-limits)                                                       |
| `500` | Internal Server Error | Unexpected server error. The response message will always be `"Internal server error"` regardless of the actual cause. |

## Examples

### 400 — Validation Error

```json theme={null}
{
  "error": "Username must be 3-32 characters"
}
```

### 401 — Invalid Credentials

```json theme={null}
{
  "error": "Invalid username or password"
}
```

### 403 — Missing Permission

```json theme={null}
{
  "error": "Missing required permission: MANAGE_WEBHOOKS"
}
```

### 404 — Resource Not Found

```json theme={null}
{
  "error": "Channel not found in this server"
}
```

### 409 — Conflict

```json theme={null}
{
  "error": "Username already taken"
}
```

### 429 — Rate Limited

```json theme={null}
{
  "error": "Too many requests. Please try again later."
}
```

Headers: `Retry-After: 45`

### 500 — Server Error

```json theme={null}
{
  "error": "Internal server error"
}
```

<Warning>
  **500 errors never expose internal details.** The actual error is logged
  server-side only. If you encounter persistent 500 errors, contact support with
  the endpoint and approximate timestamp.
</Warning>
