# Manage identity pairing and revocation

Source: https://usecns.dev/cortex-topic-manage-identity-pairing-and-revocation/

[Start here](https://usecns.dev/manual-cortex/)
[CLI commands](https://usecns.dev/commands-cortex/)
[Configuration & integration](https://usecns.dev/cortex-topics/)

Inspect GET `/api/v1/identity/state` or System → Identity & Access before admitting a sender or pairing a device. Canonical principals can bind multiple channel/device surfaces. Unknown external senders enter a perimeter hold. An owner can admit a collaborator or link the surface to an existing person; approval can route the held message immediately. Read its content and target, not only a display name.

| Role | Boundary |
| --- | --- |
| `owner` | Full system/identity administration, pairing and terminal access. |
| `collaborator` | Shared durable conversation mutation/steering with attribution; not owner administration. Identity-aware supervisory terminal controls are restricted. |
| `viewer` | Durable conversation reads/subscriptions; conversation mutation and escalation/pairing initiation are forbidden (403). This is not a blanket deny rule on all management routes. |

Use dedicated surface tokens for revocable device enrollment rather than distributing an owner/bootstrap API token. Consider HTTP and WebSocket authorization together. Keep unauthenticated listeners confined to a trusted environment; channel signatures do not secure every HTTP route.

1. As an authenticated owner, POST `/api/v1/identity/pair/initiate`, or select System → Identity & Access → Pair device. Choose principal/surface and a reachable host URL. The response includes a `CX-XXXXXX` challenge and `cortex://pair?...` URI. Default lifetime is 60 seconds; optional `ttlMs` is clamped to 5–600 seconds.
2. From the unpaired client, POST `/api/v1/identity/pair/exchange` with `code`, optional `deviceName`, and surface (`ios`, `macos`, `web`). Successful exchange returns protocol/daemon information and a dedicated surface token. Codes are one-time; invalid, expired or reused codes return 400. Protect both code and token and use an appropriately protected connection. Protocol surface names do not mean native clients are shipped.
3. To revoke access, DELETE `/api/v1/identity/surfaces/{id}`. Active `/ws` and `/ws/voice` connections for that surface close with 4001; subsequent authenticated requests fail with 401. Re-pair with owner authorization rather than retrying the old token.