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

# List task runs

> Returns a paginated list of task runs. Supports filtering by agent, credential, source, task, workflow, status, result, and date range.



## OpenAPI

````yaml /api-reference/v2.json get /task-runs
openapi: 3.1.1
info:
  title: Deck API
  version: 2.0.0
servers:
  - url: https://api.deck.co/v2
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Agents
  - name: Components
  - name: Credentials
  - name: Event Destinations
  - name: Events
  - name: Sessions
  - name: Sources
  - name: Storage
  - name: Task Runs
  - name: Tasks
  - name: Test
paths:
  /task-runs:
    get:
      tags:
        - Task Runs
      summary: List task runs
      description: >-
        Returns a paginated list of task runs. Supports filtering by agent,
        credential, source, task, workflow, status, result, and date range.
      operationId: listTaskRuns
      parameters:
        - name: limit
          in: query
          description: Maximum number of items to return (1-100, default 20)
          schema:
            pattern: ^-?(?:0|[1-9]\d*)$
            type:
              - integer
              - string
            format: int32
        - name: cursor
          in: query
          schema:
            type: string
          description: Cursor from a previous response for pagination.
        - name: status
          in: query
          description: >-
            Filter by status: queued, running, canceling, interaction_required,
            review_required, completed, canceled, failed
          schema:
            type: array
            items:
              type: string
        - name: source_id
          in: query
          description: Filter by source ID
          schema:
            type: array
            items:
              type: string
        - name: outcome
          in: query
          description: >-
            Filter by run result: success, failure, unknown. Maps to the
            `result` field on the task run object.
          schema:
            type: array
            items:
              type: string
        - name: agent_id
          in: query
          schema:
            type: string
          description: Unique identifier for the agent (prefixed with `agt_`).
        - name: credential_id
          in: query
          schema:
            type: string
          description: Unique identifier for the credential (prefixed with `cred_`).
        - name: task_id
          in: query
          schema:
            type: string
          description: Unique identifier for the task (prefixed with `task_`).
        - name: workflow_id
          in: query
          schema:
            type: string
          description: Filter by workflow ID.
        - name: created_after
          in: query
          schema:
            type: string
            format: date-time
          description: Return runs created after this timestamp (ISO 8601).
        - name: created_before
          in: query
          schema:
            type: string
            format: date-time
          description: Return runs created before this timestamp (ISO 8601).
        - name: search
          in: query
          schema:
            type: string
          description: Free-text search matching task name, task ID, or task run ID.
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/PaginatedResponseOfListTaskRunData'
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponseOfListTaskRunData'
            text/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponseOfListTaskRunData'
        '400':
          description: Bad request — validation error or malformed input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not found — the requested resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            Conflict — the request is valid but cannot be completed in the
            current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Unprocessable content — the request body is understood but contains
            invalid values.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PaginatedResponseOfListTaskRunData:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ListTaskRunData'
          description: Array of resource objects for the current page.
        has_more:
          type: boolean
          description: '`true` if there are more results beyond this page.'
        next_cursor:
          type:
            - 'null'
            - string
          description: >-
            Opaque cursor string to pass as the `cursor` query parameter on the
            next request. `null` when there are no more pages.
        request_id:
          type:
            - 'null'
            - string
          description: Unique identifier for the API request.
    ValidationErrorResponse:
      required:
        - errors
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
          description: RFC 9110 problem type URI.
        title:
          type:
            - 'null'
            - string
          description: Short summary of the validation failure.
        status:
          type:
            - 'null'
            - integer
          description: HTTP status code.
          format: int32
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Validation errors grouped by field name.
        traceId:
          type:
            - 'null'
            - string
          description: Request trace identifier.
      description: Validation error returned for malformed requests (HTTP 400).
    ErrorResponse:
      required:
        - errors
        - request_id
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/TaskRunError'
          description: One or more errors that describe what went wrong.
        request_id:
          type: string
          description: Unique identifier for this request, useful for tracing.
      description: Standard error response.
    ListTaskRunData:
      required:
        - id
        - object
        - status
        - result
        - task_id
        - credential_id
        - session_id
        - agent_id
        - source_id
        - runtime_ms
        - output
        - errors
        - interaction
        - created_at
        - updated_at
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the task run, prefixed with `trun_`.
        object:
          type: string
          description: Always `task_run`.
        status:
          type: string
          description: >-
            Run status: `queued`, `running`, `canceling`,
            `interaction_required`, `review_required`, `completed`, `canceled`,
            or `failed`.
        result:
          type:
            - 'null'
            - string
          description: >-
            Run result after completion: `success`, `failure`, or `unknown`.
            Null while running.
        task_id:
          type: string
          description: The task that was executed. Prefixed with `task_`.
        credential_id:
          type:
            - 'null'
            - string
          description: >-
            The credential used for authentication, if any. Prefixed with
            `cred_`.
        session_id:
          type:
            - 'null'
            - string
          description: The session this run executed within, if any. Prefixed with `sess_`.
        agent_id:
          type: string
          description: The agent that executed this run. Prefixed with `agt_`.
        source_id:
          type:
            - 'null'
            - string
          description: The source this run connected to, if any. Prefixed with `src_`.
        runtime_ms:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
          description: Execution time in milliseconds.
        output:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/JsonElement'
          description: Output data produced by the task execution.
        errors:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/TaskRunError'
          description: Error details if the run failed. Same structure as API-level errors.
        interaction:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/JsonElement'
          description: >-
            Interaction details when the run is paused waiting for user input
            (e.g. MFA code, security question).
        created_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the resource was created.
        updated_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the resource was last updated.
      description: A task run object representing a single execution of a task.
    TaskRunError:
      required:
        - type
        - code
        - message
      type: object
      properties:
        type:
          type: string
          description: >-
            Error category (e.g. `source`, `auth`, `task`, `rate_limit`).
            Determines the class of failure.
        code:
          type: string
          description: Machine-readable error code. Use this for programmatic handling.
        message:
          type: string
          description: >-
            Human-readable explanation. Do not rely on this for logic — it may
            change.
        field:
          type:
            - 'null'
            - string
          description: The input field that caused the error, when applicable.
      description: Error details for a failed task run. Same structure as API-level errors.
    JsonElement:
      description: Arbitrary JSON value.
  securitySchemes:
    BearerAuth:
      type: http
      description: Secret key (sk_live_...)
      scheme: bearer
      bearerFormat: JWT

````