> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getprescience.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit census members

> Adds, updates and removes census members without sending the whole census. Members in `members` are matched like a census replace (`external_id`, else `email`): a match is updated, anything else is added. Members in `remove` are named by `member_id`, `external_id` or `email`. Valid rows are applied even when other rows fail (`errors`, by index). No quote is run or deleted: quotes made for the old census are kept but no longer match the census, and the next quote request prices the new one. Returns `409 conflict` for an enrolled group (edit members with `PATCH /groups/{groupId}/members/{memberId}`). Rate limit: 20 census writes per minute. Field names are snake_case for broker keys. HR platform partners use camelCase (`company_name` is `companyName`).



## OpenAPI

````yaml /api-reference/openapi.json put /groups/{groupId}/census/members
openapi: 3.1.0
info:
  title: Prescience Partner API
  version: 1.1.0
  description: >-
    Create employer groups, submit census records, generate preliminary
    market-rate quotes, create iframe sessions, create enrollments, and read
    aggregate account data.


    Money is always integer cents. Dates are `YYYY-MM-DD`; timestamps are ISO
    8601 UTC. Final pricing, eligibility, network availability, and plan
    documents are confirmed during underwriting and onboarding. A BAA and data
    processing agreement are executed before live mode is enabled.


    Field names: broker keys send and receive snake_case (camelCase requests are
    still accepted). HR platform partners use camelCase. Where an operation
    serves both, the broker schema comes first and the camelCase one second.
  contact:
    name: Prescience partner engineering
    email: partners@getprescience.com
servers:
  - url: https://www.getprescience.com/api/partner/v1
    description: >-
      Production. Test and live traffic share this host; mode comes from your
      API key.
security:
  - bearerAuth: []
tags:
  - name: Health
    description: Connectivity and key checks.
  - name: Plans
    description: Static plan metadata.
  - name: Groups
    description: 'Employer groups: the root resource of every integration.'
  - name: Census
    description: Pre-enrollment census intake and ongoing member sync.
  - name: Quotes
    description: >-
      Preliminary quotes built from the stored census and current local
      market-plan snapshot.
  - name: Enrollments
    description: Plan selection and employer provisioning.
  - name: Account
    description: Aggregate, de-identified employer account data.
  - name: Brokers
    description: >-
      Quoting for brokers, the MCP server, and elections for partner-run
      enrollment.
  - name: Webhooks
    description: Signed event delivery (standard-webhooks scheme).
