Divisions
Divisions let you organize a company into separate divisions, each with its own name, trade name, FEIN, and address. Divisions are off by default. You activate them once per company, and Worklio creates a default division that shares the company's settings. After that, you can list, retrieve, create, and update divisions.
This page covers activating divisions, listing and retrieving them, creating a new one, and updating an existing one.
All endpoints on this page require a bearer access token (see How to Get API Access). CLIENT_ID is the company identifier returned as id when you create the company.
Activate divisions before you use any other endpoint on this page. Call Activate Divisions first, once per company.
Activate Divisions
Turns on divisions for a company and creates its default division. The default division shares the company's settings. Call this once, before you list, retrieve, create, or update divisions.
Activation can't be undone through the API. There is no API endpoint to deactivate divisions once they're activated. An individual division can be deactivated only in the Worklio UI. By sendingacknowledgeDivisionRules, you acknowledge this.
Endpoint
POST https://api.worklio.com/wep/companies/{CLIENT_ID}/activatedivisions
| Parameter | Type | Required | Description |
|---|---|---|---|
CLIENT_ID | integer | Yes | The company's id. Path parameter. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
acknowledgeDivisionRules | boolean | Yes | Set to true to acknowledge the division rules described above. |
defaultName | string | No | Name of the default division. Defaults to "DEFAULT" if omitted. |
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}/activatedivisions`;
const payload = {
acknowledgeDivisionRules: true
};
async function activateDivisions() {
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());
}
activateDivisions();curl -s -X POST "https://api.worklio.com/wep/companies/$CLIENT_ID/activatedivisions" \
-H "accept: application/json" \
-H "api-version: 2.0" \
-H "authorization: Bearer $API_KEY" \
-H "content-type: application/json" \
-H "x-api-version: 2.0" \
-d '{
"acknowledgeDivisionRules": true
}'To name the default division yourself, add defaultName:
{
"acknowledgeDivisionRules": true,
"defaultName": "Headquarters"
}A successful request returns 200. To see the default division that was created, call List Divisions.
Example response
{
"divisionAddress": {
"id": 6109,
"addressLine1": "233 S Wacker Drive",
"addressLine2": "Suite 900",
"addressCity": "Chicago",
"addressState": "IL",
"addressZIP": "60606",
"addressCountry": "US"
},
"id": 128,
"name": "DEFAULT",
"tradeName": "",
"fein": "123456789",
"status": 1
}{
"status": 0,
"code": "400",
"errorCode": "WEP_BadRequest",
"message": "9/29/2026 - 1:56:55 PM : Divisions are already active for company #1028. You can manage them using 'divisions' endpoint.",
"stackTrace": "",
"pagination": {
"pageNo": 0,
"pageSize": 0,
"totalRecords": 0,
"totalPages": 0,
"dataToken": ""
},
"validationErrors": null
}Divisions Not Activated Error
If the company doesn't have divisions activated it will produce 400 Error SharedResource.DivisionsAreNotActiveForCompany.en-US. This error will happen with every endpoint below if you don't call the activate divisions endpoint.
{
"status": 0,
"code": "400",
"errorCode": null,
"message": "10/2/2026 - 10:46:18 AM : SharedResource.DivisionsAreNotActiveForCompany.en-US",
"stackTrace": "",
"pagination": {
"pageNo": 0,
"pageSize": 0,
"totalRecords": 0,
"totalPages": 0,
"dataToken": ""
},
"validationErrors": null
}List Divisions
Returns every division for a company, as an array. Each entry is a summary — to get a division's address, use Get a Division.
Endpoint
GET https://api.worklio.com/wep/companies/{CLIENT_ID}/divisions
| Parameter | Type | Required | Description |
|---|---|---|---|
CLIENT_ID | integer | Yes | The company's id. Path parameter. |
No request body.
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}/divisions`;
async function listDivisions() {
const response = await fetch(url, {
method: "GET",
headers: {
accept: "application/json",
"api-version": "2.0",
authorization: `Bearer ${TOKEN}`,
"x-api-version": "2.0"
}
});
console.log(response.status);
const raw = await response.text();
console.log(JSON.stringify(JSON.parse(raw), null, 2));
}
listDivisions();curl -s -X GET "https://api.worklio.com/wep/companies/$CLIENT_ID/divisions" \
-H "accept: application/json" \
-H "api-version: 2.0" \
-H "authorization: Bearer $API_KEY" \
-H "x-api-version: 2.0" | jq .Example response
[
{
"id": 128,
"name": "DEFAULT",
"tradeName": "",
"fein": "123456789",
"status": 1
}
]| Field | Type | Description |
|---|---|---|
id | integer | The division's unique identifier. Use it as DIVISION_ID in the endpoints below. |
name | string | Division name. The default division is named DEFAULT unless you set defaultName when you activated divisions. |
tradeName | string | Trade / DBA name. Empty string if not set. |
fein | string | The division's Federal EIN. |
status | integer | Division status. See Status below. |
Status
| Value | Name |
|---|---|
| 1 | Active |
| 2 | Pending |
| 3 | Inactive |
| 4 | CreditHold |
Get a Division
Returns one division, including its address.
Endpoint
GET https://api.worklio.com/wep/companies/{CLIENT_ID}/divisions/{DIVISION_ID}
| Parameter | Type | Required | Description |
|---|---|---|---|
CLIENT_ID | integer | Yes | The company's id. Path parameter. |
DIVISION_ID | integer | Yes | The division's id, as returned by List Divisions or Create a Division. Path parameter. |
No request body.
Example request
require("dotenv").config();
const TOKEN = process.env.API_KEY;
const CLIENT_ID = process.env.CLIENT_ID;
const DIVISION_ID = 128;
const url = `https://api.worklio.com/wep/companies/${CLIENT_ID}/divisions/${DIVISION_ID}`;
async function getDivision() {
const response = await fetch(url, {
method: "GET",
headers: {
accept: "application/json",
"api-version": "2.0",
authorization: `Bearer ${TOKEN}`,
"x-api-version": "2.0"
}
});
console.log(response.status);
const raw = await response.text();
console.log(JSON.stringify(JSON.parse(raw), null, 2));
}
getDivision();curl -s -X GET "https://api.worklio.com/wep/companies/$CLIENT_ID/divisions/128" \
-H "accept: application/json" \
-H "api-version: 2.0" \
-H "authorization: Bearer $API_KEY" \
-H "x-api-version: 2.0" | jq .Example response
{
"divisionAddress": {
"id": 6109,
"addressLine1": "233 S Wacker Drive",
"addressLine2": "Suite 900",
"addressCity": "Chicago",
"addressState": "IL",
"addressZIP": "60606",
"addressCountry": "US"
},
"id": 128,
"name": "DEFAULT",
"tradeName": "",
"fein": "123456789",
"status": 1
}The response has the same fields as an entry in List Divisions, plus divisionAddress.
Create a Division
Adds a division to a company. Divisions must already be activated.
Endpoint
POST https://api.worklio.com/wep/companies/{CLIENT_ID}/divisions
| Parameter | Type | Required | Description |
|---|---|---|---|
CLIENT_ID | integer | Yes | The company's id. Path parameter. |
Request body
| Field | Type | Description |
|---|---|---|
name | string | Division name. |
fein | string | The division's Federal EIN. |
tradeName | string | Trade / DBA name. Returned as an empty string if omitted. |
divisionAddress | object | The division's address. See below. |
divisionAddress fields:
| Field | Type | Description |
|---|---|---|
addressLine1 | string | Street address line 1. |
addressLine2 | string | Street address line 2 (suite, unit, etc.). Returned as an empty string if omitted. |
addressCity | string | City. |
addressState | string | Two-letter state code. Returned as an empty string if omitted. |
addressZIP | string | ZIP code. |
addressCountry | string | Returned as "US" if omitted. |
The address isn't validated. This endpoint savesdivisionAddressas you send it. The request below omitsaddressState, and the division is still created withaddressStateas an empty string. Validate the address with the address validation endpoint before you send it.
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}/divisions`;
const payload = {
name: "Art Division",
fein: "958472631",
divisionAddress: {
addressLine1: "350 Fifth Avenue",
addressCity: "New York",
addressZIP: "10118"
}
};
async function createDivision() {
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);
const raw = await response.text();
console.log(JSON.stringify(JSON.parse(raw), null, 2));
}
createDivision();curl -s -X POST "https://api.worklio.com/wep/companies/$CLIENT_ID/divisions" \
-H "accept: application/json" \
-H "api-version: 2.0" \
-H "authorization: Bearer $API_KEY" \
-H "content-type: application/json" \
-H "x-api-version: 2.0" \
-d '{
"name": "Art Division",
"fein": "958472631",
"divisionAddress": {
"addressLine1": "350 Fifth Avenue",
"addressCity": "New York",
"addressZIP": "10118"
}
}' | jq .Example response
{
"divisionAddress": {
"id": 6111,
"addressLine1": "350 Fifth Avenue",
"addressLine2": "",
"addressCity": "New York",
"addressState": "",
"addressZIP": "10118",
"addressCountry": "US"
},
"id": 130,
"name": "Art Division",
"tradeName": "",
"fein": "958472631",
"status": 1
}id is the new division's unique identifier. Save it — you'll need it as DIVISION_ID to get or update this division.
This endpoint returns 200, not 201.
Update a Division
Changes a division's details. Send only the fields you want to change.
Content type
We recommend to useapplication/merge-patch+json, not application/json.
content-type: application/merge-patch+json
Endpoint
PATCH https://api.worklio.com/wep/companies/{CLIENT_ID}/divisions/{DIVISION_ID}
| Parameter | Type | Required | Description |
|---|---|---|---|
CLIENT_ID | integer | Yes | The company's id. Path parameter. |
DIVISION_ID | integer | Yes | The division's id, as returned by List Divisions or Create a Division. Path parameter. |
Request body
You can update these fields:
| Field | Type | Description |
|---|---|---|
name | string | Division name. |
tradeName | string | Trade / DBA name. |
fein | string | The division's Federal EIN. |
divisionAddress | object | The division's address, with the same fields as in Create a Division. |
You can send a partial divisionAddress (for example, only addressCity). The address fields you omit keep their current values.
Like Create, this endpoint doesn't validate the address. Validate it with the address validation endpoint before you send it.
Example request
This example sets the trade name of the default division.
require("dotenv").config();
const TOKEN = process.env.API_KEY;
const CLIENT_ID = process.env.CLIENT_ID;
const DIVISION_ID = 128;
const url = `https://api.worklio.com/wep/companies/${CLIENT_ID}/divisions/${DIVISION_ID}`;
const payload = {
tradeName: "Electronics Division"
};
async function updateDivision() {
const response = await fetch(url, {
method: "PATCH",
headers: {
accept: "application/json",
"api-version": "2.0",
authorization: `Bearer ${TOKEN}`,
"content-type": "application/merge-patch+json",
"x-api-version": "2.0"
},
body: JSON.stringify(payload)
});
console.log(response.status);
const raw = await response.text();
console.log(JSON.stringify(JSON.parse(raw), null, 2));
}
updateDivision();curl -s -X PATCH "https://api.worklio.com/wep/companies/$CLIENT_ID/divisions/128" \
-H "accept: application/json" \
-H "api-version: 2.0" \
-H "authorization: Bearer $API_KEY" \
-H "content-type: application/merge-patch+json" \
-H "x-api-version: 2.0" \
-d '{
"tradeName": "Electronics Division"
}' | jq .Example response
A successful update returns the full, updated division — the same shape as Get a Division. Fields you didn't send keep their current values.
{
"divisionAddress": {
"id": 6109,
"addressLine1": "233 S Wacker Drive",
"addressLine2": "Suite 900",
"addressCity": "Chicago",
"addressState": "IL",
"addressZIP": "60606",
"addressCountry": "US"
},
"id": 128,
"name": "DEFAULT",
"tradeName": "Electronics Division",
"fein": "123456789",
"status": 1
}Assigning employees to a division
When assigning employee to division use PATCH employee see Employee Basics with divisionId it employees contract.
require("dotenv").config();
const TOKEN = process.env.API_KEY;
const client_id = 1028
const URL = process.env.URL
const url = `${URL}/wep/companies/${client_id}/employees/4321`;
const payload = {
contract: {
divisionId: 133
}
}
async function assignEmployeeDivision() {
const response = await fetch(url, {
method: "PATCH",
headers: {
accept: "application/json",
"api-version": "2.0",
authorization: `Bearer ${TOKEN}`,
"content-type": "application/merge-patch+json",
"x-api-version": "2.0"
},
body: JSON.stringify(payload)
});
console.log(response.status);
const raw = await response.text();
console.log(JSON.stringify(JSON.parse(raw), null, 2));
}
assignEmployeeDivision();curl --request PATCH \
--url "$URL/wep/companies/1028/employees/4321" \
--header "accept: application/json" \
--header "api-version: 2.0" \
--header "x-api-version: 2.0" \
--header "authorization: Bearer $API_KEY" \
--header "content-type: application/merge-patch+json" \
--data '{"contract":{"divisionId":133}}' \
--include{
"id": 4321,
"firstName": "Samuel",
"lastName": "Test",
.
.
.
"contract": {
"id": 3008,
"startOn": "2027-01-01",
"workSchedule": 1,
"compensationType": 1,
"compensableHours": 40,
"compensationAmount": 90000,
"compensationNumberOfUnits": 0,
"isStatutory": true,
"is943": false,
"workLocationId": 0,
"divisionId": 133, //division id was updated here
"wcCode": "0000",
"socCode": "151252",
"policyId": 1084,
"payrollPolicyId": 1084,
"toGroupId": 724,
"workerType": 0,
"payPeriod": 1,
"status": 1
},
.
.
.
}Related
- A bulk version of Create a Division exists — see Bulk Operations.
Updated 3 days ago
