> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get an AI Agent Task

> Returns the details of a specific AI agent task including its current status and pending decisions.



## OpenAPI

````yaml /openapi/public-api-endpoint-reference.yaml get /v1/ai/agents/tasks/{taskId}
openapi: 3.1.0
info:
  title: Maia Public REST API
  version: '1.0'
servers:
  - description: EU1
    url: https://eu1.api.matillion.com/dpc
  - description: US1
    url: https://us1.api.matillion.com/dpc
security:
  - bearerAuth: []
tags:
  - description: Manage Schedules
    name: Schedules
  - description: Manage Connections
    name: Connections
  - description: Operations for managing Project Variables
    name: Project Variables
  - description: Manage Pipelines
    name: Pipelines
  - description: Review pipelines against quality rules
    name: Pipeline Quality Review
  - description: Execute tests within a project
    name: Test Execution
  - description: Manage your AI agent tasks
    name: AI Agent Tasks
  - description: SCIM endpoints for user/group permission management
    name: Directory Integration
  - description: Publish shared pipeline artifacts
    name: Shared Pipeline Artifacts
  - description: Manage Repositories
    name: Repositories
  - description: Report on Credit Consumption
    name: Consumption
  - description: Manage Artifacts
    name: Artifacts
  - description: Operations for data lineage and governance
    name: Data Lineage
  - description: Manage Streaming Pipelines
    name: Streaming Pipelines
  - description: Execute a pipeline
    name: Pipeline Execution
  - description: ''
    name: Environments
  - description: ''
    name: Projects
  - description: Manage Agents
    name: Agents
  - description: Operations for managing Environment-level Overrides of Project Variables
    name: Project Variable Environment Overrides
  - description: Query audit events
    name: Audit Events
  - description: Connector Profiles
    name: Connectors
paths:
  /v1/ai/agents/tasks/{taskId}:
    get:
      tags:
        - AI Agent Tasks
      summary: Get an AI Agent Task
      description: >-
        Returns the details of a specific AI agent task including its current
        status and pending decisions.
      operationId: getTask
      parameters:
        - in: path
          name: taskId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          content:
            application/json:
              examples:
                Agent task details:
                  description: Example response for a successfully retrieved agent task
                  value:
                    taskId: 550e8400-e29b-41d4-a716-446655440000
                    status: STOPPED
                    description: Build a pipeline to load sales data
                    createdAt: '2024-01-15T10:30:00.000Z'
                    modifiedAt: '2024-01-15T10:45:00.000Z'
                    agentConfig:
                      name: data_engineer_agent
                      mode: ACT
                      projectId: 550e8400-e29b-41d4-a716-446655440001
                      sourceBranchName: main
                      environmentName: development
                    grantedPermissions: []
                    pendingDecisions: []
              schema:
                $ref: '#/components/schemas/GetTaskResponse'
          description: Agent task retrieved successfully
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Invalid request parameters
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Missing or invalid authentication token
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Insufficient permissions to retrieve the agent task
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Task not found
        '502':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Upstream service error
        '504':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Upstream service timeout
components:
  schemas:
    GetTaskResponse:
      type: object
      properties:
        agentConfig:
          description: The configuration of the agent handling the task
          oneOf:
            - $ref: '#/components/schemas/DataEngineerAgentConfig'
        createdAt:
          type: string
          format: date-time
          description: The date and time the task was created
          example: '2024-01-15T10:30:00.000Z'
        description:
          type: string
          description: A short description of what the agent was asked to do
          example: Build a pipeline to load sales data from S3 into Snowflake
        grantedPermissions:
          type: array
          description: Permissions that have been granted to the agent for this task
          items:
            $ref: '#/components/schemas/AllowedTool'
        modifiedAt:
          type: string
          format: date-time
          description: The date and time the task was last modified
          example: '2024-01-15T10:45:00.000Z'
        pendingDecisions:
          type: array
          description: Decisions awaiting approval before the agent can proceed
          items:
            $ref: '#/components/schemas/PendingPermission'
        status:
          type: string
          description: The current status of the task
          enum:
            - RUNNING
            - STOPPED
            - STOPPING
            - ERRORED
          example: STOPPED
        taskId:
          type: string
          format: uuid
          description: The unique identifier of the task
          example: 550e8400-e29b-41d4-a716-446655440000
    ProblemDetail:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
        violations:
          type: array
          items:
            type: string
    DataEngineerAgentConfig:
      allOf:
        - $ref: '#/components/schemas/AgentConfig'
        - type: object
          properties:
            environmentName:
              type: string
              description: The name of the environment to use for execution
              example: development
              minLength: 1
            generateBranch:
              type: boolean
              description: >-
                Whether the agent should auto-generate a new branch for its
                changes
              example: true
            graphId:
              type:
                - string
                - 'null'
              description: The ID of the pipeline graph the agent will work on
              example: my-pipeline
            mode:
              type: string
              description: >-
                The execution mode. ACT allows the agent to make changes; PLAN
                produces a plan only
              enum:
                - PLAN
                - ACT
              example: ACT
            name:
              type: string
              description: The agent type identifier. Must be "data_engineer_agent"
              example: data_engineer_agent
              minLength: 1
            projectId:
              type: string
              format: uuid
              description: The ID of the project the agent will work within
              example: 550e8400-e29b-41d4-a716-446655440001
            sourceBranchName:
              type: string
              description: The branch the agent will read from
              example: main
              minLength: 1
            targetBranchName:
              type:
                - string
                - 'null'
              description: >-
                The branch the agent will write changes to. Required unless
                generateBranch is true
              example: feature/my-pipeline
            workingDirectory:
              type:
                - string
                - 'null'
              description: The working directory within the project for the agent
              example: /pipelines
      required:
        - environmentName
        - mode
        - name
        - projectId
        - sourceBranchName
    AllowedTool:
      type: object
      properties:
        toolName:
          type: string
          description: The name of the tool to allow
          example: execute_sql
          minLength: 1
      required:
        - toolName
    PendingPermission:
      type: object
      properties:
        permissionMessage:
          $ref: '#/components/schemas/PermissionMessage'
          description: Human-readable details about the permission being requested
        toolId:
          type: string
          description: The unique identifier of the tool invocation
          example: call_abc123
        toolInput:
          $ref: '#/components/schemas/JsonNode'
          description: The input the tool will use if permission is granted
        toolName:
          type: string
          description: The name of the tool requesting permission
          example: execute_sql
        type:
          type: string
          description: The type of decision required
          enum:
            - tool
            - question
          example: tool
    AgentConfig:
      discriminator:
        propertyName: name
      properties:
        name:
          type: string
      required:
        - name
    PermissionMessage:
      type: object
      properties:
        body:
          type: string
          description: A detailed description of the permission being requested
          example: 'The agent wants to run: SELECT * FROM sales'
        title:
          type: string
          description: A short title summarising the permission request
          example: Execute SQL query
    JsonNode: {}
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: a valid bearer token
      scheme: bearer
      type: http

````