Devices
The devices bound to your account, their push tokens and the aggregated dispatch inbox.
There is no explicit registration call: a device is created the first time its x-codai-device UUID appears on a sessions request. These endpoints manage what exists and let a device pull everything queued for it in one call.
Agents list your devices through the MCP server tool devices_list (read-only; only has_push_token, never the raw push token).
bearerAuthAuthorizationBearer <codai_…>A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).
x-request-id?stringClient correlation id; echoed back as x-codai-trace-id and persisted on the usage row.
length <= 128The caller's devices ordered by lastSeenAt descending.
application/json- response
devices*array<>curl -X GET 'https://ai.codai.ro/v1/devices'{ "devices": [ { "id": "2b6d8c1e-4f3a-4e9b-9c0d-7a1e5f6b8c2d", "name": "Pixel 9 Pro", "platform": "android", "capabilities": [ "terminal", "fs", "voice" ], "has_push_token": true, "app_version": "desktop/0.7.0", "lastSeenAt": "2026-09-23T08:41:12.000Z", "createdAt": "2026-09-01T10:00:00.000Z", "online": true } ]}bearerAuthAuthorizationBearer <codai_…>A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).
id*stringDevice UUID (the value you send as x-codai-device).
uuidx-request-id?stringClient correlation id; echoed back as x-codai-trace-id and persisted on the usage row.
length <= 128application/json- body
At least one of the two fields is required.
push_token?|FCM registration token (opaque ASCII, trimmed). null clears it.
8 <= length <= 4096capabilities?array<>Replaces the whole capability list.
items <= 64The updated device.
application/json- response
id*stringuuidname*stringplatform*DevicePlatformClient platform; anything else sent in x-codai-device-platform is stored as agent.
"android""ios""web""desktop""cli""agent"capabilities*array<string>has_push_token*booleanlastSeenAt*stringdate-timecurl -X PATCH 'https://ai.codai.ro/v1/devices/497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "platform": "android", "capabilities": [ "string" ], "has_push_token": true, "lastSeenAt": "2019-08-24T14:15:22Z"}bearerAuthAuthorizationBearer <codai_…>A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).
id*stringDevice UUID.
uuidx-request-id?stringClient correlation id; echoed back as x-codai-trace-id and persisted on the usage row.
length <= 128Deleted.
application/json- response
deleted*truetrueid*stringuuidcurl -X DELETE 'https://ai.codai.ro/v1/devices/497f6eca-6276-4993-bfeb-53cbbbba6f08'{ "deleted": true, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"}bearerAuthAuthorizationBearer <codai_…>A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).
limit?integerMax controls returned in total. Default 200, max 500.
0 <= value <= 500200x-codai-device*stringStable device UUID. Registers the device on first use (name/platform from x-codai-device-name / x-codai-device-platform) and selects the shared-sessions protocol.
uuidx-codai-device-name?stringHuman-readable device name used when the device is first registered (truncated to 120 chars).
length <= 120x-codai-device-platform?stringPlatform recorded on first registration; unknown values become agent.
"android""ios""web""desktop""cli""agent"x-request-id?stringClient correlation id; echoed back as x-codai-trace-id and persisted on the usage row.
length <= 128Pending controls grouped by session (empty sessions when none).
application/json- response
device_id*stringThe calling device.
uuidsessions*array<>curl -X GET 'https://ai.codai.ro/v1/devices/me/dispatch' \ -H 'x-codai-device: 497f6eca-6276-4993-bfeb-53cbbbba6f08'{ "device_id": "3bafab7b-4400-4bcf-8e6e-09f954699940", "sessions": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "session_key": "string", "title": "string", "controls": [ { "id": "string", "kind": "send", "text": "string", "turn_id": "string", "ask_id": "string", "from_device_id": "10624cda-85b4-412c-80da-8ce165bfd5b0", "target_device_id": "12785743-1d27-41cd-88a7-0ac66360e3d6", "mode": "open", "seq": 0, "applied": true, "created_at": "2019-08-24T14:15:22Z" } ] } ]}Last updated: