Skip to content

Submit census sync

client.employers.submitCensusSync(stringemployerID, EmployerSubmitCensusSyncParams { employees } body, RequestOptionsoptions?): EmployerSubmitCensusSyncResponse { data }
POST/v1/employers/{employer_id}/census-sync

Submits a census sync payload for the specified employer. The employees in the payload will be queued for processing. Returns an accepted response with the timestamp of acceptance.

ParametersExpand Collapse
employerID: string

Unique employer identifier (empr_*)

body: EmployerSubmitCensusSyncParams { employees }
employees: Array<Employee>
date_of_birth: string
formatdate
email: string
formatemail
first_name: string
maxLength255
last_name: string
maxLength255
phone: string
address?: Address | null
address_line_1: string
maxLength255
city: string
maxLength255
state: "AL" | "AK" | "AZ" | 59 more
  • AL - AL
  • AK - AK
  • AZ - AZ
  • AR - AR
  • CA - CA
  • CO - CO
  • CT - CT
  • DC - DC
  • DE - DE
  • FL - FL
  • GA - GA
  • HI - HI
  • ID - ID
  • IL - IL
  • IN - IN
  • IA - IA
  • KS - KS
  • KY - KY
  • LA - LA
  • ME - ME
  • MD - MD
  • MA - MA
  • MI - MI
  • MN - MN
  • MS - MS
  • MO - MO
  • MT - MT
  • NE - NE
  • NV - NV
  • NH - NH
  • NJ - NJ
  • NM - NM
  • NY - NY
  • NC - NC
  • ND - ND
  • OH - OH
  • OK - OK
  • OR - OR
  • PA - PA
  • RI - RI
  • SC - SC
  • SD - SD
  • TN - TN
  • TX - TX
  • UT - UT
  • VT - VT
  • VA - VA
  • WA - WA
  • WI - WI
  • WV - WV
  • WY - WY
  • PR - PR
  • GU - GU
  • AS - AS
  • VI - VI
  • MP - MP
  • MH - MH
  • PW - PW
  • FM - FM
  • AE - AE
  • AA - AA
  • AP - AP
One of the following:
"AL"
"AK"
"AZ"
"AR"
"CA"
"CO"
"CT"
"DC"
"DE"
"FL"
"GA"
"HI"
"ID"
"IL"
"IN"
"IA"
"KS"
"KY"
"LA"
"ME"
"MD"
"MA"
"MI"
"MN"
"MS"
"MO"
"MT"
"NE"
"NV"
"NH"
"NJ"
"NM"
"NY"
"NC"
"ND"
"OH"
"OK"
"OR"
"PA"
"RI"
"SC"
"SD"
"TN"
"TX"
"UT"
"VT"
"VA"
"WA"
"WI"
"WV"
"WY"
"PR"
"GU"
"AS"
"VI"
"MP"
"MH"
"PW"
"FM"
"AE"
"AA"
"AP"
zipcode: string
maxLength10
address_line_2?: string | null
maxLength255
compensation_type?: "Salary" | "Hourly" | null
  • Salary - Salary
  • Hourly - Hourly
One of the following:
"Salary"
"Hourly"
employee_class?: EmployeeClass | null
  • Full Time - Full Time
  • Part Time - Part Time
  • Temporary - Temporary
  • Intern - Intern
  • Seasonal - Seasonal
  • Individual Contractor - Individual Contractor
One of the following:
"Full Time"
"Part Time"
"Temporary"
"Intern"
"Seasonal"
"Individual Contractor"
reference_id?: string | null
maxLength255
start_date?: string | null
formatdate
ReturnsExpand Collapse
EmployerSubmitCensusSyncResponse { data }

Response containing a single census sync detail resource.

data: Data { accepted_at, employer_id }
accepted_at: string
formatdate-time
employer_id: string

Submit census sync

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 response = await client.employers.submitCensusSync('empr_abc123def456', {
  employees: [
    {
      reference_id: 'EMP-001',
      first_name: 'Jane',
      last_name: 'Doe',
      date_of_birth: '1990-05-15',
      email: 'jane.doe@acme.com',
      phone: '4155550100',
      address: {
        address_line_1: '123 Main Street',
        address_line_2: 'Apt 4B',
        city: 'San Francisco',
        state: 'CA',
        zipcode: '94102',
      },
      start_date: '2024-01-15',
      employee_class: 'Full Time',
      compensation_type: 'Salary',
    },
    {
      first_name: 'John',
      last_name: 'Smith',
      date_of_birth: '1985-11-20',
      email: 'john.smith@acme.com',
      phone: '4155550101',
      start_date: '2024-03-01',
      employee_class: 'Part Time',
      compensation_type: 'Hourly',
    },
  ],
});

console.log(response.data);
{
  "data": {
    "accepted_at": "2019-12-27T18:11:19.117Z",
    "employer_id": "employer_id"
  }
}
Returns Examples
{
  "data": {
    "accepted_at": "2019-12-27T18:11:19.117Z",
    "employer_id": "employer_id"
  }
}