> ## 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.

# Export census data

> Export employee census data for a specific client, plan, and plan year in FTWilliam, Datair, Standard, Legacy, or Custom format. Optionally show zero compensation employees. Custom exports take a format_id referencing a saved custom census export format and render xlsx or csv per that format's file_type. The Standard (XLSX) format is a professionally styled workbook (highlighted wrapped headers with an auto-filter, cell borders, freeze panes, and error highlights with the error details attached as cell comments); the Legacy (XLSX) format is the previous unstyled Standard output. Both append custom data columns after the fixed columns when default employee/census views exist for the plan's type (views with on_type employee/employee_census and default_for {"plan_type": ...}); the columns are grouped under merged "Custom Employee Data" and "Custom Census Data" headers on the row above, and values are rendered like report exports (nil -> "-", bool -> Yes/No, dates -> MM/DD/YYYY).



## OpenAPI

````yaml /api-reference/cx/swagger.json post /packages/retirement/formats/_export_census
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/formats/_export_census:
    post:
      tags:
        - packages
      summary: Export census data
      description: >-
        Export employee census data for a specific client, plan, and plan year
        in FTWilliam, Datair, Standard, Legacy, or Custom format. Optionally
        show zero compensation employees. Custom exports take a format_id
        referencing a saved custom census export format and render xlsx or csv
        per that format's file_type. The Standard (XLSX) format is a
        professionally styled workbook (highlighted wrapped headers with an
        auto-filter, cell borders, freeze panes, and error highlights with the
        error details attached as cell comments); the Legacy (XLSX) format is
        the previous unstyled Standard output. Both append custom data columns
        after the fixed columns when default employee/census views exist for the
        plan's type (views with on_type employee/employee_census and default_for
        {"plan_type": ...}); the columns are grouped under merged "Custom
        Employee Data" and "Custom Census Data" headers on the row above, and
        values are rendered like report exports (nil -> "-", bool -> Yes/No,
        dates -> MM/DD/YYYY).
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/pkg_routes_packages_retirement_formats.ExportCensusRequest
        description: >-
          Export census request with client, plan, plan year, format
          (ftwilliam/datair/standard/legacy/custom), format_id (required when
          format is custom), and optional flags
        required: true
      responses:
        '200':
          description: CSV file with census data
          content:
            text/csv:
              schema:
                type: string
                format: binary
        '400':
          description: >-
            Bad request - invalid request body, plan not found, integration not
            found, or unsupported format
          content:
            text/csv:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            text/csv:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_packages_retirement_formats.ExportCensusRequest:
      type: object
      properties:
        client:
          type: string
        format:
          type: string
        format_id:
          type: string
        plan:
          type: string
        py:
          type: integer
        show_zero_comp:
          type: boolean
        upload_to_provider:
          type: boolean
  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.