---
updatedAt: 2026-10-19T12:29:04.000Z
agentTools:
  projectIndex: https://apidocs.worklio.com/llms.txt
---

# Pagination, Filtering & Sorting

List endpoints on Worklio's v1.0 API (base path `/api/public/...`) support pagination, filtering, and sorting through a shared set of parameters. This page documents that shared contract, using [List Employees](#worked-example-list-employees) as a worked example. Most of the `/wep/...` endpoints documented elsewhere in this guide — [Get Companies](/get-companies), [Workers' Compensation Rate](/create-workers-comp-rate) — don't support these parameters; each of those returns its full result set on every call.

Every parameter below can be sent as a query-string parameter or as an `x-api-*` request header. The two styles can be mixed in the same request. If the same parameter is set both ways, the header value takes priority.

## Auth

Requires a bearer access token (see [How to Get API Access](/how-to-get-api-access)).

## Two ways to paginate

Worklio supports two pagination styles: Data-Token-based, and skip-based (no token). They're not designed to be mixed within the same browsing session — pick one and stay on it while paging through a result set.

### Data-Token-based pagination

The default and recommended approach. The first request returns a `DataToken` that encodes the query's filter, sort, and paging state on the server. Each following page request sends that token back instead of repeating the filter and sort parameters, and gets a new token in return.

* The token expires 60 seconds after it's issued. Request the next page before it expires, or start over from page one.
* `TotalRecords` and `TotalPages` are computed from the database once, on the first-page request, then carried forward via the token — they aren't recomputed on every page.

#### Request the first page

