# Errors

Partner API errors use standard HTTP status codes and NestJS JSON bodies.

## Status codes

| Status | When |
| --- | --- |
| 400 | Validation failed or the agent is not allowed to perform the action |
| 401 | Missing or invalid `x-api-key` |
| 404 | Agent does not exist in the partner's network |
| 500 | Pause/sync of campaigns failed after disable |

## Examples

### 401 Unauthorized

```json
{
  "statusCode": 401,
  "message": "Invalid or missing API key"
}
```

### 404 Not Found

```json
{
  "statusCode": 404,
  "message": "Agent not found"
}
```

### 400 Bad Request

```json
{
  "statusCode": 400,
  "message": ["enabled must be a boolean"],
  "error": "Bad Request"
}
```
