Skip to main content

Auth

Authentication and session management

📄️List the caller's live CLI sessions

List the caller's live CLI sessions. One entry per `npx pt login` — that is, per refresh-token FAMILY, not per token: a session that has refreshed twenty times is still one row. Browser-session only: the proxy rejects a request that carries no cookies, so a bearer API key cannot enumerate a user's sessions. A non-JSON upstream body is replaced with a `DIRECTORY_INVALID_RESPONSE` envelope while the UPSTREAM STATUS IS PRESERVED, so a 2xx can carry that error shape instead of `data` — the 200 schema below models both.

📄️End one CLI session

End one CLI session. Always revokes the whole refresh family, so the session can no longer refresh. Also revokes the bridge access tokens LINKED to that family, and where at least one was revoked access stops within the ~30s principal-liveness cache window rather than at the end of that token's TTL. Returns what was actually revoked: `accessTokensRevoked` is legitimately 0 for a family whose backing key rows predate the `cli_family_id` link — nothing links them, so the token that machine already holds runs to its own expiry. Browser-session only. A non-JSON upstream body is replaced with a `DIRECTORY_INVALID_RESPONSE` envelope while the UPSTREAM STATUS IS PRESERVED, so a 2xx can carry that error shape instead of `data` — the 200 schema below models both.