For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get Active Units

Retrieve active emergency units for a configured server.

GET https://api.sonorancad.com/v2/emergency/servers/{serverId}/units

Rate limit: 3 requests per minute Authenticated v2 endpoints are rate limited per API key rather than per IP address.

Retrieve active units for the specified CAD server.

Path Parameters

Name
Type
Description

serverId

integer

Configured Sonoran CAD server ID.

Query Parameters

Name
Type
Default
Description

includeOffline

boolean

false

Include offline identifiers in the response.

onlyUnits

boolean

true

When true, hides active dispatchers.

limit

integer

100

Maximum number of rows returned.

offset

integer

0

Number of rows to skip.

Example Request

-- luarocks install sonoran.lua
-- For SonoranCADFiveM in-game usage, see the SonoranCADFiveM tab for the export-based client.
local Sonoran = require("sonoran")

local sonoran = Sonoran.createClient({
  product = Sonoran.productEnums.CAD,
  communityId = "YOUR_COMMUNITY_ID",
  apiKey = "YOUR_API_KEY",
  defaultServerId = 1
})

local response = sonoran.cad:getUnitsV2({
    serverId = 1,
    includeOffline = false,
    onlyUnits = true,
    limit = 100,
    offset = 0,
  })

-- Inspect response.success, response.data, or response.reason as needed.
print(response.success)

Response

Successful requests return application/json.

Enumeration Values

UNIT_STATUS

Value
Description

0

UNAVAILABLE

1

BUSY

2

AVAILABLE

3

ENROUTE

4

ON_SCENE

100

OFFLINE

UNIT_PAGE

Value
Description

0

POLICE

1

FIRE

2

EMS

3

DISPATCH

-1

UNKNOWN

Last updated

Was this helpful?