paths:
  /groups/{groupId}/census/members:
    put:
      tags:
        - Census
      summary: Edit census members
      description: >-
        Adds, updates and removes census members without sending the whole
        census. Members in `members` are matched like a census replace
        (`external_id`, else `email`): a match is updated, anything else is
        added. Members in `remove` are named by `member_id`, `external_id` or
        `email`. Valid rows are applied even when other rows fail (`errors`, by
        index). No quote is run or deleted: quotes made for the old census are
        kept but no longer match the census, and the next quote request prices
        the new one. Returns `409 conflict` for an enrolled group (edit members
        with `PATCH /groups/{groupId}/members/{memberId}`). Rate limit: 20
        census writes per minute. Field names are snake_case for broker keys. HR
        platform partners use camelCase (`company_name` is `companyName`).
      operationId: editCensus
      parameters:
        - $ref: '#/components/parameters/GroupId'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/BrokerCensusEditRequest'
                - $ref: '#/components/schemas/CensusEditRequest'
            examples:
              broker:
                summary: Broker key
                value:
                  members:
                    - external_id: emp_0012
                      first_name: Sam
                      last_name: Ortiz
                      email: sam@acme.com
                      dob: '1988-11-20'
                      zip: '94110'
                  remove:
                    - external_id: emp_0003
              hr_platform:
                summary: HR platform key
                value:
                  members:
                    - externalId: emp_0012
                      firstName: Sam
                      lastName: Ortiz
                      email: sam@acme.com
                      dob: '1988-11-20'
                      zip: '94110'
                  remove:
                    - externalId: emp_0003
      responses:
        '200':
          description: Edit applied.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/BrokerCensusEditResult'
                  - $ref: '#/components/schemas/CensusEditResult'
              examples:
                broker:
                  summary: Broker key
                  value:
                    group_id: grp_8c2f41d09a3e
                    received: 1
                    accepted: 1
                    member_count: 12
                    errors: []
                    warnings: []
                    removed: 1
                    not_found: []
                hr_platform:
                  summary: HR platform key
                  value:
                    groupId: grp_8c2f41d09a3e
                    received: 1
                    accepted: 1
                    memberCount: 12
                    errors: []
                    warnings: []
                    removed: 1
                    notFound: []
        '400':
          description: Nothing to change, or a malformed `members` or `remove`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The group is enrolled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    GroupId:
      name: groupId
      in: path
      required: true
      description: Group ID, e.g. `grp_8c2f41d09a3e`.
      schema:
        type: string
        pattern: ^grp_[0-9a-f]{12}$
      example: grp_8c2f41d09a3e
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Any non-empty string; deterministic keys from your own IDs work best.
        Repeating the same key with the same body on the same endpoint and mode
        within 24 hours returns the stored successful response (with
        `Idempotent-Replay: true`) instead of re-executing. Error responses are
        not stored.
      schema:
        type: string
      example: 9f3b2c61-4a8d-4e2f-b1c7-d5a90e8f1a23
  schemas:
    BrokerCensusEditRequest:
      type: object
      description: Send `members`, `remove` or both.
      properties:
        members:
          type: array
          description: >-
            Members to add, or to update when one with the same `external_id`
            (else `email`) is on file. Same shape as in the full census.
          items:
            $ref: '#/components/schemas/BrokerCensusMemberInput'
        remove:
          type: array
          description: Members to remove, each by `member_id`, `external_id` or `email`.
          items:
            type: object
            properties:
              member_id:
                type: string
              external_id:
                type: string
              email:
                type: string
    CensusEditRequest:
      type: object
      description: Send `members`, `remove` or both.
      properties:
        members:
          type: array
          description: >-
            Members to add, or to update when one with the same `externalId`
            (else `email`) is on file. Same shape as in the full census.
          items:
            $ref: '#/components/schemas/CensusMemberInput'
        remove:
          type: array
          description: Members to remove, each by `memberId`, `externalId` or `email`.
          items:
            type: object
            properties:
              memberId:
                type: string
              externalId:
                type: string
              email:
                type: string
    BrokerCensusEditResult:
      allOf:
        - $ref: '#/components/schemas/BrokerCensusReplaceResult'
        - type: object
          required:
            - removed
            - not_found
          properties:
            removed:
              type: integer
              description: Members removed.
            not_found:
              type: array
              description: Positions in `remove` that matched no member.
              items:
                type: integer
    CensusEditResult:
      allOf:
        - $ref: '#/components/schemas/CensusReplaceResult'
        - type: object
          required:
            - removed
            - notFound
          properties:
            removed:
              type: integer
              description: Members removed.
            notFound:
              type: array
              description: Positions in `remove` that matched no member.
              items:
                type: integer
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          enum:
            - invalid_request
            - unauthorized
            - live_mode_disabled
            - forbidden
            - not_found
            - conflict
            - rates_pending
            - quote_expired
            - market_unavailable
            - census_required
            - rate_limited
            - server_error
            - not_configured
            - email_not_allowed
            - verification_failed
          description: >-
            Stable machine-readable error code. `email_not_allowed` and
            `verification_failed` come only from the iframe's own endpoints,
            which partners do not call.
        message:
          type: string
          description: >-
            Human-readable explanation. Wording may change; branch on `error`,
            not `message`.
        details:
          type: array
          description: Present on `invalid_request`. One entry per failed field.
          items:
            type: object
            required:
              - field
              - message
            properties:
              field:
                type: string
                example: zip
              message:
                type: string
                example: zip must be a 5-digit ZIP code
              index:
                type: integer
                description: >-
                  For array payloads (census rows), the zero-based index of the
                  failing row.
                example: 7
    BrokerCensusMemberInput:
      type: object
      required:
        - zip
      anyOf:
        - required:
            - dob
        - required:
            - age
      description: >-
        One employee record. Include dependent elections when your platform has
        them; submitted dependents drive covered lives and household tiers. When
        they are unavailable, Prescience uses a disclosed normalized small-group
        household mix for the preliminary model.
      properties:
        external_id:
          type: string
          description: >-
            Your payroll's employee ID (Check `Employee.id`). Required at
            enrollment; the upsert key, and how payroll results find the
            employee.
          example: emp_0001
        first_name:
          type: string
          example: Jordan
        last_name:
          type: string
          example: Reyes
        email:
          type: string
          format: email
          description: Upsert key when present.
          example: jordan@acme.com
        dob:
          type: string
          format: date
          description: >-
            Required for every employee and dependent of a broker; a broker's
            member sent with only an `age` is rejected.
          example: '1992-03-14'
        age:
          type: integer
          description: Alternative to `dob`. One of the two is required.
          example: 34
        zip:
          type: string
          pattern: ^[0-9]{5}$
          description: 5-digit home ZIP. Drives local market selection and rating.
          example: '94110'
        sex_at_birth:
          type: string
          enum:
            - male
            - female
            - other
        employment_type:
          type: string
          enum:
            - full_time
            - part_time
            - contractor
        hire_date:
          type: string
          format: date
          example: '2024-03-01'
        status:
          type: string
          enum:
            - active
            - terminated
          default: active
        dependents:
          type: array
          maxItems: 6
          description: Optional household members already known to your platform.
          items:
            type: object
            required:
              - relationship
            properties:
              relationship:
                type: string
                enum:
                  - spouse
                  - domestic_partner
                  - child
                  - other
              name:
                type: string
                maxLength: 120
              dob:
                type: string
                format: date
    CensusMemberInput:
      type: object
      required:
        - zip
      anyOf:
        - required:
            - dob
        - required:
            - age
      description: >-
        One employee record. Include dependent elections when your platform has
        them; submitted dependents drive covered lives and household tiers. When
        they are unavailable, Prescience uses a disclosed normalized small-group
        household mix for the preliminary model.
      properties:
        externalId:
          type: string
          description: >-
            Your payroll's employee ID (Check `Employee.id`). Required at
            enrollment; the upsert key, and how payroll results find the
            employee.
          example: emp_0001
        firstName:
          type: string
          example: Jordan
        lastName:
          type: string
          example: Reyes
        email:
          type: string
          format: email
          description: Upsert key when present.
          example: jordan@acme.com
        dob:
          type: string
          format: date
          description: >-
            Required for every employee and dependent of a broker; a broker's
            member sent with only an `age` is rejected.
          example: '1992-03-14'
        age:
          type: integer
          description: Alternative to `dob`. One of the two is required.
          example: 34
        zip:
          type: string
          pattern: ^[0-9]{5}$
          description: 5-digit home ZIP. Drives local market selection and rating.
          example: '94110'
        sexAtBirth:
          type: string
          enum:
            - male
            - female
            - other
        employmentType:
          type: string
          enum:
            - full_time
            - part_time
            - contractor
        hireDate:
          type: string
          format: date
          example: '2024-03-01'
        status:
          type: string
          enum:
            - active
            - terminated
          default: active
        dependents:
          type: array
          maxItems: 6
          description: Optional household members already known to your platform.
          items:
            type: object
            required:
              - relationship
            properties:
              relationship:
                type: string
                enum:
                  - spouse
                  - domestic_partner
                  - child
                  - other
              name:
                type: string
                maxLength: 120
              dob:
                type: string
                format: date
    BrokerCensusReplaceResult:
      type: object
      required:
        - group_id
        - received
        - accepted
        - member_count
        - errors
        - warnings
      properties:
        group_id:
          type: string
          example: grp_8c2f41d09a3e
        received:
          type: integer
          description: Rows in the request.
          example: 12
        accepted:
          type: integer
          description: Rows stored.
          example: 12
        member_count:
          type: integer
          description: Members on file after the replace.
          example: 12
        errors:
          type: array
          description: >-
            Per-row rejections. The row at `index` was not stored; everything
            else was.
          items:
            type: object
            required:
              - index
              - field
              - message
            properties:
              index:
                type: integer
                example: 7
              field:
                type: string
                example: zip
              message:
                type: string
                example: zip must be a 5-digit ZIP code
        warnings:
          type: array
          items:
            type: string
          description: >-
            Non-blocking issues, e.g. members missing email (required before
            enrollment, not for quoting).
    CensusReplaceResult:
      type: object
      required:
        - groupId
        - received
        - accepted
        - memberCount
        - errors
        - warnings
      properties:
        groupId:
          type: string
          example: grp_8c2f41d09a3e
        received:
          type: integer
          description: Rows in the request.
          example: 12
        accepted:
          type: integer
          description: Rows stored.
          example: 12
        memberCount:
          type: integer
          description: Members on file after the replace.
          example: 12
        errors:
          type: array
          description: >-
            Per-row rejections. The row at `index` was not stored; everything
            else was.
          items:
            type: object
            required:
              - index
              - field
              - message
            properties:
              index:
                type: integer
                example: 7
              field:
                type: string
                example: zip
              message:
                type: string
                example: zip must be a 5-digit ZIP code
        warnings:
          type: array
          items:
            type: string
          description: >-
            Non-blocking issues, e.g. members missing email (required before
            enrollment, not for quoting).
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Partner API key. `psk_test_<32 hex>` for test mode, `psk_live_<32 hex>`
        for live mode. Store them in your secrets manager on issue. Live keys
        are shown once; the scoped partner portal can show an active sandbox key
        again.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.