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

# Error Handling

Endole API returns all responses as a JSON object containing a `status` field to indicate whether the request succeeded or failed. Every response also includes standard HTTP status codes.

## Success Responses

When a request succeeds, the API returns a `200 OK` status code with `"status": "success"` at the root of the JSON payload:

```json theme={null}
{
  "status": "success",
  "data": {}
}
```

## Error Responses

When a request fails, the API returns an appropriate HTTP error status code, and the JSON payload includes `"status": "error"`, an error `code` string, and a descriptive `message`:

```json theme={null}
{
  "status": "error",
  "code": "HTTPS_REQUIRED",
  "message": "This API requires a secure HTTPS connection."
}
```

## HTTP Status Codes

<table>
  <colgroup>
    <col width="100" />

    <col width="113" />

    <col width="491" />
  </colgroup>

  <thead>
    <tr>
      <th>Code</th>
      <th>Status</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>2xx</td>
      <td>Success</td>
      <td>The request was successful and processed properly.</td>
    </tr>

    <tr>
      <td>4xx</td>
      <td>Client Error</td>
      <td>The request contains invalid data, missing parameters, or authentication errors.</td>
    </tr>

    <tr>
      <td>5xx</td>
      <td>Server Error</td>
      <td>An unexpected error occurred on Endole's servers. If this issue persists, please [contact support.](https://www.endole.co.uk/help/contact-us/)</td>
    </tr>
  </tbody>
</table>
