Rensei docs
API ReferenceInteractive sessions

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.

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

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

Response Body

application/json

curl -X POST "https://example.com/api/interactive-sessions/string/stop"
{
  "stopped": true,
  "endedAt": "string"
}
Empty
Empty
Empty
Empty