Census Sync
Census sync replaces an employer’s entire employee roster. When you submit a new sync, the system matches existing employees using reference_id and other available information. Employees included in the payload are created or updated; employees omitted are deactivated. This is not an append operation.
You send a single POST /v1/employers/{id}/census-sync request containing up to 5,000 employees, and Vitable processes them asynchronously. The response is an acceptance receipt — not the final result. You track outcomes through webhooks and the GET /v1/employers/{id}/employees endpoint.
This guide covers the request format, the async processing model, how to verify results, and what to do when things go wrong.
Quick Reference
Per-Employee Fields
Validation Rules
Understanding the Async Flow
Census sync is fully asynchronous. When you submit a request, Vitable validates the payload structure and immediately returns an acceptance receipt. The actual employee creation and eligibility evaluation happen in the background.
Flow summary:
- You submit a
POST /v1/employers/{id}/census-syncrequest with an array of employees. - Vitable responds with
202and an acceptance receipt containingaccepted_atandemployer_id. - Vitable processes each employee asynchronously — creating records and evaluating eligibility.
- For each employee that becomes benefits-eligible, Vitable delivers an
employee.eligibility_grantedwebhook. - You verify the final state by calling
GET /v1/employers/{id}/employees.
The 202 response confirms Vitable accepted your request for processing. It does not mean employees have been created yet. Always use webhooks or the list employees endpoint to confirm outcomes.
There is no sync-completion webhook. There is no single event that signals the entire census sync is done. Listen for individual employee.eligibility_granted events to track processing progress.
Submitting a Census Sync
Send a POST /v1/employers/{id}/census-sync request with an employees array:
A successful response looks like this:
The accepted_at timestamp marks when Vitable acknowledged the request. Store this alongside the employer_id so you can correlate it with incoming webhooks.
Employee Matching and Processing
The system matches employees using reference_id and other available information to preserve existing records and enrollment history across syncs. Matched employees are updated with the new data; unmatched entries create new employee records.
Previously deactivated employees are reactivated if they reappear in a subsequent sync.
Required fields per employee: first_name, last_name, date_of_birth, email, phone
Optional fields: reference_id, address, start_date, employee_class, compensation_type
Monitoring Progress
After submitting a census sync, you have two ways to track what happened: webhooks and the list employees endpoint.
Receiving Webhooks
As Vitable processes each employee, it evaluates their benefits eligibility. When an employee becomes benefits-eligible, you receive an employee.eligibility_granted webhook:
Use the resource_id to fetch the employee’s full record via GET /v1/employees/{id}.
The employee.eligibility_granted event signals that an employee is now eligible for benefits and their enrollment window is open. For the full employee status model and related events, see the Employee Lifecycle guide.
Verifying via the List Employees Endpoint
You can also poll GET /v1/employers/{id}/employees to see which employees have been created. This endpoint returns a paginated list:
The response includes pagination metadata:
Compare pagination.total against the number of employees you submitted to confirm all records were created.
Walking Through the Happy Path
This diagram shows the complete sequence for a successful census sync, from submission through employee verification.
Step-by-step:
- You send a census sync with N employees.
- Vitable returns the acceptance receipt immediately.
- For each processed employee who becomes benefits-eligible, Vitable delivers an
employee.eligibility_grantedwebhook. - You call the list employees endpoint to confirm all N records exist.
Handling Errors and Partial Failures
Not every census sync succeeds cleanly. The following flowchart shows how validation and processing errors surface.
Summary:
- If the payload structure is invalid (e.g., missing required fields, exceeding 5,000 employees), you receive a
400error immediately — no processing occurs. - If the payload is accepted, individual employees may still fail during async processing (e.g., a duplicate
reference_idmatching an existing employee). Successfully processed employees are created; failed ones are skipped. - You will only receive
employee.eligibility_grantedwebhooks for employees that were successfully created and evaluated as eligible.
Troubleshooting
Exceeding the batch limit
Each census sync request accepts a maximum of 5,000 employees. If your payload exceeds this limit, the entire request is rejected with a 400 error. Split larger datasets into multiple requests.
Duplicate reference_id values within a payload
Every reference_id in a single request must be unique. If you include the same reference_id twice, the request fails validation. Deduplicate your data before submitting.
Invalid phone numbers
The phone field must be a 10-digit US phone number (digits only, no dashes or spaces). Values like 555-123-4567 or +15551234567 are rejected. Send 5551234567 instead.
Invalid state codes
The state field must be a valid US state or territory code (e.g., TX, CA, PR). Full state names like Texas are not accepted.
Partial failures
When some employees in a batch are valid and others are not, Vitable processes the valid ones and skips the invalid ones. You will not receive an explicit error notification for skipped employees. To detect partial failures, compare the pagination.total from GET /v1/employers/{id}/employees against the number of employees you submitted. If the count is lower than expected, review your source data for the issues described above and resubmit the corrected records.
There is no webhook for failed employee records in a census sync. The only way to detect partial failures is to compare the expected employee count against the actual count returned by the list employees endpoint.
Related Webhooks
The employee.eligibility_granted event is the primary signal that census sync processing completed for a given employee. For the full set of employee-related events — including employee.eligibility_terminated and employee.deactivated — see the Employee Lifecycle guide.
Related API Endpoints
POST /v1/employers/{id}/census-sync— Submit employee data for async processingGET /v1/employers/{id}/employees— List employees for an employer (paginated)GET /v1/employees/{id}— Retrieve a single employee recordGET /v1/webhook-events— Query webhook events for troubleshootingGET /v1/webhook-events/{event_id}/deliveries— Check delivery status for a specific event

