Desktop API — contract v1.0.0
Base URL: · openapi.yaml · discovery document
Routes
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/desktop/auth/login | Authenticate, create device-bound session (no seat) |
| POST | /v1/desktop/auth/refresh | Rotate access + refresh tokens atomically |
| POST | /v1/desktop/auth/logout | Revoke current session only |
| POST | /v1/desktop/devices/activate | Allocate seat to session device (idempotent) |
| GET | /v1/desktop/entitlement | Authoritative access decision (read-only) |
| GET | /v1/desktop/devices | Owner-filtered device list, cursor paginated |
| DELETE | /v1/desktop/devices/current | Detach 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": { ... } }