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

# Errors

> KonbiniAPI error codes and response format. Machine-readable error codes with human-readable messages for every failure scenario.

When a request fails, the response body contains an `errors` array with machine-readable codes and human-readable messages.

## Error response format

```json theme={null}
{
  "errors": [
    {
      "code": "not_found",
      "message": "User not found"
    }
  ],
  "data": null
}
```

## Error codes

### Authentication errors

| Code               | Status | Description                                 |
| ------------------ | ------ | ------------------------------------------- |
| `missing_api_key`  | 401    | Missing or malformed `Authorization` header |
| `invalid_api_key`  | 401    | API key does not exist                      |
| `api_key_disabled` | 403    | API key has been disabled                   |
| `api_key_expired`  | 403    | API key has expired                         |

### Billing errors

| Code                | Status | Description          |
| ------------------- | ------ | -------------------- |
| `credits_exhausted` | 402    | No credits remaining |

### Request errors

| Code               | Status | Description             |
| ------------------ | ------ | ----------------------- |
| `validation_error` | 400    | Invalid parameters      |
| `not_found`        | 404    | Resource not found      |
| `route_not_found`  | 404    | Endpoint does not exist |

### Server errors

| Code                  | Status | Description                 |
| --------------------- | ------ | --------------------------- |
| `platform_error`      | 502    | Upstream platform error     |
| `service_unavailable` | 503    | API temporarily unavailable |
| `internal_error`      | 500    | Unexpected server error     |

<Note>
  Requests that fail with `400`, `5xx`, or `502` are not charged credits.
</Note>
