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

# Batch update participants

> Perform batch operations on participants: insert new employees, update existing employees, update census data, and delete employees. All operations are performed for a specific plan.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /packages/retirement/participants/{plan}/_batch
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/participants/{plan}/_batch:
    post:
      tags:
        - packages
      summary: Batch update participants
      description: >-
        Perform batch operations on participants: insert new employees, update
        existing employees, update census data, and delete employees. All
        operations are performed for a specific plan.
      parameters:
        - description: Plan ID
          name: plan
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/pkg_routes_packages_retirement_participants.BatchUpdateRequest
        description: Batch update request (plan_year required if census provided)
        required: true
      responses:
        '200':
          description: Batch update result
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pkg_routes_packages_retirement_participants.BatchUpdateParticipantsResponse
        '400':
          description: Bad request - invalid plan ID, request body, or plan year
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: Plan not found
          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_participants.BatchUpdateRequest:
      type: object
      properties:
        census:
          description: >-
            List of employee census data to update (must include plan year)

            All employees here MUST exist in the system or in the insert list -
            references to employees are by SSN here, not employee ID
          type: array
          items:
            type: object
            additionalProperties: true
        delete:
          description: List of employee IDs to delete
          type: array
          items:
            type: string
        insert:
          description: List of new employees to add
          type: array
          items:
            type: object
            additionalProperties: true
        plan_year:
          type: integer
        upsert:
          description: List of employees to  update
          type: array
          items:
            type: object
            additionalProperties: true
    pkg_routes_packages_retirement_participants.BatchUpdateParticipantsResponse:
      type: object
      properties:
        ok:
          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.