Resume Agent Run Stream
Reconnect to run events
This endpoint replays and tails SSE events; it does not rerun the agent or continue a paused run. Preserve each received event_index and submit the last one as the last_event_index form field:
curl --fail-with-body -N \
"http://127.0.0.1:7777/agents/reference-agent/runs/$RUN_ID/resume" \
-H "Authorization: Bearer $OS_SECURITY_KEY" \
-F "session_id=$SESSION_ID" -F "last_event_index=$LAST_EVENT_INDEX"Use IDs from the example server's run response. Scoped callers must supply the original session ID, including non-admin service-account PAT callers. Remote and factory agents cannot resume through this endpoint.
The available history depends on the event storage configuration. A database fallback can replay only persisted events; a stored run with no events yields replay metadata with total_events=0. An unavailable run or buffer discovered after streaming headers can produce an SSE error frame instead of an HTTP 404. Read the stream's events as well as its HTTP status.
/agents/{agent_id}/runs/{run_id}/resumeResume an SSE stream for an agent run after disconnection.
Sends missed events since last_event_index, then continues streaming live events if the run is still active.
Three reconnection paths:
- Run still active: Sends catch-up events + continues live streaming
- Run completed (in buffer): Replays missed buffered events
- Run completed (in database): Replays events from database
Client usage:
Track event_index from each SSE event. On reconnection, pass the last received event_index as last_event_index.
Authorization
HTTPBearer In: header
Path Parameters
Request Body
application/x-www-form-urlencoded
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl --request POST 'https://example.com/agents/string/runs/string/resume'null{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}