Desktop API — contract v1.0.0

Base URL: · openapi.yaml · discovery document

Routes

MethodPathPurpose
POST/v1/desktop/auth/loginAuthenticate, create device-bound session (no seat)
POST/v1/desktop/auth/refreshRotate access + refresh tokens atomically
POST/v1/desktop/auth/logoutRevoke current session only
POST/v1/desktop/devices/activateAllocate seat to session device (idempotent)
GET/v1/desktop/entitlementAuthoritative access decision (read-only)
GET/v1/desktop/devicesOwner-filtered device list, cursor paginated
DELETE/v1/desktop/devices/currentDetach current device, revoke all its sessions

Invariants

app_access = eligible AND device.status == "active" · updates_allowed = eligible AND support_until > server_time

Access token lifetime 900 s; absolute session lifetime 30 days (refresh refused in the final 900 s). offline_grace_seconds = 0. Re-check at most every check_after_seconds (≤ 900).

Errors: {"error":{"code","message","request_id"}} — translate on code, never on message. 401 auth · 403 account/eligibility/device · 409 device limit · 429 with Retry-After · 503 unavailable.

All responses are Cache-Control: no-store. Bodies are capped at 4 KiB and unexpected properties are rejected with INVALID_REQUEST.

Example — login with email

curl -X POST "$API/v1/desktop/auth/login" -H "Content-Type: application/json" -d '{
  "email": "customer@example.com",
  "password": "<USER_PASSWORD>",
  "device": { "device_id": "<64 hex sha256>", "name": "Customer Mac", "platform": "darwin", "app_version": "1.0.3" }
}'

Example — login with personal token

{ "auth_token": "snp_<64 base64url>", "device": { ... } }