| Query parameter   | Header                  | Type    | Required | Description                                                                         |
| ----------------- | ----------------------- | ------- | -------- | ----------------------------------------------------------------------------------- |
| `limit`           | `x-api-limit`           | integer | Yes      | Page size — records per page.                                                       |
| `filter`          | `x-api-filter`          | string  | No       | Filter query. See [Filtering](#filtering).                                          |
| `sort`            | `x-api-sort`            | string  | No       | Sort query. See [Sorting](#sorting).                                                |
| `include-deleted` | `x-api-include-deleted` | boolean | No       | Include soft-deleted records. Only supported on entities that track a delete state. |

```
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees?limit=25
```

or, with headers:

```
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees
x-api-limit: 25
```

Every response — first page or later — includes a `Pagination` object:

| Field          | Type    | Description                                                                              |
| -------------- | ------- | ---------------------------------------------------------------------------------------- |
| `PageNo`       | integer | The current page number.                                                                 |
| `PageSize`     | integer | Records per page (echoes `limit`).                                                       |
| `TotalRecords` | integer | Total records matching the filter. Computed once, on the first-page request.             |
| `TotalPages`   | integer | Total number of pages.                                                                   |
| `DataToken`    | string  | Opaque token to send with the next paging request. Expires 60 seconds after it's issued. |

#### Request the next, previous, or a specific page

Send the `DataToken` from the previous response along with one of `next-page`, `prev-page`, or `page`. Filter and sort are already encoded in the token — don't resend them.

```
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees?next-page&data-token={DataToken}
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees?prev-page&data-token={DataToken}
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees?page=3&data-token={DataToken}
```

or, with headers:

```
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees
x-api-next-page: true
x-api-data-token: {DataToken}
```

| Query parameter | Header             | Type    | Required                        | Description                                        |
| --------------- | ------------------ | ------- | ------------------------------- | -------------------------------------------------- |
| `next-page`     | `x-api-next-page`  | flag    | One of these three              | Get the next page.                                 |
| `prev-page`     | `x-api-prev-page`  | flag    |                                 | Get the previous page.                             |
| `page`          | `x-api-page`       | integer |                                 | Get a specific page number.                        |
| `data-token`    | `x-api-data-token` | string  | Yes, alongside any of the above | The `DataToken` returned by the previous response. |

### Skip-based pagination (no token)

An alternative to Data-Token pagination. Every request repeats its own `limit`, and — after the first page — its own `skip`. Nothing about the query is remembered server-side between requests: `limit`, `filter`, and `sort` must be sent identically on every page. If `limit` changes partway through, page boundaries shift and results aren't guaranteed to stay consistent.

#### First page

```
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees?limit=25
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees?limit=25&skip=0
```

Passing `skip=0` explicitly, rather than omitting `skip`, suppresses the `Pagination` object in the response entirely.

#### Next pages

```
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees?limit=25&skip=25
```

| Query parameter   | Header                  | Type    | Required                     | Description                                                |
| ----------------- | ----------------------- | ------- | ---------------------------- | ---------------------------------------------------------- |
| `limit`           | `x-api-limit`           | integer | Yes                          | Page size. Must match the value used on the first request. |
| `skip`            | `x-api-skip`            | integer | Yes, from the second page on | Number of records to skip.                                 |
| `filter`          | `x-api-filter`          | string  | No                           | Same filter query as the first page.                       |
| `sort`            | `x-api-sort`            | string  | No                           | Same sort query as the first page.                         |
| `include-deleted` | `x-api-include-deleted` | boolean | No                           | Include soft-deleted records, where supported.             |

No `Pagination` object is returned for skip-based requests beyond the bare first-page case above.

## Filtering

Pass a filter query via the `filter` query parameter or the `x-api-filter` header. It can be combined with `sort`.

```
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees?limit=25&filter={FilterQuery}
```

or, with headers:

```
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees
x-api-limit: 25
x-api-filter: {FilterQuery}
```

A filter query is a sequence of operators separated by `;`. At the top level, `;` means AND. Inside a logical operator's parentheses, `;` means whatever that operator specifies.

### Logical operators

| Operator   | Meaning                                                                        |
| ---------- | ------------------------------------------------------------------------------ |
| `Or(...)`  | The enclosed operators are OR'd together instead of AND'd.                     |
| `And(...)` | The enclosed operators are AND'd together — useful nested inside an `Or(...)`. |

Both can be combined and nested:

```
Number.GreaterThan(0);Or(Number.Equal(1);Number.Equal(3);Number.Equal(5);Number.Equal(7))
→ (Number > 0 AND (Number = 1 OR Number = 3 OR Number = 5 OR Number = 7))

Or(Ssn.Contains('xxx');And(Number.GreaterThan(0);Number.LessThan(100)))
→ (Ssn LIKE '%xxx%' OR (Number > 0 AND Number < 100))
```

### Single-field operators

A parameter value is compared against one entity field.

| Operator             | Supported types           | Example                                                                                   |
| -------------------- | ------------------------- | ----------------------------------------------------------------------------------------- |
| `Equal`              | string, numeric, datetime | `Email.Equal('jon.doe@company.com')`, `Number.Equal(123)`, `CreatedOn.Equal(2020-01-01)`  |
| `NotEqual`           | string, numeric, datetime | `Email.NotEqual('jon.doe@company.com')`                                                   |
| `LessThan`           | numeric, datetime         | `Number.LessThan(123)`                                                                    |
| `LessThanOrEqual`    | numeric, datetime         | `Number.LessThanOrEqual(123)`                                                             |
| `GreaterThan`        | numeric, datetime         | `Number.GreaterThan(123)`                                                                 |
| `GreaterThanOrEqual` | numeric, datetime         | `Number.GreaterThanOrEqual(123)`                                                          |
| `Contains`           | string                    | `Email.Contains('jon.doe')`                                                               |
| `StartsWith`         | string                    | `Email.StartsWith('jon')`                                                                 |
| `EndsWith`           | string                    | `Email.EndsWith('company.com')`                                                           |
| `NotContains`        | string                    | `Email.NotContains('jon.doe')`                                                            |
| `NotStartsWith`      | string                    | `Email.NotStartsWith('jon')`                                                              |
| `NotEndsWith`        | string                    | `Email.NotEndsWith('company.com')`                                                        |
| `IsNull`             | string, numeric, datetime | `ModifiedOn.IsNull()`                                                                     |
| `IsNotNull`          | string, numeric, datetime | `ModifiedOn.IsNotNull()`                                                                  |
| `InArray`            | string, numeric, datetime | `Year.InArray(2018,2019,2020)` — `field == array[1] OR field == array[2] OR ...`          |
| `InArrayOrNull`      | string, numeric, datetime | `Year.InArrayOrNull(2018,2019,2020)` — same as `InArray`, plus `OR field == null`         |
| `NotInArray`         | string, numeric, datetime | `Year.NotInArray(2018,2019,2020)` — `field != array[1] AND field != array[2] AND ...`     |
| `NotInArrayOrNull`   | string, numeric, datetime | `Year.NotInArrayOrNull(2018,2019,2020)` — same as `NotInArray`, OR'd with `field == null` |

Quoting string values is optional: `Email.Equal(jon.doe@company.com)` and `Email.Equal('jon.doe@company.com')` are equivalent.

### Multi-field operators

A parameter value is compared against several entity fields at once, OR'd together.

| Operator                     | Supported types           | Example                                                                                  |
| ---------------------------- | ------------------------- | ---------------------------------------------------------------------------------------- |
| `EqualInFields`              | string, numeric, datetime | `'CodeX'.EqualInFields(Code1,Code2,Code3)` → `field1 == value OR field2 == value OR ...` |
| `LessThanInFields`           | numeric, datetime         | `500.LessThanInFields(Amount1,Amount2,Amount3)`                                          |
| `LessThanOrEqualInFields`    | numeric, datetime         | `500.LessThanOrEqualInFields(Amount1,Amount2,Amount3)`                                   |
| `GreaterThanInFields`        | numeric, datetime         | `500.GreaterThanInFields(Amount1,Amount2,Amount3)`                                       |
| `GreaterThanOrEqualInFields` | numeric, datetime         | `500.GreaterThanOrEqualInFields(Amount1,Amount2,Amount3)`                                |
| `ContainsInFields`           | string                    | `'Jon'.ContainsInFields(FirstName,MiddleName)`                                           |
| `StartsWithInFields`         | string                    | `'Jo'.StartsWithInFields(FirstName,MiddleName)`                                          |
| `EndsWithInFields`           | string                    | `'n'.EndsWithInFields(FirstName,MiddleName)`                                             |

### Example

```node
require("dotenv").config();

const TOKEN = process.env.API_KEY
const CLIENT_ID = 1028;
const URL = process.env.URL;
const url = `${URL}/api/public/clients/${CLIENT_ID}/employees?limit=10&filter='D'.StartsWithInFields(FirstName, LastName)`;



async function getEmployees() {
  console.log(url)
  const response = await fetch(url, {
    method: "GET",
    headers: {
      accept: "application/json",
      "api-version": "1.0",
      authorization: `Bearer ${TOKEN}`,
      "content-type": "application/json",
      "x-api-version": "1.0"
    },

  });

  console.log(response.status);
  const raw = await response.text();
  console.log(JSON.stringify(JSON.parse(raw), null, 2));
}

getEmployees();
```
```curl
curl -s -X GET "https://api.worklio.com/api/public/clients/1028/employees?limit=10&filter='D'.StartsWithInFields(FirstName, LastName)" \
  -H "accept: application/json" \
  -H "api-version: 1.0" \
  -H "authorization: Bearer $API_KEY" \
  -H "content-type: application/json" \
  -H "x-api-version: 1.0" | jq .
```

### Example Response

```json
{
  "Data": [
    {
      "W2Id": 3701,
      "ClientId": 1028,
      "EmployeeNumber": 2,
      "FirstName": "David",
      "LastName": "Brown",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "223584024",
      "Gender": 2,
      "BirthOn": "2001-03-23T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "ResidentialAddressId": 6001,
      "PeoHireDate": "2026-09-01T00:00:00Z",
      "OrigHireDate": "2026-09-01T00:00:00Z",
      "LastPaidOn": "2026-09-18T00:00:00Z",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "BenefitWaitPeriodStart": "2026-09-01T00:00:00Z",
      "LastEarnedWagesOn": "2026-09-18T00:00:00Z",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4278,
      "CreatedOn": "2026-09-11T11:43:39Z",
      "ModifiedOn": "2026-10-09T06:48:40Z",
      "RowStatus": 1,
      "Files": []
    },
    {
      "W2Id": 3722,
      "ClientId": 1028,
      "EmployeeNumber": 5,
      "FirstName": "John",
      "LastName": "Doe",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "111114084",
      "Gender": 2,
      "BirthOn": "2003-06-12T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "PeoHireDate": "2026-09-08T00:00:00Z",
      "OrigHireDate": "2026-09-08T00:00:00Z",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "BenefitWaitPeriodStart": "2026-09-08T00:00:00Z",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4303,
      "CreatedOn": "2026-09-17T12:05:20Z",
      "ModifiedOn": "2026-10-09T06:33:29Z",
      "RowStatus": 1,
      "Files": []
    }
  ],
  "Status": 1,
  "Code": "200",
  "ErrorCode": "",
  "Message": "OK",
  "StackTrace": "",
  "Pagination": {
    "PageNo": 1,
    "PageSize": 10,
    "TotalRecords": 2,
    "TotalPages": 1,
    "DataToken": "Hn90y4jz7H0rmWIp3Lk5P4h7B-n7cI6DPAOBRf4uXiaXuXrAP2stOYrUtcao8lXXT722RxVbj54o5w5QU5MVr-vaWUpJpZ1jewY4wdn62vYVImaUO4vK610hwlE1bAu-azSTfl1PXW5o-XQ2K2fQGK237R1mcIjMKuXDWcDDeOFBlT5zqzcR_bT0XTIOWlGRBRzfUwhuQgSbMYxHc95yVZRKDlyMlZ7YVuVppdvStw1LLN239ywEHZxw62NLP4xn4"
  }
}
```

## Sorting

Pass a sort query via the `sort` query parameter or the `x-api-sort` header. It can be combined with `filter`.

```text
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees?limit=25&sort={SortQuery}
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees?limit=25&filter={FilterQuery}&sort={SortQuery}
```

or, with headers:

```
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees
x-api-limit: 25
x-api-sort: {SortQuery}
```

A sort query supports multiple fields, each set to `Asc` or `Desc`, separated by `;`:

```
Gender=Asc
CreatedOn=Desc
Gender=Asc;CreatedOn=Desc
```

## Worked example: List Employees

```
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees
```

### Example request

```javascript Node.js
require("dotenv").config();

const TOKEN = process.env.API_KEY
const CLIENT_ID = 1028;
const URL = process.env.URL;
const url = `${URL}/api/public/clients/${CLIENT_ID}/employees?limit=3`;



async function getEmployees() {
  console.log(url)
  const response = await fetch(url, {
    method: "GET",
    headers: {
      accept: "application/json",
      "api-version": "1.0",
      authorization: `Bearer ${TOKEN}`,
      "content-type": "application/json",
      "x-api-version": "1.0"
    },

  });

  console.log(response.status);
  const raw = await response.text();
  console.log(JSON.stringify(JSON.parse(raw), null, 2));
}

getEmployees();
```
```curl
curl -s -X GET "https://api.worklio.com/api/public/clients/1028/employees?limit=3" \
  -H "accept: application/json" \
  -H "api-version: 1.0" \
  -H "authorization: Bearer $API_KEY" \
  -H "content-type: application/json" \
  -H "x-api-version: 1.0" | jq .
```

### Example response

```json 200 Response
{
  "Data": [
    {
      "W2Id": 3698,
      "ClientId": 1028,
      "EmployeeNumber": 1,
      "FirstName": "Michael",
      "LastName": "Brown",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "223584084",
      "BirthOn": "1990-07-14T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "ResidentialAddressId": 6000,
      "PeoHireDate": "2026-09-01T00:00:00Z",
      "OrigHireDate": "2026-09-01T00:00:00Z",
      "LastPaidOn": "2026-09-18T00:00:00Z",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "BenefitWaitPeriodStart": "2026-09-01T00:00:00Z",
      "LastEarnedWagesOn": "2026-09-18T00:00:00Z",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4277,
      "CreatedOn": "2026-09-11T11:30:21Z",
      "ModifiedOn": "2026-09-11T11:30:21Z",
      "RowStatus": 1,
      "Files": []
    },
    {
      "W2Id": 3701,
      "ClientId": 1028,
      "EmployeeNumber": 2,
      "FirstName": "David",
      "LastName": "Brown",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "223584024",
      "Gender": 2,
      "BirthOn": "2001-03-23T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "ResidentialAddressId": 6001,
      "PeoHireDate": "2026-09-01T00:00:00Z",
      "OrigHireDate": "2026-09-01T00:00:00Z",
      "LastPaidOn": "2026-09-18T00:00:00Z",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "BenefitWaitPeriodStart": "2026-09-01T00:00:00Z",
      "LastEarnedWagesOn": "2026-09-18T00:00:00Z",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4278,
      "CreatedOn": "2026-09-11T11:43:39Z",
      "ModifiedOn": "2026-10-09T06:48:40Z",
      "RowStatus": 1,
      "Files": []
    },
    {
      "W2Id": 3722,
      "ClientId": 1028,
      "EmployeeNumber": 5,
      "FirstName": "John",
      "LastName": "Doe",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "111114084",
      "Gender": 2,
      "BirthOn": "2003-06-12T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "PeoHireDate": "2026-09-08T00:00:00Z",
      "OrigHireDate": "2026-09-08T00:00:00Z",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "BenefitWaitPeriodStart": "2026-09-08T00:00:00Z",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4303,
      "CreatedOn": "2026-09-17T12:05:20Z",
      "ModifiedOn": "2026-10-09T06:33:29Z",
      "RowStatus": 1,
      "Files": []
    }
  ],
  "Status": 1,
  "Code": "200",
  "ErrorCode": "",
  "Message": "OK",
  "StackTrace": "",
  "Pagination": {
    "PageNo": 1,
    "PageSize": 3,
    "TotalRecords": 7,
    "TotalPages": 3,
    "DataToken": "91J20nf0HkxDl0xhn23lyvjzPQJ-8U5rEV_f_nDnjskqE6XzQsoAVtjFkT9Wct3dRVP2xgUiHvwL94vbgQUvZN0xXv5jGMcOKT4d0_FhzUpPY7RErfaZ7ZdNjECP_bN5_J8V-aBF2q62zynd-NyB9j4y3VTNSBZnNAcT2GNZ4DefRmYw9H6L1Fi9Cjw@@"
  }
}
```

### Error response — invalid or missing `next-page`

```json 400 Response
{
  "Status": 3,
  "Code": "BadRequest",
  "ErrorCode": "InternalServerError",
  "Message": "Page Number out of range. [1-1]",
  "StackTrace": ""
}
```

Returned when `next-page` is requested without a valid page to advance to — for example, calling it with no `data-token`, or past the last page of results.

## Worked example: Filtering

Filters the same `employees` list used above down to records whose `LastName` matches, using the [`Equal`](#single-field-operators) operator.

```
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees?limit=25&filter=LastName.Equal('Brown')
```

### Example request

```javascript Node.js
require("dotenv").config();

const TOKEN = process.env.API_KEY
const CLIENT_ID = 1028;
const URL = process.env.URL;
const url = `${URL}/api/public/clients/${CLIENT_ID}/employees?limit=3&filter=LastName.Equal(Brown)`;



async function getEmployees() {
  console.log(url)
  const response = await fetch(url, {
    method: "GET",
    headers: {
      accept: "application/json",
      "api-version": "1.0",
      authorization: `Bearer ${TOKEN}`,
      "content-type": "application/json",
      "x-api-version": "1.0"
    },

  });

  console.log(response.status);
  const raw = await response.text();
  console.log(JSON.stringify(JSON.parse(raw), null, 2));
}

getEmployees();
```
```curl
curl -s -G "https://api.worklio.com/api/public/clients/1028/employees" \
  --data-urlencode "limit=25" \
  --data-urlencode "filter=LastName.Equal('Brown')" \
  -H "accept: application/json" \
  -H "api-version: 1.0" \
  -H "authorization: Bearer $API_KEY" \
  -H "content-type: application/json" \
  -H "x-api-version: 1.0" | jq .
```

### Example response

```json 200 Response
{
  "Data": [
    {
      "W2Id": 3698,
      "ClientId": 1028,
      "EmployeeNumber": 1,
      "FirstName": "Michael",
      "LastName": "Brown",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "223584084",
      "BirthOn": "1990-07-14T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "ResidentialAddressId": 6000,
      "PeoHireDate": "2026-09-01T00:00:00Z",
      "OrigHireDate": "2026-09-01T00:00:00Z",
      "LastPaidOn": "2026-09-18T00:00:00Z",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "BenefitWaitPeriodStart": "2026-09-01T00:00:00Z",
      "LastEarnedWagesOn": "2026-09-18T00:00:00Z",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4277,
      "CreatedOn": "2026-09-11T11:30:21Z",
      "ModifiedOn": "2026-09-11T11:30:21Z",
      "RowStatus": 1,
      "Files": []
    },
    {
      "W2Id": 3701,
      "ClientId": 1028,
      "EmployeeNumber": 2,
      "FirstName": "David",
      "LastName": "Brown",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "223584024",
      "Gender": 2,
      "BirthOn": "2001-03-23T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "ResidentialAddressId": 6001,
      "PeoHireDate": "2026-09-01T00:00:00Z",
      "OrigHireDate": "2026-09-01T00:00:00Z",
      "LastPaidOn": "2026-09-18T00:00:00Z",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "BenefitWaitPeriodStart": "2026-09-01T00:00:00Z",
      "LastEarnedWagesOn": "2026-09-18T00:00:00Z",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4278,
      "CreatedOn": "2026-09-11T11:43:39Z",
      "ModifiedOn": "2026-10-09T06:48:40Z",
      "RowStatus": 1,
      "Files": []
    }
  ],
  "Status": 1,
  "Code": "200",
  "ErrorCode": "",
  "Message": "OK",
  "StackTrace": "",
  "Pagination": {
    "PageNo": 1,
    "PageSize": 3,
    "TotalRecords": 2,
    "TotalPages": 1,
    "DataToken": "Zs2-AfsLqHOFMabTNp5uqMJMP9OMZKeR5aLw7xU3E3FLesHbw27k1yOJa6d58pK-bDdlufFjG1JlgQk3mropKkMgYsbDn6UtX3FcGL97U0TXbgULbX99JWGrI2foeNXHnVl2GZR0hqETsMTrSdnMVI4SR6Mc2UwZ4fZuSpFQyLRbPzTbk4wGcCSLizJ3ZRi7yoihled0evBlUI_K610rTP2b3y0VBUQAkgw@@"
  }
}
```

## Worked example: Sorting

Sorts the same `employees` list by `CreatedOn`, descending.

```
GET https://api.worklio.com/api/public/clients/{CLIENT_ID}/employees?limit=25&sort=CreatedOn=Desc
```

### Example request

```javascript Node.js
require("dotenv").config();

const TOKEN = process.env.API_KEY
const CLIENT_ID = 1028;
const URL = process.env.URL;
const url = `${URL}/api/public/clients/${CLIENT_ID}/employees?limit=10&sort=BirthOn=Desc`;



async function getEmployees() {
  console.log(url)
  const response = await fetch(url, {
    method: "GET",
    headers: {
      accept: "application/json",
      "api-version": "1.0",
      authorization: `Bearer ${TOKEN}`,
      "content-type": "application/json",
      "x-api-version": "1.0"
    },

  });

  console.log(response.status);
  const raw = await response.text();
  console.log(JSON.stringify(JSON.parse(raw), null, 2));
}

getEmployees();
```
```curl
curl -s -G "https://api.worklio.com/api/public/clients/1028/employees" \
  --data-urlencode "limit=25" \
  --data-urlencode "sort=CreatedOn=Desc" \
  -H "accept: application/json" \
  -H "api-version: 1.0" \
  -H "authorization: Bearer $API_KEY" \
  -H "content-type: application/json" \
  -H "x-api-version: 1.0" | jq .
```

### Example response

```json 200 Response
{
  "Data": [
    {
      "W2Id": 3725,
      "ClientId": 1028,
      "EmployeeNumber": 8,
      "FirstName": "Sophia",
      "LastName": "Nguyen",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "123222281",
      "Gender": 1,
      "BirthOn": "2026-10-08T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4306,
      "CreatedOn": "2026-09-17T12:08:48Z",
      "ModifiedOn": "2026-10-09T06:31:47Z",
      "RowStatus": 1,
      "Files": []
    },
    {
      "W2Id": 3724,
      "ClientId": 1028,
      "EmployeeNumber": 7,
      "FirstName": "Michael",
      "LastName": "Addams",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "113114084",
      "Gender": 2,
      "BirthOn": "2010-06-23T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4305,
      "CreatedOn": "2026-09-17T12:08:48Z",
      "ModifiedOn": "2026-10-09T06:32:53Z",
      "RowStatus": 1,
      "Files": []
    },
    {
      "W2Id": 3722,
      "ClientId": 1028,
      "EmployeeNumber": 5,
      "FirstName": "John",
      "LastName": "Doe",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "111114084",
      "Gender": 2,
      "BirthOn": "2003-06-12T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "PeoHireDate": "2026-09-08T00:00:00Z",
      "OrigHireDate": "2026-09-08T00:00:00Z",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "BenefitWaitPeriodStart": "2026-09-08T00:00:00Z",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4303,
      "CreatedOn": "2026-09-17T12:05:20Z",
      "ModifiedOn": "2026-10-09T06:33:29Z",
      "RowStatus": 1,
      "Files": []
    },
    {
      "W2Id": 3701,
      "ClientId": 1028,
      "EmployeeNumber": 2,
      "FirstName": "David",
      "LastName": "Brown",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "223584024",
      "Gender": 2,
      "BirthOn": "2001-03-23T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "ResidentialAddressId": 6001,
      "PeoHireDate": "2026-09-01T00:00:00Z",
      "OrigHireDate": "2026-09-01T00:00:00Z",
      "LastPaidOn": "2026-09-18T00:00:00Z",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "BenefitWaitPeriodStart": "2026-09-01T00:00:00Z",
      "LastEarnedWagesOn": "2026-09-18T00:00:00Z",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4278,
      "CreatedOn": "2026-09-11T11:43:39Z",
      "ModifiedOn": "2026-10-09T06:48:40Z",
      "RowStatus": 1,
      "Files": []
    },
    {
      "W2Id": 3729,
      "ClientId": 1028,
      "EmployeeNumber": 9,
      "FirstName": "Samuel",
      "LastName": "Addams",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "223526939",
      "Gender": 2,
      "BirthOn": "2000-02-16T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "ResidentialAddressId": 6108,
      "PeoHireDate": "2026-09-11T00:00:00Z",
      "OrigHireDate": "2026-09-11T00:00:00Z",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "BenefitWaitPeriodStart": "2026-09-11T00:00:00Z",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4321,
      "CreatedOn": "2026-09-29T12:09:05Z",
      "ModifiedOn": "2026-10-09T06:32:15Z",
      "RowStatus": 1,
      "Files": []
    },
    {
      "W2Id": 3698,
      "ClientId": 1028,
      "EmployeeNumber": 1,
      "FirstName": "Michael",
      "LastName": "Brown",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "223584084",
      "BirthOn": "1990-07-14T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "ResidentialAddressId": 6000,
      "PeoHireDate": "2026-09-01T00:00:00Z",
      "OrigHireDate": "2026-09-01T00:00:00Z",
      "LastPaidOn": "2026-09-18T00:00:00Z",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "BenefitWaitPeriodStart": "2026-09-01T00:00:00Z",
      "LastEarnedWagesOn": "2026-09-18T00:00:00Z",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4277,
      "CreatedOn": "2026-09-11T11:30:21Z",
      "ModifiedOn": "2026-09-11T11:30:21Z",
      "RowStatus": 1,
      "Files": []
    },
    {
      "W2Id": 3723,
      "ClientId": 1028,
      "EmployeeNumber": 6,
      "FirstName": "Sarah",
      "LastName": "Nguyen",
      "MiddleName": "",
      "OtherNames": "",
      "NickName": "",
      "Suffix": "",
      "Ssn": "122222281",
      "BirthOn": "1988-02-23T00:00:00Z",
      "PersonalEmail": "",
      "WorkEmail": "",
      "PersonalPhone": "",
      "CellPhone": "",
      "WorkPhone": "",
      "WorkCellPhone": "",
      "PeoHireDate": "2026-09-08T00:00:00Z",
      "OrigHireDate": "2026-09-08T00:00:00Z",
      "EePortal": false,
      "IdentificationType": 1,
      "DrivingLicense": "",
      "DrivingLicenseClass": "",
      "DrivingLicenseState": "  ",
      "ClockNumber": "",
      "BenefitWaitPeriodStart": "2026-09-08T00:00:00Z",
      "EligibleForRehire": false,
      "EligibleFor401k": false,
      "SetupFeeCharged": false,
      "TerminationFeeCharged": false,
      "VeteranStatus": 0,
      "ForcePrintPaystub": false,
      "Handicaped": false,
      "Blind": false,
      "Deceased": false,
      "HCE": false,
      "Citizenship": 1,
      "VisaType": "",
      "Checklist": 959,
      "Source": 1,
      "Id": 4304,
      "CreatedOn": "2026-09-17T12:05:20Z",
      "ModifiedOn": "2026-09-17T12:05:20Z",
      "RowStatus": 1,
      "Files": []
    }
  ],
  "Status": 1,
  "Code": "200",
  "ErrorCode": "",
  "Message": "OK",
  "StackTrace": "",
  "Pagination": {
    "PageNo": 1,
    "PageSize": 10,
    "TotalRecords": 7,
    "TotalPages": 1,
    "DataToken": "cwNc1-qRJv3Kd00h5ukkj9f4Y9_NWgIVWFAirfyhH4OmYS9Fn-zhQ5Cf-PjlIHtwez_pljG2K1gr0SmmMjK2LoleeXr__UmfWdXX5FeUQw_Z5ndRO8vzQF86mSvfQeOWElwXJdHxM04qxTBdZ8LmOWYy4EvP7rNd1E9FLRkqpots1xbxvkjXhE3I61cXsBCFz61tAi3ECJ-N-nicGxHxo"
  }
}
```

## Notes

* Field casing in this API family's responses is PascalCase (`Data`, `Pagination`, `PageNo`, `TotalRecords`, ...). This differs from the camelCase envelope used on the `/wep/...` endpoints documented elsewhere in this guide (e.g. `pagination.pageNo` in [Create a Pay Allocation](/create-pay-allocation))
* `next-page`, `prev-page`, and `page` all require a valid `data-token` from a prior response. Calling any of them without one, or past the last page, returns `400 DataValidationError` rather than an empty result set.