Before you start
You needcurl, jq, an API credential, and a runnable project agent. This example uses triage-agent in support-assistant.
Create the agent and deploy its project to an available environment first. Set ENVIRONMENT_ID to that environment’s UUID. Replace the project reference in the examples if you use another project.
1. Store the question
CallPOST /conversations with an initial user message:
create-conversation.sh
2. Start the run
Set the environment ID, then callPOST /runs. The run reads its input from the conversation’s stored messages.
start-agent.sh
accepted: true. Keep RUN_ID for subsequent requests. Acceptance does not mean execution has finished.
3. Follow progress
CallGET /runs/{run_id}/stream to replay and follow the run’s events:
follow-run.sh
Last-Event-ID set to the last received SSE event ID. Do not create another run merely to reconnect.
4. Read the result
CallGET /runs/{run_id}:
read-run.sh
status: "completed". Inspect output and the associated conversation messages to verify the response. For a failed run, inspect error and its events.
A waiting run needs the input or resume condition recorded for it. See run lifecycle before submitting a response or resuming execution.
Cancel active work
UsePOST /runs/{run_id}/cancel if you need to stop an active run, then read its status again:
cancel-run.sh
API references
- Create a conversation, create a run, and read a run.
- Execution GraphQL operations and MCP tools expose their supported execution operations.