Overview
The LonexCAD API provides endpoints for FiveM server integration, allowing your game server to interact with the CAD system for 911 calls, duty management, and officer authentication. Base URL:https://your-domain.com/api/v1/
Authentication
All API requests require an API key. Generate keys from Admin Settings → FiveM API in the CAD panel. Include the API key in your requests:Endpoints
GET /fivem/status
Check if the CAD system is online and get basic information. Response:POST /fivem/validate
Validate an API key and get server information. Request:POST /fivem/auth
Generate an authentication token for in-game CAD access. Request:| Parameter | Required | Description |
|---|---|---|
| api_key | Yes | Your FiveM API key |
| discord_id | Yes | Player’s Discord ID |
| player_name | No | Player’s in-game name |
| player_license | No | FiveM license identifier |
POST /fivem/911
Create 911 calls, get active calls, and manage call assignments.Action: create
Create a new 911 call from in-game. Request:| Parameter | Required | Description |
|---|---|---|
| action | Yes | Set to create |
| caller | No | Caller name (default: “Unknown Caller”) |
| location | No | Call location/address |
| description | No | Description of the emergency |
| priority | No | Priority level 1-3 (1 = highest) |
| postal | No | Postal code from Nearest Postal script |
| coords | No | Object with x, y, z coordinates |
| street_name | No | Street name from GetStreetNameFromCoords |
Action: get_active
Get all active 911 calls. Request:Action: get_officers
Get list of on-duty officers. Request:Action: assign
Assign an officer to a call. Request:Action: clear
Clear/complete a call. Request:POST /fivem/duty
Check and manage officer duty status.Action: check
Check if a player is authorized for LEO duty. Request:Action: go_on_duty
Put an officer on duty. Request:Action: go_off_duty
Take an officer off duty. Request:Action: update_status
Update officer status code. Request:Error Codes
| Code | Error | Description |
|---|---|---|
| 400 | Bad Request | Invalid JSON or missing required parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 405 | Method Not Allowed | Wrong HTTP method (use POST for most endpoints) |
| 500 | Server Error | Internal server error - check CAD logs |

