curl -X POST "https://api.smooth.sh/api/v1/task/YOUR_TASK_ID/event" \
-H "Content-Type: application/json" \
-H "apikey: YOUR_API_KEY" \
-d '{
"name": "session_action",
"payload": {
"name": "run_task",
"input": {
"task": "Search for flights from NYC to LA",
"max_steps": 32
}
},
"id": "evt_abc123"
}'{
"r": {
"id": "<string>"
}
}Event
Send Event
Send an event to a running task. This is used for:
- Session actions:
run_task,goto,extract,evaluate_js,close - Custom tool responses: Responding to tool calls from the agent
The SDK handles this automatically when using session.run_task(), session.goto(), etc.
POST
/
task
/
{task_id}
/
event
curl -X POST "https://api.smooth.sh/api/v1/task/YOUR_TASK_ID/event" \
-H "Content-Type: application/json" \
-H "apikey: YOUR_API_KEY" \
-d '{
"name": "session_action",
"payload": {
"name": "run_task",
"input": {
"task": "Search for flights from NYC to LA",
"max_steps": 32
}
},
"id": "evt_abc123"
}'{
"r": {
"id": "<string>"
}
}Body
application/json
Event model for sending actions to running tasks.