Skip to main content
POST
/
threads
/
{thread_id}
/
runs
/
wait
Wait For Run
curl --request POST \
  --url https://api.example.com/threads/{thread_id}/runs/wait \
  --header 'Content-Type: application/json' \
  --data '
{
  "assistant_id": "<string>",
  "input": {},
  "config": {},
  "context": {},
  "checkpoint": {},
  "stream": false,
  "stream_mode": "<string>",
  "on_disconnect": "<string>",
  "on_completion": "delete",
  "multitask_strategy": "<string>",
  "command": {},
  "interrupt_before": "<string>",
  "interrupt_after": "<string>",
  "stream_subgraphs": false,
  "metadata": {}
}
'
{}

Path Parameters

thread_id
string
required

Body

application/json

Request model for creating runs

assistant_id
string
required

Assistant to execute

input
Input · object

Input data for the run. Optional when resuming from a checkpoint.

config
Config · object

Execution config

context
Context · object

Execution context

checkpoint
Checkpoint · object

Checkpoint configuration (e.g., {'checkpoint_id': '...', 'checkpoint_ns': ''})

stream
boolean
default:false

Enable streaming response

stream_mode

Requested stream mode(s)

on_disconnect
string | null

Behavior on client disconnect: 'cancel' (default) or 'continue'.

on_completion
enum<string> | null

Behavior after stateless run completes: 'delete' (default) removes the ephemeral thread, 'keep' preserves it.

Available options:
delete,
keep
multitask_strategy
string | null

Strategy for handling concurrent runs on same thread: 'reject', 'interrupt', 'rollback', or 'enqueue'.

command
Command · object

Command for resuming interrupted runs with state updates or navigation

interrupt_before

Nodes to interrupt immediately before they get executed. Use '*' for all nodes.

interrupt_after

Nodes to interrupt immediately after they get executed. Use '*' for all nodes.

stream_subgraphs
boolean | null
default:false

Whether to include subgraph events in streaming. When True, includes events from all subgraphs. When False (default when None), excludes subgraph events. Defaults to False for backwards compatibility.

metadata
Metadata · object

Request metadata (e.g., from_studio flag)

Response

Successful Response

The response is of type Response Wait For Run Threads Thread Id Runs Wait Post · object.