> ## 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 plan admin rows for a plan year

> Plan-admin table rows for one plan year. Default columns: plan code, name, type, PYE, company name, plan consultant, plan tags, admin status, questionnaire completion, census data method and census/employee issue counts. Opt-in via `columns`: company_status, notes. The light-mode sibling of /packages/retirement/planadmin/census-status/{planYear}/_list — it reads the stored admin status instead of recalculating it, so it is safe to call on every keystroke. Filter by admin_status (include-only; "not_started" also matches plans never calculated) and has_census_issues. Joinder plans are excluded unless `filters.include_joinders` is set.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /packages/retirement/planadmin/plans/{py}/_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:
  /packages/retirement/planadmin/plans/{py}/_query:
    post:
      tags:
        - packages
      summary: Query plan admin rows for a plan year
      description: >-
        Plan-admin table rows for one plan year. Default columns: plan code,
        name, type, PYE, company name, plan consultant, plan tags, admin status,
        questionnaire completion, census data method and census/employee issue
        counts. Opt-in via `columns`: company_status, notes. The light-mode
        sibling of /packages/retirement/planadmin/census-status/{planYear}/_list
        — it reads the stored admin status instead of recalculating it, so it is
        safe to call on every keystroke. Filter by admin_status (include-only;
        "not_started" also matches plans never calculated) and
        has_census_issues. Joinder plans are excluded unless
        `filters.include_joinders` is set.
      parameters:
        - description: Plan year
          name: py
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/pkg_routes_packages_retirement_plan_admin.QueryPlanAdminRequest
        description: Query plan admin request
        required: true
      responses:
        '200':
          description: Plan admin rows
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pkg_routes_packages_retirement_plan_admin.QueryPlanAdminResponse
        '400':
          description: Bad request - invalid plan year, request body or parent_plan ID
          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_packages_retirement_plan_admin.QueryPlanAdminRequest:
      type: object
      properties:
        columns:
          description: >-
            Columns names the optional cells to add to the default response: the
            two

            the plan-admin table has are company_status and notes, both shared
            with

            the plan row route.
          type: array
          items:
            type: string
        filters:
          $ref: >-
            #/components/schemas/pkg_routes_packages_retirement_plan_admin.QueryPlanAdminFilters
        page:
          $ref: '#/components/schemas/types.ListPagination'
        roles:
          $ref: '#/components/schemas/stax_ai_cx_cx-api_pkg_routes_query.RoleNames'
        sort:
          $ref: '#/components/schemas/types.ListSort'
    pkg_routes_packages_retirement_plan_admin.QueryPlanAdminResponse:
      type: object
      properties:
        rows:
          type: array
          items:
            $ref: >-
              #/components/schemas/pkg_routes_packages_retirement_plan_admin.PlanAdminRow
        total:
          type: integer
    pkg_routes_packages_retirement_plan_admin.QueryPlanAdminFilters:
      type: object
      properties:
        admin_status:
          description: >-
            AdminStatus matches a plan's current admin status for the requested
            year.

            Include-only. "not_started" also matches plans whose status has
            never been

            calculated, which is what a plan with no stored status row means.
          type: array
          items:
            type: string
        assignee:
          type: array
          items:
            type: string
        client:
          description: >-
            Client narrows to specific companies; Assignee narrows to the
            companies a

            user is assigned to. Both resolve onto the plan's client field, and
            a

            plan matching either one is kept.
          type: array
          items:
            type: string
        created:
          $ref: '#/components/schemas/types.ListFilterDate'
        data:
          type: array
          items:
            $ref: '#/components/schemas/types.ListFilterData'
        has_census_issues:
          description: >-
            HasCensusIssues narrows to plans carrying census or employee errors,
            or,

            when false, to those carrying neither — plans with no stored status
            row

            included, since they have no recorded errors either.
          type: boolean
        ids:
          type: array
          items:
            type: string
        include_joinders:
          description: >-
            IncludeJoinders keeps the joinder plans of a MEP/PEP in the result.
            It

            defaults to false on the wire, so callers wanting them must say so.
          type: boolean
        parent_plan:
          type: string
        plan_structure:
          type: array
          items:
            type: string
        pye:
          type: array
          items:
            type: string
        record_keeper:
          type: array
          items:
            type: string
        search:
          type: string
        status:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
        type:
          type: array
          items:
            type: string
    types.ListPagination:
      type: object
      properties:
        limit:
          type: integer
        skip:
          type: integer
    stax_ai_cx_cx-api_pkg_routes_query.RoleNames:
      type: object
      properties:
        advisor:
          type: string
        consultant:
          type: string
        consultant_fallback:
          type: string
        contact:
          type: string
    types.ListSort:
      type: object
      properties:
        field:
          type: string
        last: {}
        order:
          type: integer
    pkg_routes_packages_retirement_plan_admin.PlanAdminRow:
      type: object
      properties:
        _id:
          type: string
        calculated_status:
          $ref: '#/components/schemas/legacytypes.PlanAdminStatusEnum'
        census_data_method:
          description: >-
            CensusDataMethod is the payroll provider the census comes from,
            "Reports"

            when it arrives as uploaded reports, or null when neither is in
            place.
          type: string
        census_issues:
          type: integer
        code:
          type: string
        company:
          $ref: '#/components/schemas/stax_ai_cx_cx-api_pkg_routes_query.CompanyRef'
        employee_issues:
          type: integer
        is_joinder:
          description: IsJoinder marks a joinder plan of a MEP/PEP.
          type: boolean
        name:
          type: string
        notes:
          description: >-
            Notes is opt-in, and null unless its column was requested. Company
            status

            is opt-in too, and is left off the company cell without it.
          type: string
        plan_consultant:
          $ref: '#/components/schemas/stax_ai_cx_cx-api_pkg_routes_query.Person'
        plan_year:
          type: integer
        pye:
          description: PYE is the plan year end as stored — a MM/DD string, not a date.
          type: string
        questionnaire_completed:
          description: >-
            QuestionnaireCompleted reports whether the plan year's questionnaire
            task

            has been completed by the plan sponsor.
          type: boolean
        status:
          description: >-
            Status is the plan's admin status for the year, "not_started" when
            it has

            never been calculated. CalculatedStatus is what the calculator last

            derived, which differs from Status when someone has overridden it.
          allOf:
            - $ref: '#/components/schemas/legacytypes.PlanAdminStatusEnum'
        status_at:
          type: string
        status_is_override:
          type: boolean
        status_label:
          type: string
        tags:
          type: array
          items:
            type: string
        type:
          type: string
    types.ListFilterDate:
      type: object
      properties:
        after:
          type: string
        before:
          type: string
    types.ListFilterData:
      type: object
      properties:
        key:
          type: string
        op:
          type: string
        value: {}
    legacytypes.PlanAdminStatusEnum:
      type: string
      enum:
        - not_started
        - data_request_sent
        - partial_data_received
        - awaiting_mapping
        - data_received
        - client_review_requested
        - client_review_completed
        - awaiting_asset_data
        - reconciliation_failed
        - in_testing
        - needs_corrections
        - 5500_preparation
        - 5500_signing
        - 5500_filed
        - n/a
      x-enum-varnames:
        - AdminStatusNotStarted
        - AdminStatusDataRequestSent
        - AdminStatusPartialDataReceived
        - AdminStatusAwaitingMapping
        - AdminStatusDataRecieved
        - AdminStatusClientReviewRequested
        - AdminStatusClientReviewCompleted
        - AdminStatusAwaitingAssetData
        - AdminStatusReconciliationFailed
        - AdminStatusInTesting
        - AdminStatusNeedsCorrections
        - AdminStatus5500Preparation
        - AdminStatus5500Signing
        - AdminStatus5500Filed
        - AdminStatusNA
    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
  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.