Skip to main content
GET
/
v1
/
runs
/
{id}
/
events
curl -N \
  -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.crewship.dev/v1/runs/run_xyz789abc/events"
data: {"type":"run.started","data":{"entrypoint":"default"}}

data: {"type":"task.started","data":{"task":"Research AI trends","agent":"Researcher"}}

data: {"type":"log","data":{"message":"Found 15 relevant results"}}

data: {"type":"task.completed","data":{"task":"Research AI trends","agent":"Researcher"}}

data: {"type":"artifact","data":{"name":"report.md"}}

data: {"type":"run.completed","data":{"status":"succeeded"}}

Path Parameters

id
string
required
Run ID (e.g., run_xyz789abc)

Event Format

Events are sent as SSE data messages with JSON payloads:
data: {"type":"run.started","data":{"entrypoint":"default"}}

data: {"type":"task.started","data":{"task":"Research AI trends","agent":"Researcher"}}

data: {"type":"log","data":{"message":"Found 15 relevant results"}}

Event Types

When the runner machine is reachable, you receive detailed events from the crew execution:
TypeDescription
run.startedRun execution began
run.completedRun finished successfully
run.failedRun encountered an error
task.startedA task began execution
task.completedA task finished
agent.actionAn agent performed an action
tool_useA tool was invoked
logLog message from the crew
artifactAn artifact was produced
If the runner machine is not reachable, the API falls back to polling the database and sends simpler status events:
TypeDescription
heartbeatPeriodic status update while the run is in progress
completeRun reached a terminal state (succeeded, failed, canceled)
errorAn error occurred (e.g., run not found)
timeoutThe SSE connection timed out
curl -N \
  -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.crewship.dev/v1/runs/run_xyz789abc/events"
data: {"type":"run.started","data":{"entrypoint":"default"}}

data: {"type":"task.started","data":{"task":"Research AI trends","agent":"Researcher"}}

data: {"type":"log","data":{"message":"Found 15 relevant results"}}

data: {"type":"task.completed","data":{"task":"Research AI trends","agent":"Researcher"}}

data: {"type":"artifact","data":{"name":"report.md"}}

data: {"type":"run.completed","data":{"status":"succeeded"}}

Notes

  • If the run is already in a terminal state (succeeded, failed, canceled), a single complete event is returned immediately
  • If the runner machine is reachable, events are proxied directly from the machine in real time
  • If the machine is not reachable, the API falls back to polling the database every 2 seconds and sending heartbeat events
  • The connection times out after 30 minutes