Assign Employee to a Group
This guide walks you through assigning an existing employee to a benefit group. This is the step that makes an employee eligible to join a group policy and, depending on your configuration, can also start the employee enrolment flow.
Before starting, ensure you’ve completed:
- Authentication: API key setup and idempotency
- Employer and employee management: syncing employers and employees
- Employer Health Insurance Setup: creating or retrieving the target group
The employee must belong to the same employer as the group.
Overview
A group represents the benefit the employee can join. For health insurance, the group usually maps to one selected plan or a bundle of benefits that must be managed together. Adding an employee to the group creates the employee’s membership in that benefit group.
If the group already has an active group policy, Kota can also create an enrolment intent for the employee. The enrolment intent handles the employee-facing part of the journey: eligibility checks, required information, disclosures, confirmation, and policy issuance.
For API-only integrations, decide explicitly whether adding the employee should create
enrolment intents. The create_enrolment_intents default differs by integration type:
it defaults to true for hosted integrations and false for non-hosted integrations.
Step 1: Check eligibility before assignment
First, choose the group that represents the benefit the employee should receive. The group should belong to the same employer as the employee.
For most health insurance flows, the group comes from one of these paths:
- Standard setup: you created the group while building the employer benefit flow, then activated a group policy for it.
- Pre-created setup: Kota created the groups and policies for you, and your platform retrieves the available groups before assigning employees.
- Migration: Kota created groups during migration, and your platform maps employees to the correct migrated group.
Archived groups cannot accept new employees. If the group has no group policy yet, the employee can be added, but no enrolment intent is created until a policy exists.
Before adding the employee, call the eligibility pre-check endpoint. This is a dry run: it checks whether the employee qualifies for the group without adding them to the group, creating an enrolment intent, or enrolling them.
Endpoint: POST /groups/{group_id}/eligibility_check
Request body:
Response:
If eligibility_status is ineligible, do not add the employee to the group yet. Show
the human-readable reasons[].message, resolve the underlying employee or group data,
then run the pre-check again.
If you add an ineligible employee to the group and ask Kota to create enrolment intents,
the intent may still be created and then move to ineligible. Prefer resolving
eligibility first so the employee does not enter a flow they cannot complete.
Step 2: Add the employee to the group
Call POST /groups/{group_id}/employees with the employee ID. Send an
Idempotency-Key so retries do not create duplicate work.
Endpoint: POST /groups/{group_id}/employees
Request body:
Use policy_configuration only when this employee should differ from the group defaults:
If your product separates group assignment from employee opt-in, which is recommended, set
create_enrolment_intents to false and create the enrolment intent later, when the
employee starts the flow.
Step 3: Handle the response
The response represents the employee’s membership in the group.
Use these fields to decide what to show next:
If the API returns an error, check that:
- the group exists and is not archived;
- the employee exists and belongs to the same employer as the group;
- the employee is not already assigned to the group;
- the request body uses the correct identifiers.
Step 4: Track assignment and eligibility
Kota emits webhooks as group assignment and eligibility change:
When you receive one of these events, fetch the group employee record to reconcile your state:
Endpoint: GET /groups/{group_id}/employees
Eligibility can change as employee data, provider rules, or group setup changes. Store
the group assignment separately from enrolment completion, and keep your UI driven by the
latest eligibility_status, enrolments, and policies values.
Step 5: Start employee enrolment
What happens next depends on whether an enrolment intent was created.
Best practices
- Use idempotency. Always send an
Idempotency-Keywhen adding an employee to a group. - Pre-check eligibility first. Use
POST /groups/{group_id}/eligibility_checkbefore assignment so you can show ineligibility reasons without adding the employee to the group. - Separate assignment from enrolment. Adding an employee to a group makes them part of the benefit group; it does not always mean the employee has completed enrolment.
- React to webhooks. Use
group.employee.added,group.employee.eligible, and enrolment-intent events to drive your UI instead of assuming work is complete immediately after thePOST. - Store the returned IDs. Persist the
group_id,employee_id, and any returned enrolment intent IDs so you can reconcile later.
Next steps
- Employee Enrolment: complete the employee-facing enrolment flow
- Webhooks and events: receive assignment and enrolment updates
- API Errors: handle validation and not-found responses

