> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://esendex.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://esendex.ferndocs.com/_mcp/server.

# Errors

Every response uses the same envelope: a `data` object on success and an `errors` array when something goes wrong.

```json
{
  "data": null,
  "errors": [
    {
      "errorCode": "ValidationError",
      "errorMessage": "The recipients field is required.",
      "metadata": { "field": "recipients" }
    }
  ]
}
```

| Field          | Description                                                               |
| -------------- | ------------------------------------------------------------------------- |
| `errorCode`    | A machine-readable code. Branch on this in your code.                     |
| `errorMessage` | A human-readable description of the problem.                              |
| `metadata`     | Optional key/value pairs with extra context, such as the offending field. |

## HTTP status codes

| Status                   | Meaning                                                                                |
| ------------------------ | -------------------------------------------------------------------------------------- |
| `200 OK` / `201 Created` | The request succeeded.                                                                 |
| `202 Accepted`           | The request was accepted for asynchronous processing (for example, sending a message). |
| `400 Bad Request`        | The request was invalid. Check `errors` for details.                                   |
| `401 Unauthorized`       | The `X-API-Key` header is missing or invalid.                                          |
| `404 Not Found`          | The resource doesn't exist or isn't visible to your account.                           |