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

# ErynoaGroup REST API reference

> Complete reference for the ErynoaGroup REST API. Learn about base URLs, versioning, request formats, response structure, and global headers.

The ErynoaGroup API is a RESTful API that accepts JSON request bodies and returns JSON responses. All API endpoints are served over HTTPS. This reference covers the conventions, request format, and global headers used across all endpoints.

## Base URLs

| Environment | Base URL                              |
| ----------- | ------------------------------------- |
| Production  | `https://api.erynoa.group/v1`         |
| Sandbox     | `https://sandbox.api.erynoa.group/v1` |

Always use HTTPS. HTTP requests are redirected to HTTPS automatically.

## Authentication

All requests require a valid API key passed as a Bearer token in the `Authorization` header:

```
Authorization: Bearer YOUR_API_KEY
```

See [Authentication](/api-reference/authentication) for details on generating keys and handling authentication errors.

## Request format

* Set `Content-Type: application/json` for all `POST`, `PUT`, and `PATCH` requests
* Request bodies must be valid JSON
* String values are UTF-8 encoded
* Dates are ISO 8601 format (`2024-01-15T10:30:00Z`)

## Response format

All responses use a consistent JSON envelope:

**Successful single resource:**

```json theme={null}
{
  "data": {
    "id": "res_01HX4K9Z2QBZJMFR5T6VWYP8D",
    "type": "resource",
    "status": "active",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  }
}
```

**Successful list response:**

```json theme={null}
{
  "data": [...],
  "meta": {
    "total": 150,
    "page": 1,
    "per_page": 20
  },
  "links": {
    "next": "https://api.erynoa.group/v1/resources?cursor=eyJpZCI6MTB9",
    "prev": null
  }
}
```

**Error response:**

```json theme={null}
{
  "error": {
    "code": "validation_error",
    "message": "The 'name' field is required.",
    "status": 422,
    "details": [
      {
        "field": "name",
        "message": "This field is required."
      }
    ]
  }
}
```

## Global request headers

| Header            | Required             | Description                              |
| ----------------- | -------------------- | ---------------------------------------- |
| `Authorization`   | Yes                  | `Bearer YOUR_API_KEY`                    |
| `Content-Type`    | Yes (POST/PUT/PATCH) | Always `application/json`                |
| `Idempotency-Key` | No                   | Unique key to safely retry POST requests |
| `Accept`          | No                   | Default `application/json`               |

## Global response headers

| Header                  | Description                                                         |
| ----------------------- | ------------------------------------------------------------------- |
| `X-Request-ID`          | Unique identifier for the request. Include when contacting support. |
| `X-RateLimit-Limit`     | Maximum requests per minute for your key                            |
| `X-RateLimit-Remaining` | Requests remaining in the current window                            |
| `X-RateLimit-Reset`     | Unix timestamp when the rate limit window resets                    |

## HTTP status codes

| Status                      | Meaning                                        |
| --------------------------- | ---------------------------------------------- |
| `200 OK`                    | Request succeeded                              |
| `201 Created`               | Resource was created successfully              |
| `204 No Content`            | Request succeeded (no body, used for DELETE)   |
| `400 Bad Request`           | Request is malformed or has invalid parameters |
| `401 Unauthorized`          | API key is missing or invalid                  |
| `403 Forbidden`             | API key lacks permission for this operation    |
| `404 Not Found`             | Resource does not exist                        |
| `409 Conflict`              | Request conflicts with existing state          |
| `422 Unprocessable Entity`  | Validation error on request body               |
| `429 Too Many Requests`     | Rate limit exceeded                            |
| `500 Internal Server Error` | Unexpected server error                        |
