Agents
Execute Agent
Execute a specific agent by ID.
POST
Code Examples
Headers
integer
required
Workspace ID. Required as of 2026-09-01. Until then, if omitted, the user’s selected workspace is used (deprecated). After the cutoff, a missing header returns 422.
Path Parameters
Request Body
How to use memories in an executionTo inject memory context into an agent, pass Memory Collection IDs in the
memory_collections field. The full flow is:- Create a Collection —
POST /api/memory-collections— and save the returnedid. - Create Memories —
POST /api/memories— passingcollection_idand the memory text in thememoryfield. - Execute the Agent — include
"memory_collections": [collection_id]in the request body.
Messages Roles (Chat Type Templates)
For chat type templates, themessages array supports the following roles:
Important rules:
- Messages must alternate between
userandassistantroles (after the optionaldevelopermessage). - The
developerrole can only appear as the first message in the array and will be extracted before processing the rest. - If two consecutive messages have the same role (e.g., two
usermessages), the API will return a validation error: “Chat messages must be a pair of user/assistant”. - The
systemrole is not supported and will cause an error.
Response
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Workspace ID. Required as of 2026-09-01. Until then, if omitted, the user's selected workspace is used (deprecated). After the cutoff, a missing header returns 422.
Path Parameters
The agent ID.
Body
application/json
Send a JSON object. Known fields are supported, and you can add custom fields directly at the root (for example: department, reporting_period, include_risks).
Free-form JSON object. Send known fields and any custom agent fields directly at the root level.
Response
200
Execution started (or completed if waitExecution: true).