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

# API Schemas

> This guide documents the Machina API patterns for interaction using custom integrations.

## Headers

The Machina Sports API requires two HTTP headers:

* A `Content-Type` header specifying the request payload format
* A `X-Api-Token` header containing the authentication token for request authorization

```shell theme={null}
curl --request POST \
  --url https://{api-address}.org.machina.gg/agent \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: <api-key>' \
  --data '{}'
```

## Sort, Filter and Paginate

The Machina Sports API works with sorting, filtering and paging for some larger requests. These mechanisms are defined in request body:

* The `filters` object defines filtering mechanism criteria
* The `sorters` array defines a sorting mechanism
  * First a property to defines sorting criteria
  * Second, 1 for ascending, -1 for descending
* The `page` and `page_size` properties defines specific page and the limit of items

```json theme={null}
{
  "filters": {
    "name": "Conversational Agent"
  },
  "sorters": [
    "_id",
    1
  ],
  "page": 1,
  "page_size": 10
}
```

## Next up

Create API key to build an customized integration with Machina.
