Tenants
Create, list, update, disable and delete Tenants under /v1/tenants with an Organisation Key.
A Tenant is one of your customers. It has its own machines, files and sessions, kept apart from every other Tenant's. Your backend manages Tenants with an Organisation Key. The Organisation comes from the key, never from the request. Any other credential gets 403:
{ "error": "organisation_key_required", "message": "Tenant routes take an Organisation Key." }A Tenant token gets 403 not_available_for_tenant instead. A Tenant of another Organisation is 404 not_found. The console's Tenants page in the portal does the same things for a signed-in owner or admin.
The Tenant object
{
"tenantId": "Xk2p9QzR4tLm8vNa3bCd",
"name": "Riverside Clinic",
"externalId": "clinic-4821",
"metadata": { "plan": "pro" },
"status": "active",
"createdAt": 1790000000000,
"disabledAt": null,
"machineCount": 2
}Create a Tenant
curl -s "$SAI_API_URL/v1/tenants" \
-H "Authorization: Bearer $SAI_ORG_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Riverside Clinic",
"externalId": "clinic-4821",
"metadata": { "plan": "pro" }
}'{
"tenantId": "Xk2p9QzR4tLm8vNa3bCd",
"name": "Riverside Clinic",
"externalId": "clinic-4821",
"metadata": { "plan": "pro" },
"status": "active",
"createdAt": 1790000000000,
"disabledAt": null,
"machineCount": 0
}List Tenants
curl -s "$SAI_API_URL/v1/tenants?status=active&limit=50" \
-H "Authorization: Bearer $SAI_ORG_KEY"{
"tenants": [{ "tenantId": "Xk2p9QzR4tLm8vNa3bCd", "name": "Riverside Clinic", "...": "..." }],
"nextCursor": null
}Newest first. nextCursor is null on the last page. With externalId, the list has zero or one Tenant, so you can map your own customer to a Tenant without storing tenantId:
curl -s "$SAI_API_URL/v1/tenants?externalId=clinic-4821" \
-H "Authorization: Bearer $SAI_ORG_KEY"Get a Tenant
curl -s "$SAI_API_URL/v1/tenants/$TENANT_ID" \
-H "Authorization: Bearer $SAI_ORG_KEY"200 with the Tenant, or 404 not_found.
Update a Tenant
curl -s -X PATCH "$SAI_API_URL/v1/tenants/$TENANT_ID" \
-H "Authorization: Bearer $SAI_ORG_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Riverside Clinic East",
"metadata": { "plan": "enterprise" }
}'Send at least one field. 200 with the updated Tenant.
Disable a Tenant
curl -s -X PATCH "$SAI_API_URL/v1/tenants/$TENANT_ID" \
-H "Authorization: Bearer $SAI_ORG_KEY" \
-H "Content-Type: application/json" \
-d '{ "status": "disabled" }'200 with the Tenant, status now disabled. A disabled Tenant cannot run anything:
- Its Tenant tokens are refused, and the exchange returns
403 tenant_disabled. - Its machines stay enrolled but cannot connect.
- No enrollment code can be created for it.
{ "status": "active" } brings it back with its machines and data.
Delete a Tenant
curl -s -X DELETE "$SAI_API_URL/v1/tenants/$TENANT_ID" \
-H "Authorization: Bearer $SAI_ORG_KEY"204 No Content. The Tenant is disabled and every machine is revoked. The machines must be enrolled again if the Tenant is enabled later.
To erase a Tenant's data, delete it from the console's Tenants page. Erasure removes the Tenant's machines, sessions, files, memory and search history, and frees its externalId. It cannot be undone. The Tenant must be disabled for an hour first.