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

Set Selected Character

Set the selected character for a community user or account.

PUT https://api.sonorancad.com/v2/civilian/selected-character

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

Set the selected character or selected sync character for an account.

Request Body

Use communityUserId by default, or provide exactly one of roblox, discord, or accountUuid.

{
  "communityUserId": "player-1234",
  "characterId": "1042"
}

characterId may be a numeric Sonoran character ID or a sync character string ID.

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:setSelectedCharacterV2({
    characterId = '42',
    communityUserId = 'player-1234',
  })

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

Response

Successful requests return application/json.

Last updated

Was this helpful?