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

Set Integration Panel State

Replace one panel instance's live state and update connected CAD clients.

PUT https://api.sonorancad.com/v2/integration-panels/servers/{serverId}/panels/{panelKey}/instances/{instanceKey}/state

Rate limit: 300 requests per minute per API key.

Replace the complete state object for one panel instance. The update is immediately pushed to connected CAD clients on the selected server.

The panel must already exist. A panel may store up to 100 instances per server.

Path Parameters

Name
Type
Description

serverId

integer

Configured CAD server ID allowed by the API key.

panelKey

string

Stable panel key.

instanceKey

string

Stable instance key, commonly default.

Request Body

Property
Type
Required
Description

state

object

Yes

Complete replacement state; maximum 512 KiB.

Example Request

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

local state = {
  summary = { active = 1, normal = 2 },
  alarms = {
    { id = "mrpd-lobby", name = "MRPD Lobby", active = true }
  }
}

local response = sonoran.cad:setIntegrationPanelStateV2(
  "example.fire-alarms",
  "default",
  state,
  1
)
print(response.success)

Use this tab from the server side of a FiveM resource. Never expose the API key to client scripts.

Sonoran.lua and Sonoran.js use the configured client exported by sonorancad. Sonoran.Net must read the CAD convars and create a client. Grant the resource access to the protected key with add_convar_permission your-resource-name read sonoran_apiKey.

Sonoran.lua

Sonoran.js

Sonoran.Net

Import this YAML into Postman with Import -> Raw text.

Response

Last updated

Was this helpful?