Skip to main content
POST
Create Task For Agent With Stream

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agent_id
string<uuid>
required
workspace
string
required

Slug of the workspace the request acts in

Maximum string length: 120
Pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$

Query Parameters

follow
boolean
default:false

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.

Body

application/json
description
string
required
attachments
string[] | null
end_user_id
string | null

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

Required string length: 1 - 256
execution
RunExecutionConfig · object | null

Caller-requested execution ceiling; governance may only tighten it.

metadata
Metadata · object | null

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

parameters
Parameters · object
project_id
string | null
requires_human_approval
boolean | null
default:false
task_policy
PolicyDocument · object | null

Source policy document stored per scope.

webhook
TaskWebhook · object | null

POSTed on task.completed, task.failed and task.cancelled with the task's total_cost, tokens_used, end_user_id and metadata. Only API keys and service clients may set it.

Response

Successful Response