Devices API
List, retrieve, update, and delete devices via the REST API.
Written By Erdinc Akay
Last updated 8 days ago
The Devices API lists, retrieves, updates, and deletes devices. Note: all device endpoints use the path prefix /api/assets. The term "asset" is used internally in the backend; the UI and documentation refer to these as devices.
For the complete, always-current list of endpoints, parameters, and response fields for the version you are running, use the interactive OpenAPI (Swagger) interface at https://<your-octoja-instance>/openapi/index.html.
Endpoints
Note on the Get response: settings carries the per-device agent settings (each with its effective value, any per-device override, and which config packages enable it), and canBypassRemoteDesktopConsent reflects the caller's own permission rather than a device setting. See Swagger for the full field-by-field shape.
Note on permissions: updating and deleting a device use octoja's per-device action grants β the Edit Device and Delete Device grants your group holds for that specific device β not a single global permission. Group access controls which devices each grant applies to.
Updating a device
All update fields are optional β only send the fields you want to change. Each field is wrapped in an UpdateValue<T> envelope of the shape { "hasValue": true, "value": <T> }; omit a field entirely to leave it untouched. A bare value (for example "deviceAlias": "web-01") does not bind. Use { "hasValue": true, "value": null } to clear a value.
{ "deviceAlias": { "hasValue": true, "value": "web-01" }, "customerId": { "hasValue": true, "value": null }}The updatable fields are deviceAlias, customerId, customerSiteId, tags, and deviceKind (Swagger has their exact types). A few behaviours and validations are not visible in the schema:
- deviceAlias β trimmed, max 100 characters; a
nullvalue clears the alias. - customerId β a
nullvalue unassigns the customer. Reassigning the customer resets the storedcustomerSiteIdtonull; sendcustomerSiteIdin the same request if the device should keep its site assignment. - customerSiteId β requires an effective customer: either the incoming
customerIdor the device's currently-storedcustomerIdmust be non-null. - tags β replaces user-defined tags only; inventory-derived tags are always preserved and cannot be removed through the API. Max 50 tags, 100 characters each.
- deviceKind β overrides the classified device kind. It is one of a fixed set of values (see Swagger); an invalid value returns
400 Bad Request.
The update endpoint also accepts five per-device agent-setting overrides. Each is a nullable boolean where true forces the setting on, false forces it off, and null clears the override so the device inherits the value from its config packages:
- requiresRemoteDesktopConsent β require the signed-in user to consent before a remote-desktop session starts.
- showAgentInTray β show the agent icon in the system tray.
- softwareKioskEnabled β enable the self-service software kiosk.
- ticketingEnabled β enable ticket creation from the device.
- autoLockOnDisconnect β automatically lock the device when a remote-desktop session disconnects.
Deleting a device
Removes the device from octoja β it no longer appears in the device list and cannot be retrieved through the API. The associated agent record is also deleted and the agent's realtime connection is severed immediately. The agent software must be uninstalled separately on the device.
Device fields worth knowing
The full device object is documented field-by-field in Swagger. A few fields carry behaviour that is easy to miss:
checkStatusβ a summary of the device's checks ({ total, ok, warning, critical, details }, wheredetailsis an array of{ name, status }entries). Only populated on the list endpoint; alwaysnullonGET /api/assets/{id}.tagsβ an array of{ value, source }, wheresourceisInventory(auto-assigned by the agent from hardware and software, not editable via the API) orUser(set manually via the update endpoint or the UI).lywandScoreβ the latest Lywand security score, ornullwhen the device is not matched to the Lywand integration.allowedActionsβ an array of the device actions your group grants you on this specific device, as action names (for example["RemoteDesktop", "Terminal", "EditAsset"]). It is scoped to the calling user β two callers can see the same device with differentallowedActionsβ and is returned on both the list and the Get responses. An empty array means you can see the device but have no granted operations on it (view-only).EditAssetandDeleteAssetin this array are what gate the update and delete endpoints for that device.deviceKindβ the classified device kind, one of a fixed set of values (see Swagger).