> ## 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 project rows

> Project table rows with the company, plan, lead and next task resolved onto each row. Default columns: title, company name, plan code and name, project lead, status, total and remaining task counts, due date, next task description/assignee/status, and tags. Opt-in via `columns`: template, total_time_logged, next_task_priority, project_type, created_at, completed_at. Status is derived the way the to-do board derives it, so it can be filtered but not sorted; the task counts and next-task cells come from the tasks collection and cannot be sorted either.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /todo/project/_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/project/_query:
    post:
      tags:
        - todo
      summary: Query project rows
      description: >-
        Project table rows with the company, plan, lead and next task resolved
        onto each row. Default columns: title, company name, plan code and name,
        project lead, status, total and remaining task counts, due date, next
        task description/assignee/status, and tags. Opt-in via `columns`:
        template, total_time_logged, next_task_priority, project_type,
        created_at, completed_at. Status is derived the way the to-do board
        derives it, so it can be filtered but not sorted; the task counts and
        next-task cells come from the tasks collection and cannot be sorted
        either.
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/pkg_routes_todo_project.QueryProjectsRequest
        description: Query projects request
        required: true
      responses:
        '200':
          description: Project rows
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pkg_routes_todo_project.QueryProjectsResponse
        '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_project.QueryProjectsRequest:
      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_project.QueryProjectsFilters'
        page:
          $ref: '#/components/schemas/types.ListPagination'
        sort:
          $ref: '#/components/schemas/types.ListSort'
    pkg_routes_todo_project.QueryProjectsResponse:
      type: object
      properties:
        rows:
          type: array
          items:
            $ref: '#/components/schemas/pkg_routes_todo_project.ProjectRow'
        total:
          type: integer
    pkg_routes_todo_project.QueryProjectsFilters:
      type: object
      properties:
        client:
          type: array
          items:
            type: string
        created:
          $ref: '#/components/schemas/types.ListFilterDate'
        data:
          type: array
          items:
            $ref: '#/components/schemas/types.ListFilterData'
        due:
          $ref: '#/components/schemas/types.ListFilterDate'
        ids:
          type: array
          items:
            type: string
        lead:
          type: array
          items:
            type: string
        plan:
          type: array
          items:
            type: string
        plan_year:
          description: PlanYear narrows to the projects launched for one plan year.
          type: array
          items:
            type: integer
        search:
          type: string
        status:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
        template:
          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_project.ProjectRow:
      type: object
      properties:
        _id:
          type: string
        company:
          $ref: '#/components/schemas/stax_ai_cx_cx-api_pkg_routes_query.CompanyRef'
        completed_at:
          type: string
        created_at:
          type: string
        due_date:
          type: string
        lead:
          $ref: '#/components/schemas/stax_ai_cx_cx-api_pkg_routes_query.Person'
        n_remaining_tasks:
          type: integer
        n_tasks:
          description: |-
            TotalTasks counts every task on the project; RemainingTasks is the
            incomplete subset.
          type: integer
        next_task:
          description: >-
            NextTask is the task the project is waiting on — the earliest
            incomplete

            one by order. Null when nothing is left to do.
          allOf:
            - $ref: '#/components/schemas/pkg_routes_todo_project.ProjectNextTask'
        plan:
          $ref: '#/components/schemas/pkg_routes_todo_project.ProjectPlanRef'
        plan_code:
          description: >-
            PlanCode is copied off the resolved plan so the table can read it as
            a

            top-level cell (the same key the projects list table already uses).
          type: string
        project_type:
          type: string
        status:
          description: >-
            Status is derived: complete or overdue where the timestamps say so,
            and

            the project's own stored status otherwise.
          type: string
        tags:
          type: array
          items:
            type: string
        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'
        title:
          type: string
        total_time_logged:
          description: TotalTimeLogged is the minutes logged across the project's tasks.
          type: integer
    types.ListFilterDate:
      type: object
      properties:
        after:
          type: string
        before:
          type: string
    types.ListFilterData:
      type: object
      properties:
        key:
          type: string
        op:
          type: string
        value: {}
    stax_ai_cx_cx-api_pkg_routes_query.CompanyRef:
      type: object
      properties:
        _id:
          type: string
        name:
          type: string
        status:
          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
    pkg_routes_todo_project.ProjectNextTask:
      type: object
      properties:
        _id:
          type: string
        assignee:
          $ref: '#/components/schemas/stax_ai_cx_cx-api_pkg_routes_query.Person'
        description:
          type: string
        priority:
          type: integer
        status:
          type: string
    pkg_routes_todo_project.ProjectPlanRef:
      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.