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

# List Tasks

> List all tasks.



## OpenAPI

````yaml openapi.json GET /tasks
openapi: 3.1.0
info:
  title: Sb0 API
  version: 0.1.0
servers: []
security: []
paths:
  /tasks:
    get:
      tags:
        - Tasks
      summary: List Tasks
      description: List all tasks.
      operationId: tasks_list
      parameters:
        - description: >-
            Optional agent filter. When provided, we authorize it via direct
            OpenFGA Check and avoid ListObjects(agent) to prevent false 403s
            from transient/partial list results.
          in: query
          name: agent_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Optional agent filter. When provided, we authorize it via direct
              OpenFGA Check and avoid ListObjects(agent) to prevent false 403s
              from transient/partial list results.
            title: Agent Id
        - in: query
          name: namespace_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Namespace Id
        - in: query
          name: agent_name
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Name
        - in: query
          name: branch_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Branch Id
        - in: query
          name: status
          required: false
          schema:
            items:
              $ref: '#/components/schemas/TaskStatus'
            title: Status
            type: array
        - in: query
          name: created_after
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            title: Created After
        - in: query
          name: created_before
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            title: Created Before
        - in: query
          name: include_total
          required: false
          schema:
            default: false
            title: Include Total
            type: boolean
        - in: query
          name: limit
          required: false
          schema:
            default: 50
            title: Limit
            type: integer
        - in: query
          name: page_number
          required: false
          schema:
            default: 1
            title: Page Number
            type: integer
        - in: query
          name: order_by
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Order By
        - in: query
          name: order_direction
          required: false
          schema:
            default: desc
            title: Order Direction
            type: string
        - in: query
          name: relationships
          required: false
          schema:
            items:
              $ref: '#/components/schemas/TaskRelationships'
            title: Relationships
            type: array
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TaskResponse'
                title: Response Tasks List
                type: array
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    TaskStatus:
      enum:
        - IDLE
        - CANCELED
        - COMPLETED
        - FAILED
        - RUNNING
        - TERMINATED
        - TIMED_OUT
        - DELETED
      title: TaskStatus
      type: string
    TaskRelationships:
      description: Task relationships that can be loaded
      enum:
        - agents
      title: TaskRelationships
      type: string
    TaskResponse:
      description: Task response model with optional related data based on relationships
      properties:
        agents:
          anyOf:
            - items:
                $ref: '#/components/schemas/Agent'
              type: array
            - type: 'null'
          title: >-
            Agents associated with this task (only populated when 'agent' view
            is requested)
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: The timestamp when the task was created
        created_version_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Version ID when task was created (immutable, for audit)
        current_version_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Current version for routing (can change on migration)
        filesystem_id:
          title: Filesystem ID for persistent filesystem storage
          type: string
        id:
          title: Unique Task ID
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Unique name of the task
        namespace_id:
          title: Namespace ID (denormalized from agent for GCS path construction)
          type: string
        params:
          additionalProperties: true
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task parameters
        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
        task_metadata:
          additionalProperties: true
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task metadata
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: The timestamp when the task was last updated
      required:
        - id
        - filesystem_id
        - namespace_id
      title: TaskResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    Agent:
      properties:
        agent_input_type:
          anyOf:
            - $ref: '#/components/schemas/AgentInputType'
            - type: 'null'
          description: The type of input the agent expects.
        created_at:
          description: The timestamp when the agent was created
          format: date-time
          title: Created At
          type: string
        description:
          description: The description of the action.
          title: Description
          type: string
        id:
          description: The unique identifier of the agent.
          title: Id
          type: string
        name:
          description: The agent name (unique within namespace).
          title: Name
          type: string
        namespace_id:
          description: The namespace ID this agent belongs to.
          title: Namespace Id
          type: string
        registered_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: The timestamp when the agent was last registered
          title: Registered At
        registration_metadata:
          additionalProperties: true
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: The metadata for the agent's registration.
          title: Registration Metadata
        status:
          $ref: '#/components/schemas/AgentStatus'
          default: ACTIVE
          description: >-
            Agent status. Runtime statuses (Ready/Failed/Unhealthy) now live on
            Deployment.
        status_reason:
          anyOf:
            - type: string
            - type: 'null'
          description: The reason for the status of the action.
          title: Status Reason
        updated_at:
          description: The timestamp when the agent was last updated
          format: date-time
          title: Updated At
          type: string
      required:
        - id
        - namespace_id
        - name
        - description
        - created_at
        - updated_at
      title: Agent
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    AgentInputType:
      enum:
        - text
        - json
      title: AgentInputType
      type: string
    AgentStatus:
      description: >-
        Agent status - runtime statuses (Ready/Failed/Unhealthy) now live on
        Deployment.
      enum:
        - ACTIVE
        - DELETED
      title: AgentStatus
      type: string

````