> For the complete documentation index, see [llms.txt](https://cde-inc.gitbook.io/cde-cad-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cde-inc.gitbook.io/cde-cad-documentation/rest-api/fivem-integration.md). Agents can also search and read this documentation through its [MCP server](https://cde-inc.gitbook.io/cde-cad-documentation/~gitbook/mcp).

# FiveM Integration

These endpoints are designed for direct use from FiveM server scripts. Most use API key authentication via the `x-api-key` header.

***

{% hint style="info" %}
**POST →** `/api/fivem/register`
{% endhint %}

**Auth:** None (public endpoint)

Register a FiveM server with the CAD system. Called once during initial setup.

```
{
  "serverName": "My RP Server",
  "serverIp": "123.456.789.0",
  "communityId": "community_abc123"
}
```

{% hint style="info" %}
**POST →** `/api/fivem/heartbeat`
{% endhint %}

**Auth:** API Key

Send a heartbeat to indicate the FiveM server is online. Should be sent at regular intervals (roughly once a minute is typical).

```
{
  "playerCount": 42,
  "maxPlayers": 64
}
```

{% hint style="info" %}
**POST →** `/api/fivem/911`
{% endhint %}

**Auth:** API Key

Create a 911 dispatch call from in-game. This appears on the dispatch screen in real time.

```
{
  "callerName": "John Doe",
  "location": "Legion Square",
  "description": "There's a fight happening outside the bank",
  "callerNumber": "555-0123"
}
```

**Curl example:**

```
curl -X POST https://cdecad.com/api/fivem/911 \
  -H "x-api-key: fvm_abc123def456" \
  -H "Content-Type: application/json" \
  -d '{
    "callerName": "John Doe",
    "location": "Legion Square",
    "description": "Fight outside the bank"
  }'
```

{% hint style="info" %}
**POST →** `/api/fivem/panic`
{% endhint %}

**Auth:** API Key

Trigger a panic button alert. This creates an urgent notification on the dispatch screen.

```
{
  "unitCallsign": "1-A-12",
  "unitName": "Officer Smith",
  "location": "Grove Street"
}
```

{% hint style="warning" %}
**Rate Limit Notice**

The panic and 911 endpoints are rate limited to prevent abuse. Exceeding limits will return a `429` status code.
{% endhint %}

{% hint style="success" %}
**GET →** `/api/fivem/records`
{% endhint %}

**Auth:** API Key

List records (citations, arrests, warrants, etc.) for the community that owns the API key. Supports the same `type`, `civilianId`, `limit`, and `offset` query parameters and returns the same `{ records, total, limit, offset, hasMore }` shape as [`GET /api/records`](https://cde-inc.gitbook.io/cde-cad-documentation/rest-api/reports-judicial.md). Equivalent to calling `GET /api/records` with the `x-api-key` header. Use whichever path your integration prefers.

```
curl "https://cdecad.com/api/fivem/records?type=citation,arrest&limit=50&offset=0" \
  -H "x-api-key: fvm_your_api_key_here"
```

{% hint style="info" %}
**POST →** `/api/fivem/evidence`
{% endhint %}

**Auth:** API Key + `actingDiscordId`

Book an item into the evidence locker. It gets a tag and goes into the officer's custody, the same as booking it on the website. The officer needs department access in the community. See [Evidence](https://cde-inc.gitbook.io/cde-cad-documentation/fivem-developer-integration/evidence.md) for every field and error.

```
curl -X POST https://cdecad.com/api/fivem/evidence \
  -H "x-api-key: fvm_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "actingDiscordId": "123456789012345678",
    "description": "Cash, bundled",
    "category": "Currency",
    "quantity": "$4,200"
  }'
```
