Docs/Tenant machines
Organisations

Tenant machines

List, get and revoke a Tenant's machines under /v1/tenants/{tenantId}/machines.

A Tenant machine is one of your customer's own computers, running the Sai runtime and enrolled into a Tenant. Your backend lists and revokes them with an Organisation Key. A Tenant token sees the same machines in GET /v1/agents/machines.

The console shows them on the Tenant's page in the portal.

The machine object

A Tenant machineJSON
{
  "machineId": "tm_5a1f0c9e2b7d4e6a8c3f1b2d",
  "name": "Front desk PC",
  "platform": "darwin",
  "status": "active",
  "online": true,
  "lastSeen": 1790003600000,
  "runtimeVersion": "1.2.0"
}
FieldNotes
machineIdSai's id for the machine. Pass it in the paths below and as machineId to /v1/agents/message.
nameThe computer's name, as the runtime reported it when it enrolled.
platformThe operating system as the runtime reports it, for example darwin.
statusAlways active. A revoked machine leaves the list.
onlinetrue when the machine reported in the last 3 minutes.
lastSeenUnix time in milliseconds of its last report, or null.
runtimeVersionThe Sai runtime's version, or null.

List a Tenant's machines

List a Tenant's machinescURL
curl -s "$SAI_API_URL/v1/tenants/$TENANT_ID/machines" \
  -H "Authorization: Bearer $SAI_ORG_KEY"
200 OK · Tenant machinesJSON
{
  "machines": [
    {
      "machineId": "tm_5a1f0c9e2b7d4e6a8c3f1b2d",
      "name": "Front desk PC",
      "platform": "darwin",
      "status": "active",
      "online": true,
      "lastSeen": 1790003600000,
      "runtimeVersion": "1.2.0"
    }
  ]
}
StatuserrorWhen
404not_foundNo such Tenant.

Get a machine

Get a Tenant machinecURL
curl -s "$SAI_API_URL/v1/tenants/$TENANT_ID/machines/$MACHINE_ID" \
  -H "Authorization: Bearer $SAI_ORG_KEY"

200 with the machine.

StatuserrorWhen
404not_foundNo such Tenant, or no such machine in the Tenant.

Revoke a machine

Revoke a Tenant machinecURL
curl -s -X DELETE "$SAI_API_URL/v1/tenants/$TENANT_ID/machines/$MACHINE_ID" \
  -H "Authorization: Bearer $SAI_ORG_KEY"

204 No Content. The machine is signed out at once, leaves the list and cannot reconnect. To bring it back, enroll it again with a new code.

StatuserrorWhen
404not_foundNo such Tenant, or no such machine in the Tenant.

To stop every machine of a Tenant at once, disable the Tenant: they stay enrolled and reconnect when it is enabled again. Deleting the Tenant revokes them all.