Skip to main content
POST
Interrupt a session and send a replacement instruction

Authorizations

Authorization
string
header
required

A Recursion API key, created in the console under API keys.

Headers

x-tenant-id
string

Optional tenant consistency check. When present, it must name the tenant bound to the API key, including when x-organization-id is default.

Minimum string length: 1
x-organization-id
string

Organization in which to act. Required for a tenant-scoped API key. Optional for an organization-scoped key, where it must name that same organization. The value may be an organization id or default.

Minimum string length: 1

Path Parameters

sessionId
string<uuid>
required

Session id (UUID) as returned by managedAgentsStartSession or managedAgentsListSessions.

Body

application/json

Request body for interrupting the active operation and starting a fresh turn with one replacement instruction.

content
object[] | null

Provider-shaped replacement instruction blocks, passed through verbatim, except that a top-level image or document block may name a file from the organization's catalog with source {type: file, file_id}, resolved exactly as on managedAgentsSendSessionEvents; a refusal names the block as content[j]. Takes precedence over message.

message
string

Replacement instruction for the fresh turn. Ignored when content is present; otherwise required, and refused with 400 when empty or only whitespace.

referenced_session_ids
string[]

Prior sessions this session may read from the fresh turn on, by session id, added to any it already has. Authorized and recorded before the interrupt is signaled, so redirecting the agent at an earlier run is one request rather than two.

Maximum array length: 10

Response

Shared response body of POST /managed-agents/v1/sessions/{sessionId}/events and POST /managed-agents/v1/sessions/{sessionId}/interrupt-and-send. It acknowledges durable acceptance of the turn, never the agent's reply: read the reply by listing events or streaming. Compare events_accepted against what was sent to detect silently dropped entries, and read delivery_state to learn whether an agent is actually going to act on them. events_accepted counts canonical events rather than requests, so interrupt-and-send reports 2 for its single instruction: the stop and the message that follows it.

Shared response body of POST /managed-agents/v1/sessions/{sessionId}/events and POST /managed-agents/v1/sessions/{sessionId}/interrupt-and-send. It acknowledges durable acceptance of the turn, never the agent's reply: read the reply by listing events or streaming. Compare events_accepted against what was sent to detect silently dropped entries, and read delivery_state to learn whether an agent is actually going to act on them. events_accepted counts canonical events rather than requests, so interrupt-and-send reports 2 for its single instruction: the stop and the message that follows it.

delivery_state
enum<string>
required

How the accepted events reached a reader. queued: the agent was mid-turn, so the input is waiting outside the transcript and the next turn boundary will read it; interrupt to bring that forward. signaled: the running session was woken and will act on them. resumed: the session had already finished, so it resumed to act on them. stored: appended to the timeline with nothing running to act on them yet.

Available options:
stored,
signaled,
resumed,
queued
events_accepted
integer
required

How many canonical events were written or queued. This counts the inputs actually derived from the body, not its length: a plain message body yields 1, and a typed user.message with no content is dropped, so this can be lower than the events array sent.

Required range: -9007199254740991 <= x <= 9007199254740991
ok
boolean
required

Always true. Every event in the request was durably accepted; any partial or total failure is an HTTP error instead, so this field never reports false.