v1
protected
agent-tasks

Create Task For Agent With Stream

Changed on

Create and execute a task for the specified agent with real-time SSE stream.

post/v1/workspaces/{workspace}/agents/{agent_id}/tasks/

Request

Path parameters

agent_idstring uuid required
workspacestring required

Slug of the workspace the request acts in

Query parameters

followboolean

Keep the stream open through the follow-up window (up to 30 minutes) and relay follow-up turns. By default the stream ends at the turn's terminal event (task.completed, task.failed, task.cancelled); read follow-ups from GET .../tasks/{task_id}/events/stream.

Request body

attachmentsstring[] nullable
descriptionstring required
end_user_idstring nullable

The caller's own id for the end user this task runs for. Only API keys and service clients may set it.

metadataobject nullable

Trusted task metadata for tool servers, e.g. {"chatId": "..."}. At most 4096 bytes of JSON. Only API keys and service clients may set it.

parametersobject
project_idstring nullable
requires_human_approvalboolean nullable

Response

Successful Response

unknown required

Changes