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

# Import census data

> Import employee and census data for a client, plan, and plan year. Each data row is a map of dot-path field keys (as documented on ImportCensusEmployeeRow) to raw cell strings; the frontend applies the column mapping before posting. Custom data values can be imported with the dynamic keys "employee.fields.<key>" and "census.fields.<key>": imported keys override the stored value for that key on the employee/census record, all other custom field keys are preserved, and values are typed using the team's field definitions (Number -> float, Checkbox -> boolean, Date -> date, otherwise string).



## OpenAPI

````yaml /api-reference/cx/swagger.json post /packages/retirement/formats/_import_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/_import_census:
    post:
      tags:
        - packages
      summary: Import census data
      description: >-
        Import employee and census data for a client, plan, and plan year. Each
        data row is a map of dot-path field keys (as documented on
        ImportCensusEmployeeRow) to raw cell strings; the frontend applies the
        column mapping before posting. Custom data values can be imported with
        the dynamic keys "employee.fields.<key>" and "census.fields.<key>":
        imported keys override the stored value for that key on the
        employee/census record, all other custom field keys are preserved, and
        values are typed using the team's field definitions (Number -> float,
        Checkbox -> boolean, Date -> date, otherwise string).
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/pkg_routes_packages_retirement_formats.ImportCensusRequest
        description: Census import request
        required: true
      responses:
        '200':
          description: Import succeeded
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: >-
            Bad request - invalid body, client, plan, or census validation
            errors (items lists row errors)
          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_formats.ImportCensusRequest:
      type: object
      properties:
        client:
          type: string
        data:
          type: array
          items:
            $ref: >-
              #/components/schemas/pkg_routes_packages_retirement_formats.ImportCensusEmployeeRow
        log:
          type: string
        plan:
          type: string
        py:
          type: integer
        report:
          type: string
    pkg_routes_packages_retirement_formats.ImportCensusEmployeeRow:
      type: object
      properties:
        _401k_catch_up:
          type: string
        _ee_pre_tax_1:
          type: string
        _ee_pre_tax_2:
          type: string
        _ee_pre_tax_3:
          type: string
        _ee_roth_1:
          type: string
        _ee_roth_2:
          type: string
        _ee_roth_3:
          type: string
        _eligible_gross_exclusions:
          type: string
        _er_match_1:
          type: string
        _er_match_2:
          type: string
        _er_match_3:
          type: string
        _er_roth:
          type: string
        _gross_exclusions:
          type: string
        _overtime_hours:
          description: For equations
          type: string
        address.city:
          type: string
        address.country:
          type: string
        address.state:
          type: string
        address.street:
          type: string
        address.unit:
          type: string
        address.zip:
          type: string
        birth_date:
          type: string
        ct_group_code:
          type: string
        email:
          type: string
        employee:
          type: string
        employee_plans_data.vesting_basis.date_basis:
          type: string
        employee_plans_data.vesting_basis.date_basis.er_match:
          type: string
        employee_plans_data.vesting_basis.date_basis.er_non_elective:
          type: string
        employee_plans_data.vesting_basis.date_basis.er_safe_harbor:
          type: string
        employee_plans_data.vesting_basis.pct_basis:
          type: string
        employee_plans_data.vesting_basis.pct_basis.er_match:
          type: string
        employee_plans_data.vesting_basis.pct_basis.er_non_elective:
          type: string
        employee_plans_data.vesting_basis.pct_basis.er_safe_harbor:
          type: string
        employee_plans_data.vesting_basis.yos_basis:
          type: string
        employee_plans_data.vesting_basis.yos_basis.er_match:
          type: string
        employee_plans_data.vesting_basis.yos_basis.er_non_elective:
          type: string
        employee_plans_data.vesting_basis.yos_basis.er_safe_harbor:
          type: string
        employment_category:
          type: string
        employment_type:
          type: string
        ethnicity:
          type: string
        first_name:
          type: string
        full_address:
          type: string
        gender:
          type: string
        group:
          type: string
        hire_date:
          type: string
        is_officer:
          type: string
        last_name:
          type: string
        middle_name:
          type: string
        ownership_percentage:
          type: string
        phone:
          type: string
        plans_data.eligibility_date:
          type: string
        plans_data.eligibility_date.ee:
          type: string
        plans_data.eligibility_date.er_match:
          type: string
        plans_data.eligibility_date.er_non_elective:
          type: string
        plans_data.eligibility_date.er_safe_harbor:
          type: string
        plans_data.eligible_gross_pay:
          type: string
        plans_data.entry_date:
          type: string
        plans_data.entry_date.ee:
          type: string
        plans_data.entry_date.er_match:
          type: string
        plans_data.entry_date.er_non_elective:
          type: string
        plans_data.entry_date.er_safe_harbor:
          type: string
        plans_data.plan_compensation:
          type: string
        plans_data.plan_compensation.ee:
          type: string
        plans_data.plan_compensation.er_match:
          type: string
        plans_data.plan_compensation.er_non_elective:
          type: string
        plans_data.plan_compensation.er_safe_harbor:
          type: string
        plans_data.transactions.ee_pre_tax:
          type: string
        plans_data.transactions.ee_roth:
          type: string
        plans_data.transactions.er_match:
          type: string
        plans_data.transactions.er_non_elective:
          type: string
        plans_data.transactions.er_qaca_match:
          type: string
        plans_data.transactions.er_safe_harbor_match:
          type: string
        plans_data.transactions.er_safe_harbor_non_elective:
          type: string
        plans_data.transactions.gross_minus_exclusions:
          type: string
        plans_data.transactions.gross_pay:
          type: string
        plans_data.transactions.hours_worked:
          type: string
        plans_data.transactions.hpi_compensation:
          type: string
        plans_data.transactions.new_compensation_group:
          type: string
        plans_data.transactions.prevailing_wage:
          type: string
        plans_data.transactions.statutory_compensation:
          type: string
        preferred_name:
          type: string
        principal:
          type: string
        rehire_date:
          type: string
        relationship:
          type: string
        ssn:
          type: string
        termination_date:
          type: string
        termination_reason:
          type: string
        title:
          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.