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.
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).
Response Body
application/json
curl -X POST "https://example.com/api/interactive-sessions/string/stop"{
"stopped": true,
"endedAt": "string"
}Get one interactive session's detail.
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 driver/viewer capability from). Returns 404 - never 403 - for a session belonging to a different org or one the caller has no project access/grant for, so existence is never leaked across the boundary.
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).