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

# List Tasks

> List all tasks.



## OpenAPI

````yaml https://agentex.dev-sgp.scale.com/openapi.json get /tasks
openapi: 3.1.0
info:
  title: Agentex API
  version: 0.1.0
servers: []
security: []
paths:
  /tasks:
    get:
      tags:
        - Tasks
      summary: List Tasks
      description: List all tasks.
      operationId: list_tasks_tasks_get
      parameters:
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Id
        - name: agent_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Name
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/TaskStatus'
              - type: 'null'
            description: Filter tasks by status (e.g. RUNNING, COMPLETED).
            title: Status
          description: Filter tasks by status (e.g. RUNNING, COMPLETED).
        - name: task_metadata
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              JSON-encoded object used to filter tasks via JSONB containment.
              Example: {"created_by_user_id": "abc-123"}.
            title: Task Metadata
          description: >-
            JSON-encoded object used to filter tasks via JSONB containment.
            Example: {"created_by_user_id": "abc-123"}.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
            title: Limit
        - name: page_number
          in: query
          required: false
          schema:
            type: integer
            default: 1
            title: Page Number
        - name: order_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Order By
        - name: order_direction
          in: query
          required: false
          schema:
            type: string
            default: desc
            title: Order Direction
        - name: relationships
          in: query
          required: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/TaskRelationships'
            title: Relationships
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TaskResponse'
                title: Response List Tasks Tasks Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TaskStatus:
      type: string
      enum:
        - CANCELED
        - COMPLETED
        - FAILED
        - RUNNING
        - TERMINATED
        - TIMED_OUT
        - DELETED
      title: TaskStatus
    TaskRelationships:
      type: string
      enum:
        - agents
      title: TaskRelationships
      description: Task relationships that can be loaded
    TaskResponse:
      properties:
        id:
          type: string
          title: Unique Task ID
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Unique name of the task
        status:
          anyOf:
            - $ref: '#/components/schemas/TaskStatus'
            - type: 'null'
          title: The current status of the task
        status_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: The reason for the current task status
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The timestamp when the task was created
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The timestamp when the task was last updated
        cleaned_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: >-
            The timestamp when the task's content was cleaned for retention
            compliance; null when active
        params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task parameters
        task_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task metadata
        agents:
          anyOf:
            - items:
                $ref: '#/components/schemas/Agent'
              type: array
            - type: 'null'
          title: >-
            Agents associated with this task (only populated when 'agent' view
            is requested)
      type: object
      required:
        - id
      title: TaskResponse
      description: Task response model with optional related data based on relationships
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Agent:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier of the agent.
        name:
          type: string
          title: Name
          description: The unique name of the agent.
        description:
          type: string
          title: Description
          description: The description of the action.
        status:
          $ref: '#/components/schemas/AgentStatus'
          description: >-
            The status of the action, indicating if it's building, ready,
            failed, etc.
          default: Unknown
        acp_type:
          $ref: '#/components/schemas/ACPType'
          description: The type of the ACP Server (Either sync or async)
        status_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Reason
          description: The reason for the status of the action.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The timestamp when the agent was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The timestamp when the agent was last updated
        registration_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Registration Metadata
          description: The metadata for the agent's registration.
        registered_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Registered At
          description: The timestamp when the agent was last registered
        agent_input_type:
          anyOf:
            - $ref: '#/components/schemas/AgentInputType'
            - type: 'null'
          description: The type of input the agent expects.
        production_deployment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Production Deployment Id
          description: ID of the current production deployment.
      type: object
      required:
        - id
        - name
        - description
        - acp_type
        - created_at
        - updated_at
      title: Agent
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AgentStatus:
      type: string
      enum:
        - Ready
        - Failed
        - Unknown
        - Deleted
        - Unhealthy
        - BuildOnly
      title: AgentStatus
    ACPType:
      type: string
      enum:
        - sync
        - async
        - agentic
      title: ACPType
    AgentInputType:
      type: string
      enum:
        - text
        - json
      title: AgentInputType

````