---
updatedAt: 2026-09-21T22:36:45.000Z
agentTools:
  projectIndex: https://docs.checkhq.com/llms.txt
---

# Fetching multiple resources

Fetch many resources at once

When a specific set of resources need to be requested from Check’s API, it is possible to provide the resource IDs to the list endpoint via the `id` query parameter. For example, one can fetch the details for a specified set of employees via the `id` query parameter by calling `GET /employees?id=emp_aaa111&id=emp_bbb222&id=emp_ccc333&id=ddd444`. Leveraging this feature reduces the number of Check API calls a client needs to make, improving performance. This is especially important for large datasets.

When the number of requested resources exceeds the page limit, the response will be paginated as documented in [the pagination guide](https://docs.checkhq.com/docs/pagination).

If a provided ID references a resource that does not exist, this will be indicated by the resource’s absence in the response.

There is no hard limit on the number of IDs supported per request, but each ID will increase the time it takes to receive a response.

## Supported Resources

Bulk GET requests are currently supported for the following resources:

### Companies and workers

* [List Companies](https://docs.checkhq.com/reference/list-companies)
* [List Employees](https://docs.checkhq.com/reference/list-employees)
* [List Contractors](https://docs.checkhq.com/reference/list-contractors)
* [List Workplaces](https://docs.checkhq.com/reference/list-workplaces)
* [List Setups](https://docs.checkhq.com/reference/list-setups)

### Payroll

* [List Payrolls](https://docs.checkhq.com/reference/list-payrolls)
* [List External Payrolls](https://docs.checkhq.com/reference/list-external-payrolls)
* [List Payroll Items](https://docs.checkhq.com/reference/list-payroll-items)
* [List Contractor Payments](https://docs.checkhq.com/reference/list-contractor-payments-1)
* [List Pay Schedules](https://docs.checkhq.com/reference/list-pay-schedules)
* [List Earning Codes](https://docs.checkhq.com/reference/list-earning-codes)
* [List Earning Rates](https://docs.checkhq.com/reference/list-earning-rates)

### Pay setup

* [List Benefits](https://docs.checkhq.com/reference/list-benefits)
* [List Company Benefits](https://docs.checkhq.com/reference/list-company-benefits)
* [List Post-Tax Deductions](https://docs.checkhq.com/reference/list-post-tax-deductions)
* [List Net Pay Splits](https://docs.checkhq.com/reference/list-net-pay-splits)
* [List Bank Accounts](https://docs.checkhq.com/reference/list-bank-accounts)

### Payments

* [List Payments](https://docs.checkhq.com/reference/list-payments)
* [List Payment Attempts](https://docs.checkhq.com/reference/get-a-payment-attempt)
* [List Fulfillments](https://docs.checkhq.com/reference/list-fulfillments)

### Taxes and filings

* [List Filings](https://docs.checkhq.com/reference/list-company-filings)
* [List Tax Filings](https://docs.checkhq.com/reference/list-tax-filings)

### Documents

* [List Company Tax Documents](https://docs.checkhq.com/reference/list-company-tax-documents)
* [List Employee Tax Documents](https://docs.checkhq.com/reference/list-employee-tax-documents)
* [List Contractor Tax Documents](https://docs.checkhq.com/reference/list-contractor-tax-documents)
* [List Company Authorization Documents](https://docs.checkhq.com/reference/list-company-authorization-documents)
* [List Company Provided Documents](https://docs.checkhq.com/reference/list-company-provided-documents)
* [List Setup Documents](https://docs.checkhq.com/reference/list-setup-documents)

### Notifications, webhooks, and integrations

* [List Communications](https://docs.checkhq.com/reference/list-communications)
* [List Notifications](https://docs.checkhq.com/reference/list-notifications)
* [List Webhook Configs](https://docs.checkhq.com/reference/list-a-webhook-config)
* [List Webhook Deliveries](https://docs.checkhq.com/reference/list-webhook-deliveries)
* [List Integration Accesses](https://docs.checkhq.com/reference/list-integration-accesses-1)
* [List Integration Permissions](https://docs.checkhq.com/reference/list-integration-permissions)

[List Taxes](https://docs.checkhq.com/reference/list-taxes) and [List Agencies](https://docs.checkhq.com/reference/list-agencies) also accept the `id` query parameter, with a maximum of 500 IDs per request. [List Logs](https://docs.checkhq.com/reference/list-logs) accepts `id` as well.

## Example: Fetching all employees on a payroll

For example, consider the case of fetching all employees on a payroll. The requests below show the API requests involved, and the code block is an example implementation in JavaScript.

### API Requests

`GET /payrolls/pay_abc123`

```json
{
  "id": "pay_abc123",
  "items": [
    {
      "id": "itm_pqngIDA674QGlxaq3FCE",
      "payroll": "pay_lpeGFBOknAdXfSArMMnB",
      "employee": "emp_aaa111",
      "net_pay": "123.45",
      ...
    },
    {
      "id": "itm_ZSyIVUmBkr8aKEMj9JS2",
      "payroll": "pay_lpeGFBOknAdXfSArMMnB",
      "employee": "emp_bbb222",
      "net_pay": "678.90",
      ...
    },
    {
      "id": "itm_GkUmHOh4FUWNvW7RQ1p0",
      "payroll": "pay_lpeGFBOknAdXfSArMMnB",
      "employee": "emp_ccc333",
      "net_pay": "987.65",
      ...
    },
    {
      "id": "itm_cmmDLIYJEPNv7r1WICDS",
      "payroll": "pay_lpeGFBOknAdXfSArMMnB",
      "employee": "emp_ddd444",
      "net_pay": "432.10",
      ...
    }
  ],
  ...
}
```

To fetch the employees of this payroll, the bulk behavior of `/employees` can be used:

`GET /employees?id=emp_aaa111&id=emp_bbb222&id=emp_ccc333&id=ddd444`

```json
{
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "emp_aaa111",
      "first_name": "First",
      "last_name": "Employee",
      ...
    },
    {
      "id": "emp_bbb222",
      "first_name": "Second",
      "last_name": "Employee",
      ...
    },
    {
      "id": "emp_ccc333",
      "first_name": "Third",
      "last_name": "Employee",
      ...
    },
    {
      "id": "emp_ddd444",
      "first_name": "Fourth",
      "last_name": "Employee",
      ...
    }
  ]
}
```

### Sample implementation

This sample JavaScript implementation shows how an API client could obtain all employees on a given payroll.

```javascript
import fetch from "node-fetch";
import qs from "qs";

const apiKey = process.env.API_KEY;
const baseUrl = "https://sandbox.checkhq.com";
const payrollId = "pay_abc123";
const fetchOptions = {
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
};

async function main() {
  const payroll = await fetch(`${baseUrl}/payrolls/${payrollId}`, fetchOptions)
    .then((response) => response.json());

  // Gather an array of all employee IDs on the payroll.
  const employeeIds = payroll.items.map((item) => item.employee);
  
  // Request a page of employees.
  const queryParams = qs.stringify({ id: employeeIds }, { arrayFormat: "repeat" });
  let response = await fetch(`${baseUrl}/employees?${queryParams}`, fetchOptions)
    .then((response) => response.json());

  let employees = response.results;

  // Iterate through all additional pages.
  while (response.next) {
    response = await fetch(response.next, fetchOptions)
      .then((response) => response.json());

    employees = employees.concat(response.results);
  }

  // Transform the array of employees into an object keyed by the employee IDs.
  const employeesById = employees.reduce(
    (agg, employee) => ({ ...agg, [employee.id]: employee }),
    {}
  );

  // Present the information sourced from the payroll and the employees.
  console.table(
    payroll.items.map((item) => ({
      "First Name": employeesById[item.employee].first_name,
      "Last Name": employeesById[item.employee].last_name,
      "Net Pay": item.net_pay,
    }))
  );
}

main();
```