Run an agent
Create a new task for the specified agent. Two body formats are accepted:
multipart/form-data— when you need to attach files (PDFs, images, spreadsheets, etc.). Send onefilespart per attachment, plus optionalqueryandoutput_config(the latter as a JSON-encoded string field).application/json— for text-only runs. Sendqueryand an optional structuredoutput_configobject.
Either query or at least one file must be provided.
The response returns immediately with the new task_id. The task itself runs
asynchronously — poll GET /v1/tasks/{task_id} or GET /v1/tasks/{task_id}/summary
to retrieve the result.
Authorizations
Workspace API key issued from the web app. Pass as
Authorization: Bearer YOUR_API_KEY.
Path Parameters
UUID of the agent.
Body
Prompt text. Optional when one or more files are attached.
One or more file attachments (PDF, image, Word, Excel, etc.). Repeat
the files field per attachment. The legacy field name file is
also accepted for a single upload.
JSON-encoded TaskOutputConfig — submitted as a string field in
multipart bodies. Supports output_schema and instructions. See
the RunAgentRequest schema for the structured equivalent.
Response
Task created.
Lifecycle status of a task.
pending— created, not yet picked upqueued— held back by admission control (agent at concurrent-task limit)running— being processed by the workerwaiting_for_input— agent calledask_user; reply withPOST /tasks/{id}/messageawaiting_review— agent is paused for human approval of a sensitive stepcompleted— terminal: finished successfullyfailed— terminal: errored outstopped— terminal: cancelled by a user or system
pending, queued, running, waiting_for_input, awaiting_review, completed, failed, stopped Human-readable hint, e.g. "Task created successfully. Use GET /v1/tasks/{task_id} to check status."