Skip to content
Get started

Create eligibility policy

client.employers.createEligibilityPolicy(stringemployerID, EmployerCreateEligibilityPolicyParams { effective_date, name, rules, 2 more } params, RequestOptionsoptions?): BenefitEligibilityPolicy { id, active, created_at, 7 more }
post/v1/employers/{employer_id}/benefit-eligibility-policy

Creates a new benefit eligibility policy for a specific employer. Eligibility policies define rules that determine which employees qualify for benefits based on criteria such as employment status (full-time, part-time), hours worked per week, waiting periods after hire date, or other custom requirements. Optionally provide 'policy_to_replace_id' as a query parameter to replace an existing policy.

ParametersExpand Collapse
employerID: string
params: EmployerCreateEligibilityPolicyParams { effective_date, name, rules, 2 more }
effective_date: string

Body param: Date when policy becomes effective

formatdate
name: string

Body param: Display name for the policy

maxLength255
minLength1
rules: Array<Rule>

Body param: List of eligibility rules (at least one required)

operator: string

Comparison operator

rule_type: string

Type of eligibility rule

value: string

Value to compare against (can be string, number, boolean, or list)

policy_to_replace_id?: string

Query param: ID of existing policy to replace (epol_*)

description?: string | null

Body param: Detailed description

ReturnsExpand Collapse
BenefitEligibilityPolicy { id, active, created_at, 7 more }

Serializer for Benefit Eligibility Policy entity.

Eligibility policies define rules that determine which employees qualify for benefits.

id: string

Unique eligibility policy identifier with 'epol_' prefix

active: boolean

Whether this policy is currently active

created_at: string

Timestamp when the policy was created

formatdate-time
effective_date: string

Date when this policy becomes effective

formatdate
employer_id: string

ID of the employer this policy belongs to (empr_*)

name: string

Display name for the eligibility policy

rules: Array<Rule>

List of eligibility rules that must be satisfied

operator: string

Comparison operator (e.g., 'equals', 'greater_than', 'in')

rule_type: string

Type of eligibility rule (e.g., 'employment_status', 'hours_per_week', 'waiting_period')

value: unknown

Value to compare against (type depends on rule_type)

updated_at: string

Timestamp when the policy was last updated

formatdate-time
description?: string | null

Detailed description of the policy

replaced_policy_id?: string | null

ID of the policy this one replaces, if any (epol_*)

Create eligibility policy
import VitableConnectAPI from 'vitable-connect-api';

const client = new VitableConnectAPI({
  apiKey: 'My API Key',
});

const benefitEligibilityPolicy = await client.employers.createEligibilityPolicy('empr_abc123def456', {
  effective_date: '2019-12-27',
  name: 'x',
  rules: [{ operator: 'operator', rule_type: 'rule_type', value: 'value' }],
});

console.log(benefitEligibilityPolicy.id);
{
  "id": "id",
  "active": true,
  "created_at": "2019-12-27T18:11:19.117Z",
  "effective_date": "2019-12-27",
  "employer_id": "employer_id",
  "name": "name",
  "rules": [
    {
      "operator": "operator",
      "rule_type": "rule_type",
      "value": {}
    }
  ],
  "updated_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "replaced_policy_id": "replaced_policy_id"
}
Returns Examples
{
  "id": "id",
  "active": true,
  "created_at": "2019-12-27T18:11:19.117Z",
  "effective_date": "2019-12-27",
  "employer_id": "employer_id",
  "name": "name",
  "rules": [
    {
      "operator": "operator",
      "rule_type": "rule_type",
      "value": {}
    }
  ],
  "updated_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "replaced_policy_id": "replaced_policy_id"
}