> ## 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.

# Submit Task Decisions

> Submits approval or question-answer decisions for a task that is awaiting human input.



## OpenAPI

````yaml /openapi/public-api-endpoint-reference.yaml post /v1/ai/agents/tasks/{taskId}/decisions
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}/decisions:
    post:
      tags:
        - AI Agent Tasks
      summary: Submit Task Decisions
      description: >-
        Submits approval or question-answer decisions for a task that is
        awaiting human input.
      operationId: processDecisions
      parameters:
        - in: path
          name: taskId
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskDecisionsRequest'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessApprovalsResponse'
          description: Decisions submitted successfully
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Invalid request body
        '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
        '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:
    TaskDecisionsRequest:
      type: object
      properties:
        decisions:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/QuestionAnswerDecision'
              - $ref: '#/components/schemas/ToolApprovalDecision'
          minItems: 1
      required:
        - decisions
    ProcessApprovalsResponse:
      type: object
      properties:
        pendingDecisions:
          type: array
          description: The list of decisions still pending after processing
          items:
            $ref: '#/components/schemas/PendingPermission'
    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
    QuestionAnswerDecision:
      allOf:
        - $ref: '#/components/schemas/TaskDecision'
        - type: object
          properties:
            answers:
              type: array
              description: The answers to the questions posed by the agent
              items:
                $ref: '#/components/schemas/QuestionAnswer'
              minItems: 1
            id:
              type: string
              format: uuid
              description: The unique identifier of the question decision
              example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - answers
        - id
    ToolApprovalDecision:
      allOf:
        - $ref: '#/components/schemas/TaskDecision'
        - type: object
          properties:
            approved:
              type: boolean
              description: Whether to approve the tool invocation
              example: true
            id:
              type: string
              format: uuid
              description: The unique identifier of the tool invocation to approve or deny
              example: 550e8400-e29b-41d4-a716-446655440000
            scope:
              type:
                - string
                - 'null'
              description: >-
                The scope of the approval — ONCE for a single invocation,
                CONVERSATION for the entire task
              enum:
                - ONCE
                - CONVERSATION
              example: ONCE
      required:
        - approved
        - id
    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
    TaskDecision:
      discriminator:
        propertyName: type
      properties:
        type:
          type: string
      required:
        - type
    QuestionAnswer:
      type: object
      properties:
        questionIndex:
          type: integer
          format: int32
          description: The zero-based index of the question being answered
          example: 0
        selectedOptions:
          type: array
          description: The selected option values for the question
          example:
            - option_a
          items:
            type: string
            minLength: 1
          minItems: 1
      required:
        - selectedOptions
    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

````