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

# Query task rows

> Task table rows with the company, plan and project resolved onto each row. Default columns: description, company name, plan code and name, project title, assignee, status, priority, ready-at, due-at and client task type. Opt-in via `columns`: project_template, project_lead, project_status, created_at, completed_at. Status is derived from the task's timestamps the same way the to-do board derives it, so it can be filtered but not sorted.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /todo/task/_query
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /todo/task/_query:
    post:
      tags:
        - todo
      summary: Query task rows
      description: >-
        Task table rows with the company, plan and project resolved onto each
        row. Default columns: description, company name, plan code and name,
        project title, assignee, status, priority, ready-at, due-at and client
        task type. Opt-in via `columns`: project_template, project_lead,
        project_status, created_at, completed_at. Status is derived from the
        task's timestamps the same way the to-do board derives it, so it can be
        filtered but not sorted.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pkg_routes_todo_task.QueryTasksRequest'
        description: Query tasks request
        required: true
      responses:
        '200':
          description: Task rows
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_routes_todo_task.QueryTasksResponse'
        '400':
          description: Bad request - invalid request body
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_todo_task.QueryTasksRequest:
      type: object
      properties:
        columns:
          description: Columns names the optional cells to add to the default response.
          type: array
          items:
            type: string
        filters:
          $ref: '#/components/schemas/pkg_routes_todo_task.QueryTasksFilters'
        page:
          $ref: '#/components/schemas/types.ListPagination'
        sort:
          $ref: '#/components/schemas/types.ListSort'
    pkg_routes_todo_task.QueryTasksResponse:
      type: object
      properties:
        rows:
          type: array
          items:
            $ref: '#/components/schemas/pkg_routes_todo_task.TaskRow'
        total:
          type: integer
    pkg_routes_todo_task.QueryTasksFilters:
      type: object
      properties:
        assignee:
          type: array
          items:
            type: string
        client:
          type: array
          items:
            type: string
        client_task_type:
          description: ClientTaskType narrows to the tasks the plan sponsor does, by kind.
          type: array
          items:
            type: string
        created:
          $ref: '#/components/schemas/types.ListFilterDate'
        due:
          $ref: '#/components/schemas/types.ListFilterDate'
        ids:
          type: array
          items:
            type: string
        plan:
          type: array
          items:
            type: string
        priority:
          type: array
          items:
            type: integer
        project:
          type: array
          items:
            type: string
        ready:
          $ref: '#/components/schemas/types.ListFilterDate'
        search:
          type: string
        status:
          type: array
          items:
            type: string
    types.ListPagination:
      type: object
      properties:
        limit:
          type: integer
        skip:
          type: integer
    types.ListSort:
      type: object
      properties:
        field:
          type: string
        last: {}
        order:
          type: integer
    pkg_routes_todo_task.TaskRow:
      type: object
      properties:
        _id:
          type: string
        assignee:
          $ref: '#/components/schemas/stax_ai_cx_cx-api_pkg_routes_query.Person'
        blocked_fields:
          type: array
          items:
            type: string
        client_task_type:
          description: >-
            ClientTaskType is set on the tasks the plan sponsor does, and empty
            on

            the internal ones.
          type: string
        company:
          $ref: '#/components/schemas/stax_ai_cx_cx-api_pkg_routes_query.CompanyRef'
        completed_at:
          type: string
        created_at:
          type: string
        description:
          type: string
        due_at:
          type: string
        fields_to_complete:
          type: array
          items:
            type: string
        plan:
          $ref: '#/components/schemas/pkg_routes_todo_task.TaskPlanRef'
        priority:
          type: integer
        project:
          $ref: '#/components/schemas/stax_ai_cx_cx-api_pkg_routes_query.NamedRef'
        project_lead:
          $ref: '#/components/schemas/stax_ai_cx_cx-api_pkg_routes_query.Person'
        project_status:
          type: string
        project_template:
          description: The opt-in cells, null unless their column was requested.
          allOf:
            - $ref: '#/components/schemas/stax_ai_cx_cx-api_pkg_routes_query.NamedRef'
        ready_at:
          description: ReadyAt is when the task becomes workable; DueAt is when it is late.
          type: string
        status:
          description: >-
            Status is derived from the task's timestamps, not stored — the same
            rule

            the to-do board's status filter uses.
          type: string
    types.ListFilterDate:
      type: object
      properties:
        after:
          type: string
        before:
          type: string
    stax_ai_cx_cx-api_pkg_routes_query.Person:
      type: object
      properties:
        _id:
          type: string
        email:
          type: string
        name:
          type: string
        role:
          type: string
    stax_ai_cx_cx-api_pkg_routes_query.CompanyRef:
      type: object
      properties:
        _id:
          type: string
        name:
          type: string
        status:
          type: string
    pkg_routes_todo_task.TaskPlanRef:
      type: object
      properties:
        _id:
          type: string
        code:
          type: string
        name:
          type: string
    stax_ai_cx_cx-api_pkg_routes_query.NamedRef:
      type: object
      properties:
        _id:
          type: string
        name:
          type: string
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.