Skip to main content
The Agent Tasks API endpoints let you programmatically create, monitor, and manage ‘s tasks. You give an instruction and it works asynchronously in the background. You can’t use the API to chat with or receive instant responses—to interact with in this way, chat with in or work on your task in . The ai/agents/tasks endpoints allow you to perform the following actions:
  • Create a task: Give an instruction to work on. Returns the task ID you need for all subsequent actions.
  • List tasks: Retrieve a list of all tasks, optionally filtered by any combination of the task’s project, branch, status, and creation date.
  • Find the status of a task: Check the current status and details of a task.
  • Handle decisions: Approve tool use or answer questions when pauses mid-task and asks for your input.
  • Read messages: Retrieve the message history for a task to follow ‘s reasoning or collect its output.
  • Send a follow-up message: Send additional instructions to an existing task—for example, to give clarification, redirect , or resume it after it’s stopped.
  • Stop a task: Stop a running task. finishes what it’s currently doing before stopping.
  • Delete a task: Permanently delete a task and all of its associated data.
  • Update task permissions: Replace the full set of tools is permitted to use.
A task is the overall piece of work you give to complete—comparable to opening a new chat with in and sending your opening prompt. A message is an individual instruction sent within that task, comparable to continuing that same chat. works under the identity of the user associated with the API key. This means that any changes you make using the Agent Tasks API endpoints aren’t automatically visible to other project users. To review or merge the work, ask to commit and push changes to the target branch. You can either include this in your original instruction when you create the task, or send a follow-up message as part of the existing task. Each task works in isolation on its own branch, so creating a new task always starts a completely separate piece of work that isn’t connected to any previous task.
These endpoints currently only work with Matillion-hosted and GitHub projects.

Create a task

Use this endpoint to create a new task and send an instruction to work on. A successful request returns a task ID that you use in all subsequent requests.

Request fields

Example request

Base URL: POST /v1/ai/agents/tasks Example request body:
Example success response:

List tasks

Use this endpoint to retrieve a list of all tasks. You can filter the results by any combination of the task’s project, branch, status, and creation date.

Query parameters

Example request

Base URL: GET /v1/ai/agents/tasks Example success response:

Find the status of a task

Use this endpoint to check the current status and details of a task.

Task statuses

STOPPED means two different things depending on whether the task has pending decisions:
  • STOPPED + empty pendingDecisions = the agent has finished. Treat as terminal.
  • STOPPED + non-empty pendingDecisions = the agent is paused waiting for human input. This is not a terminal state—submit decisions to resume the task.
Checking only the status field may cause paused tasks to be incorrectly marked as completed.

Example request

Base URL: GET /v1/ai/agents/tasks/{taskId} Example success response:

Handle decisions

Use this endpoint to submit decisions on a stopped task and resume the agent. When pendingDecisions is not empty on a STOPPED task, the agent is paused waiting for your input. There are two decision types:
  • Approve the use of a tool so that can use this tool to complete its task.
  • Answer a question that asked as part of completing its task.

Example request: Tool approval

Base URL: POST /v1/ai/agents/tasks/{taskId}/decisions
The id value comes from pendingDecisions[].toolId on the task. Set scope to "CONVERSATION" to pre-approve the tool for the remainder of the task—useful when the agent will call the same tool many times in a loop.

Example request: Answer a question

Example success response:

Read messages

Use this endpoint to retrieve the message history for a task and follow the agent’s reasoning or collect its output. This is the primary way to see what the agent is doing and read its results.

Query parameters

Example request

Base URL: GET /v1/ai/agents/tasks/{taskId}/messages The response includes a results array of events ordered chronologically, and a more field containing the pagination token for the next page. When more is absent and the task status is STOPPED or ERRORED, there are no more events to retrieve.

Send a follow-up message

Use this endpoint to send an additional instruction to an existing task—for example, to give clarification, redirect the agent, or resume it after it has stopped.

Request fields

Example request

Base URL: POST /v1/ai/agents/tasks/{taskId}/messages Example request body:
Example success response:

Stop a task

Use this endpoint to stop a task that is running. finishes what it is currently doing before stopping. Use GET /v1/ai/agents/tasks/{taskId} to monitor the task status until it reaches STOPPED before attempting further operations on the task. Once stopped, you can resume the task by sending it a new message, or delete it.

Example request

Base URL: POST /v1/ai/agents/tasks/{taskId}/stop No request body is required. Example success response:

Delete a task

Use this endpoint to permanently delete a task and all of its associated data. Deleting a task means that you won’t have an audit trail for any changes that made as part of the deleted task.
You can’t delete a task with a status of RUNNING—the request will fail with a 409 Conflict. Stop the task first and wait for it to reach STOPPED before deleting.

Example request

Base URL: DELETE /v1/ai/agents/tasks/{taskId} Example success response:

Update task permissions

Use this endpoint to replace the full set of tools the agent has been granted permission to use. This is a complete replacement—whatever you send becomes the new list. For a list of available tools and their toolName values, read Available tools below.
This endpoint replaces the full permission set, not individual permissions. To add a single permission, re-send the complete list including the new entry. Pass an empty list ([]) to clear all permissions.

Example request

Base URL: PUT /v1/ai/agents/tasks/{taskId}/permissions Example request body:
Example success response:

Available tools

The following table lists all tools that can use as part of a task. Use the names in the Tool name column as the value of the toolName field when creating a task or updating task permissions.