Rensei docs
API ReferenceSessions ( Public)

Stop a running session

Sends a stop signal to the session: flips Redis status to `stopped`, releases queue/claim/lock, and emits a "Stop signal received" activity to the tracker. A session live on an ADOPTED session-shim lineage (its host daemon restarted and re-owned the harness) cannot be terminalized by the caller: the common release predicate holds its claim until that lineage's own terminal proof arrives. For that case the stop is DELIVERED (relay kill toward the active carrier plus the cooperative Redis rail) and the route answers 202 with `stopped:false, delivered:true, pending:"terminal_evidence"`; the session goes terminal when the daemon posts the group-reaped tombstone. 409 is reserved for a hold nothing can be delivered through (a quarantined or still-preparing lineage, or a restart hold window): retry.

POST
/api/public/sessions/{id}/stop

Authorization

headerAuthorizationBearer <rsk_live_*>

Rensei API key presented as Authorization: Bearer rsk_live_. Required API-key scopes are recorded per operation in x-rensei-required-scopes.

Path Parameters

id*string

Session id in ANY namespace: the canonical session id, the 16-char public session hash, or the tracker AgentSession id. All three resolve to the same row inside the caller's organization.

Response Body

Session stopped.

application/json
  1. response
stopped*boolean
sessionId*string
previousStatus*AgentSessionStatus

FSM states for an agent session:

  • pending - queued, waiting for a worker
  • claimed - worker has claimed but not yet started
  • running - agent actively processing
  • finalizing - cleanup in progress
  • completed - finished successfully (terminal)
  • failed - encountered an error (terminal)
  • stopped - stopped by user (terminal)
Value in"pending""claimed""running""finalizing""completed""failed""stopped"
newStatus*string
Example Request
curl -X POST 'https://app.rensei.ai/api/public/sessions/string/stop'
Example Response
{  "stopped": true,  "sessionId": "string",  "previousStatus": "pending",  "newStatus": "string"}