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

Set Penal Codes

Replace the community penal code configuration.

PUT https://api.sonorancad.com/v2/general/penal-codes

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

Replace the community penal code configuration.

Request Body

{
  "codes": []
}

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:setPenalCodesV2({
    // See the request body above for the full penal code shape.
    { code = '22107', title = 'Unsafe Lane Change', definition = 'Unsafe lane change' },
  })

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

Response

Successful requests return application/json.

Last updated

Was this helpful?