Rensei docs
API ReferenceInteractive sessions

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).

POST
/api/interactive-sessions/{id}/tokens

Authorization

AuthorizationBearer <token>

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

id*string

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"
}
Empty
Empty
Empty
Empty
Empty
Empty
Empty