PeopleForce

Early access

Company API v4 is the next-generation API and is under active development. Endpoints and fields may still change.

Pagination

How Company API v4 list endpoints paginate — and how the shape changed from earlier versions.

List endpoints are paginated. The response wraps its results in a data array alongside a metadata object describing the current page and the total result set.

The pagination shape changed in v4. If you're migrating an integration built against an earlier version, see Before v4 for the field mapping.

v4 pagination

{
  "data": [
    // ... up to `per_page` resources
  ],
  "metadata": {
    "page": 1,
    "per_page": 50,
    "total_pages": 7,
    "total_count": 340
  }
}

Metadata fields

FieldDescription
pageThe current page number.
per_pageNumber of items returned per page.
total_pagesTotal number of pages available.
total_countTotal number of items across all pages.

Query parameters

ParameterDescription
pageThe page number to fetch. Defaults to 1.
per_pageNumber of results per page. The default is set per endpoint — 50 for most lists (including People), 100 for a few. There is no enforced maximum.
offsetSkip a number of results before the page starts.
curl "https://app.peopleforce.io/api/v4/people?page=2&per_page=100" \
  -H "X-API-KEY: <your_api_key>"

To walk the full result set, request page=1 and keep incrementing page until it reaches total_pages.

Response headers

The same pagination data is also returned as response headers, so you can paginate without parsing the body:

X-Total, X-Total-Pages, X-Per-Page, X-Page, X-Next-Page, X-Prev-Page, X-Offset.

Before v4

Earlier API versions (v1–v3) used a different metadata object and a fixed page size of 50:

{
  "data": [],
  "metadata": {
    "page": 1,
    "pages": 7,
    "count": 340,
    "items": 50
  }
}

When migrating to v4, update these field names:

Pre-v4v4Notes
pagestotal_pagesTotal number of pages.
counttotal_countTotal number of items.
itemsper_pagePre-v4 was the count of items on the current page (50 except the last page); v4 per_page is the requested page size.
pageUnchanged — present in both.

v4 also adds a configurable per_page query parameter (pre-v4 was fixed at 50), the offset parameter, and the X-* pagination response headers.

On this page