Mint a short-lived relay attach token (driver/viewer for users; host for the provisioning daemon) for an interactive session.
USER mint (role driver/viewer or omitted): authentication accepts a browser session or a WorkOS user token only; an rsk API key or a BYOA OAuth-agent token is rejected 403 (no user identity to derive a role from). The minted role is a server-derived ceiling, never a client-claimed value. HOST mint (role "host"): accepts ONLY a worker-class machine identity - a plain org rsk_ API key or a worker runtime JWT - acting within the session's org; human identities, OAuth-agent tokens, and registration-bound keys are rejected 403. The host response carries the daemon wire contract { attachUrl, token, epoch, expiresAt } with a freshly allocated host stream epoch. HOST refresh (role "host-refresh", requires epoch): same caller gate as "host"; re-signs a token for the CURRENT host generation WITHOUT allocating a new epoch - the reconnect-after-expiry re-mint rail. A presented epoch that no longer matches the live generation is refused 409 (epoch_stale).
Rensei API key presented as Authorization: Bearer rsk_live_. Required API-key scopes are recorded per operation in x-rensei-required-scopes.
In: header
Path Parameters
The session id (agent_sessions.session_id).
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/interactive-sessions/string/tokens" \ -H "Content-Type: application/json" \ -d '{}'{
"token": "string",
"sseTicket": "string"
}Cooperatively stop an interactive session.
Authentication accepts a browser session or a WorkOS user token only; an rsk API key or a BYOA OAuth-agent token is rejected 403. Idempotent-ish: stopping an already-ended session still returns 200 (the underlying Redis/SQL writes are themselves idempotent). 404 - never 403 - for a session belonging to a different org or one the caller has no project access for (no-existence-leak). Teardown drives the cooperative Redis/lock-refresh rail and, belt-and-braces, emits a fire-and-forget relay kill (reason: stopped) when the relay control env is configured.
Register (or refresh) a push device token for the authenticated user.
Upserts a per-user APNs or web-push device token. The write is scoped to the authenticated user; a credential with no user identity is rejected. Re-registering a live token bumps last-seen and refreshes its mutable fields.