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

# API reference

> Use service keys to automate FiveMesh CDN, Cache and Voice operations.

The FiveMesh API is for scripts, deployment tools and server automation that need to operate FiveMesh services without a dashboard session.

Use the API for workspace-scoped tasks such as preparing CDN uploads, managing public asset paths and operating server-aware services for registered FiveM servers.

Current public endpoints cover FiveMesh CDN object management and scoped upload URLs. FiveMesh Cache and Voice endpoints will be documented when their public API surfaces are available.

## API areas

| Area                                            | Use it for                                                                         |
| ----------------------------------------------- | ---------------------------------------------------------------------------------- |
| [Authentication](/api-reference/authentication) | Passing service keys, handling scopes and keeping secrets server-side.             |
| [FiveMesh CDN](/api-reference/cdn)              | Listing, uploading and deleting CDN objects, plus scoped upload URLs.              |
| [FiveMesh Cache](/api-reference/cache)          | Planned resource cache setup, cache operations, origin settings and observability. |
| [FiveMesh Voice](/api-reference/voice)          | Planned managed Voice instance state, region and lifecycle operations.             |

## Before you call the API

Create a service key from [API keys](/account/api-keys), then choose the smallest permission set that supports your script.

If the script only uploads media for one integration, restrict the key to a path prefix such as `/phone` or `/tablet`.

<Warning>
  Do not put service keys in client-side Lua, browser code or NUI bundles. Keep API calls that use service keys on the server side.
</Warning>

## Request pattern

FiveMesh service APIs use bearer authentication.

```bash theme={null}
curl "$FIVEMESH_API_URL/v1/..." \
  -H "Authorization: Bearer $FIVEMESH_API_KEY" \
  -H "Content-Type: application/json"
```

Set `FIVEMESH_API_URL` to the API base URL provided for your workspace or integration environment.

The production API base URL is:

```text theme={null}
https://api.fivemesh.io
```
