Start a task
Do this when you want an agent to run once against a prompt you supply. Do not do this to send a follow-up message into a run that is already going — that is a command on the existing task, covered in Cancel and retry a task. All three entry points create the same task and dispatch the same workflow. They differ only in how the response reaches you.Prerequisites
- An agent that exists and has a model configured. An agent with no
model_idis rejected at creation with 422, not at run time. - An API key. Create one with
POST /v1/api-keys/and readtokenfrom the 201 response — it is returned once and never again. - The agent’s id.
GET /v1/agents/lists them.
Choose an entry point
sync is the misleading name here: it returns a JSON response instead of a
stream. It does not wait for the agent to finish. It returns as soon as the
workflow is dispatched, with status set to running.
Steps
Option A — REST, streaming
The response is Server-Sent Events. Do not pipe it tojq.
connected event, then task_created carrying the
task_id, then the execution events:
Option B — REST, JSON response
id. Every other task endpoint needs it alongside the agent id.
Option C — CLI
agentarea tasks submit-sync for the JSON form. Loose flags are folded into
the request body, so --description "..." works in place of --data.
Option D — A2A JSON-RPC
The endpoint isPOST /v1/agents/{agent_id}/a2a/rpc. Method names are
PascalCase — SendMessage, not message/send. A slash-style method returns
“method not found”.
SendMessage returns as soon as the task is submitted. Use
SendStreamingMessage for a live SSE stream, or GetTask to poll.
Optional request fields
TaskCreate accepts more than description:
Verify
Fetch the task and confirm it has anexecution_id and a live status:
execution_id present and status of running means the Temporal workflow
started. A task sitting at pending with execution_id: null was persisted but
never dispatched.
Troubleshooting
The streaming endpoint returns nothing parseable.POST /v1/agents/{agent_id}/tasks/ responds with text/event-stream. curl without
-N buffers it and jq cannot parse it. Use -N, or switch to /sync.
422 with “does not have a model configured”. The agent was installed from
the catalog without a matching model instance in this workspace, so model_id
was left unset. Assign a model to the agent, or pass
parameters.model_override on the run.
422 from the policy layer. A task_policy that widens any limit set at the
workspace or agent scope is rejected — task policy may only tighten. Compare
against POST /v1/governance/effective-policy/preview before retrying.
The task exists but nothing happens and execution_id is null. The workflow
dispatch failed, usually because no Temporal worker is running on the
agent-tasks queue. The task row is written before dispatch, so a creation
success does not prove a worker exists. Check the worker, then start a new task
— a task that never dispatched cannot be resumed.
A creation call returns a task you did not expect. If parameters carries
channel_origin.chat_id matching a workflow already running for the same agent,
the message is delivered into that workflow as a follow-up and the existing task
comes back with status: "routed". No new task is created.