Update employee
client.employees.update(stringemployeeID, EmployeeUpdateParams { effective_date, address, compensation_type, 5 more } body, RequestOptionsoptions?): EmployeeUpdateResponse { data }
PATCH/v1/employees/{employee_id}
Updates employee personal, contact, address, and employment fields. This endpoint currently supports email, phone, gender, address, employee_class, start_date, and compensation_type. effective_date is required and applies to employee_class and compensation_type when those fields are included in the request.
Update employee
import VitableConnect from '@vitable-inc/vitable-connect';
const client = new VitableConnect({
apiKey: process.env['VITABLE_CONNECT_API_KEY'], // This is the default and can be omitted
});
const employee = await client.employees.update('empl_abc123def456', {
effective_date: '2023-03-01',
compensation_type: 'Salary',
employee_class: 'Full Time',
start_date: '2023-01-15',
});
console.log(employee.data);{
"data": {
"id": "id",
"classification_effective_date": "2019-12-27",
"compensation_type": "Salary",
"compensation_type_effective_date": "2019-12-27",
"created_at": "2019-12-27T18:11:19.117Z",
"date_of_birth": "2019-12-27",
"deductions": [
{
"benefit_name": "benefit_name",
"deduction_amount_in_cents": 0,
"deduction_category": "deduction_category",
"frequency": "weekly",
"period_end_date": "2019-12-27",
"period_start_date": "2019-12-27",
"tax_classification": "Unknown"
}
],
"email": "dev@stainless.com",
"employee_class": "Full Time",
"employer_id": "employer_id",
"first_name": "first_name",
"last_name": "last_name",
"member_id": "member_id",
"phone": "phone",
"start_date": "2019-12-27",
"status": "active",
"updated_at": "2019-12-27T18:11:19.117Z",
"address": {
"address_line_1": "address_line_1",
"city": "city",
"state": "state",
"zipcode": "zipcode",
"address_line_2": "address_line_2"
},
"employer_name": "employer_name",
"gender": "gender",
"reference_id": "reference_id",
"suffix": "suffix",
"termination_date": "2019-12-27"
}
}Returns Examples
{
"data": {
"id": "id",
"classification_effective_date": "2019-12-27",
"compensation_type": "Salary",
"compensation_type_effective_date": "2019-12-27",
"created_at": "2019-12-27T18:11:19.117Z",
"date_of_birth": "2019-12-27",
"deductions": [
{
"benefit_name": "benefit_name",
"deduction_amount_in_cents": 0,
"deduction_category": "deduction_category",
"frequency": "weekly",
"period_end_date": "2019-12-27",
"period_start_date": "2019-12-27",
"tax_classification": "Unknown"
}
],
"email": "dev@stainless.com",
"employee_class": "Full Time",
"employer_id": "employer_id",
"first_name": "first_name",
"last_name": "last_name",
"member_id": "member_id",
"phone": "phone",
"start_date": "2019-12-27",
"status": "active",
"updated_at": "2019-12-27T18:11:19.117Z",
"address": {
"address_line_1": "address_line_1",
"city": "city",
"state": "state",
"zipcode": "zipcode",
"address_line_2": "address_line_2"
},
"employer_name": "employer_name",
"gender": "gender",
"reference_id": "reference_id",
"suffix": "suffix",
"termination_date": "2019-12-27"
}
}