Bulk Operations

Several create endpoints have a corresponding bulk version at {resource}_bulk. A bulk endpoint takes a JSON array of the same object type its single-create counterpart takes, and creates each one independently — a failure on one item does not block the others in the same request. See Bulk Create Employees below for a fully worked example, including the request and response shapes.

This section tracks which resources have a documented bulk endpoint. Add a row here whenever a new one is confirmed.

ResourceSingle-create endpointBulk endpoint
EmployeesPOST /wep/companies/{CLIENT_ID}/employeesPOST /wep/companies/{CLIENT_ID}/employees_bulk
DivisionsPOST /wep/companies/{companyId}/divisionsPOST /wep/companies/{companyId}/divisions_bulk

Notes

  • The response shape confirmed so far (each array entry as { data: <object> } on success or { errorCode, errorMessage } on failure, matched to the request by array index) is specific to employees_bulk. Don't assume other _bulk endpoints return the same shape until it's confirmed for each one.

Bulk Create Employees

Creates multiple employee records under a company in a single request. Use this instead of Create an Employee when you're importing or onboarding several employees at once.

Endpoint

POST https://api.worklio.com/wep/companies/{CLIENT_ID}/employees_bulk

Requires a bearer access token (see How to Get API Access). CLIENT_ID is the company identifier returned as id when you create the company.

Request body

The request body is a single JSON array of employee objects. Each object takes the same fields as Create an Employee:

FieldTypeRequiredDescription
firstNamestringRequiredEmployee's first name
lastNamestringRequiredEmployee's last name
ssnstringRequiredSocial Security Number, with or without dashes
birthDatestring (ISO date)RequiredDate of birth
employeeTypeintegerRequired0 = Employee, 1 = Contractor

Employees in the batch are processed independently: a failure on one employee does not block the others from being created.

Example request

require("dotenv").config();

const TOKEN = process.env.API_KEY;
const CLIENT_ID = process.env.CLIENT_ID;
const url = `https://api.worklio.com/wep/companies/${CLIENT_ID}/employees_bulk`;

const payload = [
  {
    firstName: 'Michael',
    lastName: 'Brown',
    employeeType: 0,
    ssn: '111-11-4084',
    birthDate: '1990-07-14T00:00:00.000Z',
  },
  {
    firstName: 'Sarah',
    lastName: 'Nguyen',
    employeeType: 0,
    ssn: '122-22-2281',
    birthDate: '1988-02-23T00:00:00.000Z',
  }
];

async function createEmployeesBulk() {
  const response = await fetch(url, {
    method: "POST",
    headers: {
      accept: "application/json",
      "api-version": "2.0",
      authorization: `Bearer ${TOKEN}`,
      "content-type": "application/json",
      "x-api-version": "2.0"
    },
    body: JSON.stringify(payload)
  });

  console.log(response.status);
  console.log(await response.text());
}

createEmployeesBulk();

Example response

The response is an array in the same order as the request. Each entry is either { data: <employee> } on success, or { errorCode, errorMessage } on failure for that employee.

[
  {
    "errorCode": "UnknownError",
    "errorMessage": "Employee with the same SSN/FEIN already has an active employment with the current client."
  },
  {
    "data": {
      "id": 4301,
      "firstName": "Sarah",
      "lastName": "Nguyen",
      "employeeType": 0,
      "ssnMasked": "***-**-2281",
      "ssn": "122-22-2281",
      "birthDate": "1988-02-23",
      "payAllocation": [
        {
          "id": 0,
          "order": 1,
          "payMethod": 1,
          "allocatedBy": 2,
          "amount": 100
        }
      ],
      "isAdmin": false,
      "employeeUI_ID": 7,
      "country": "US",
      "citizenshipCountry": "US",
      "citizenship": 1,
      "w2Info": {
        "electronicOnly": false,
        "firstName": "Sarah",
        "lastName": "Nguyen"
      },
      "hrKeyDates": {
        "liabilityStart": "2026-09-08",
        "originalHire": "2026-09-08"
      }
    }
  }
]

In this example, Michael Brown's entry failed because his ssn already belongs to an active employee for this company, while Sarah Nguyen's employee record was created successfully. Check each entry's shape (errorCode/errorMessage vs. data) to tell which employees in the batch succeeded.

Notes

  • This is not all-or-nothing: employees are created independently, so a failure on one doesn't prevent the others in the same request from being created.
  • Match response entries to request entries by array position (index) to know which employee an error applies to.

Did this page help you?