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

# Requests

The TurboFiles API follows the JSON:API specification and requires HTTPS for all requests.

## Requirements

All requests must be sent to `https://api.turbofiles.io` using HTTPS. Any HTTP requests will be rejected.
Authenticated endpoints require valid API credentials, and all requests must include these JSON:API headers:

```http theme={null}
Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
```

## Authentication

TurboFiles uses API keys for request authentication. You can manage your keys through the TurboFiles dashboard.

<Warning>Keep your API keys secure - never expose them in public repositories or client-side code.</Warning>

Here's an example authenticated request:

```bash {4} theme={null}
curl "https://api.turbofiles.io/v1/users/me" \
  -H 'Accept: application/vnd.api+json'  \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Authorization: Bearer {api_key}'
```

## Pagination

TurboFiles uses cursor-based pagination for all list endpoints. Each paginated response includes a `links` object containing URL-encoded navigation paths:

```json theme={null}
{
  "links": {
    "next": "https://api.turbofiles.io/v1/files?page%5Bafter%5D=2024-11-22T16%3A20%3A28.048315893Z",
    "prev": "https://api.turbofiles.io/v1/files?page%5Bbefore%5D=2024-11-22T16%3A19%3A28.048315893Z"
  }
}
```

Navigate through results using the `links.next` URL.

Each response also includes pagination metadata:

```json theme={null}
{
  "meta": {
    "rangeTruncated": true
  }
}
```

You can customize pagination using two parameters:

* `page[size]`: Number of results per page (default: 10, range: 1-100)
* `page[after]`: Cursor for fetching results after this point
* `page[before]`: Cursor for fetching results before this point
