v1

latestOpenAPI 3.1.02026-07-22106199311.5 KB
AI Agent Tasks

Create an AI Agent Task

Creates a new AI agent task and starts async execution. Poll the messages endpoint to retrieve results.

post/v1/ai/agents/tasks

Request body

messagestring required

The instruction or question to send to the agent

Example request

{
  "agentConfig": {
    "name": "data_engineer_agent",
    "environmentName": "development",
    "generateBranch": true,
    "graphId": "my-pipeline",
    "mode": "ACT",
    "projectId": "550e8400-e29b-41d4-a716-446655440001",
    "sourceBranchName": "main",
    "targetBranchName": "feature/my-pipeline",
    "workingDirectory": "/pipelines"
  },
  "grantedPermissions": [
    {
      "toolName": "execute_sql"
    }
  ],
  "message": "Build a pipeline to load sales data from S3 into Snowflake"
}

Response

Agent task created successfully

agentNamestring

The name of the agent handling the task

createdAtstring date-time

The date and time the task was created

status'RUNNING' | 'STOPPED' | 'STOPPING' | 'ERRORED'

The current status of the task

taskIdstring uuid

The unique identifier of the created task

Example response

{
  "agentName": "data_engineer_agent",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "status": "RUNNING",
  "taskId": "550e8400-e29b-41d4-a716-446655440000"
}