Authentication
How to authenticate agents using RFC 8628 Device Authorization, bootstrap keys (zl_live_), short-lived access tokens (zla_), and refresh rotation (zlr_).
Zelitho uses an RFC 8628 Device Authorization Flow so AI agents and local scripts never hold permanent workspace credentials or user passwords.
Token Types & Lifetimes
| Credential | Prefix | Lifetime / Limits | Purpose |
|---|---|---|---|
| Bootstrap Key | zl_live_ | Max 5 active keys per workspace | Used only to initiate a new pairing (POST /api/v1/auth/pairings). |
| Access Token | zla_ | 15 minutes | Bearer token sent on all /api/v1/* data requests. |
| Refresh Token | zlr_ | 30 days inactivity / 90 days max | Rotated via POST /api/v1/auth/token (grant_type: refresh_token). |
Step 1: Initiate a Pairing
Call POST /api/v1/auth/pairings with your zl_live_ bootstrap key and Content-Type: application/json:
curl -X POST https://app.zelitho.com/api/v1/auth/pairings \
-H "Authorization: Bearer zl_live_YOUR_BOOTSTRAP_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_instance_id": "cursor-agent-01",
"connector_label": "Cursor Agent",
"requested_scopes": [
"aiv:read",
"articles:read",
"articles.content:read",
"org_credits:read"
]
}'The response includes pairing_id, device_code, verification_phrase, and approval_url (valid for 10 minutes).
Step 2: Approve in Dashboard & Poll
Open https://app.zelitho.com plus approval_url, confirm the verification_phrase, and click Approve. Meanwhile, poll GET /api/v1/auth/pairings/{pairing_id}?device_code=... every 5 seconds minimum until status === "approved".
Step 3: Exchange for Access Token
Once approved, exchange the pairing_id and device_code:
curl -X POST https://app.zelitho.com/api/v1/auth/token \
-H "Content-Type: application/json" \
-d '{
"grant_type": "pairing",
"pairing_id": "PAIRING_UUID",
"device_code": "DEVICE_CODE"
}'When zla_ expires after 15 minutes, rotate cleanly using "grant_type": "refresh_token" and your refresh_token.
Pending Slot Cap
Only 3 pending pairing connections (10 max active connections) are permitted per workspace at one time. If you receive 409 pairing_already_pending, approve or deny old pending pairings in your Zelitho dashboard settings.