Pagination
List endpoints return a page at a time. Send the page’s next cursor back as cursor, with the same other parameters, until it’s null.
Where the cursor is
Section titled “Where the cursor is”| Endpoints | Next cursor | limit |
|---|---|---|
/v1/users, /v1/teams, /v1/insights/people, /v1/insights/work-statuses |
meta.page.nextCursor |
Default 100, up to 500 |
/v1/work-statuses (preview) |
nextCursor, at the top level |
Default 500, up to 1,000 |
/v1/offices and the single-result endpoints |
Not paginated | — |
meta.page.totalCount tells you how many rows match across all pages.
- Send the cursor with exactly the same filters, sorting and
referenceDate. A changed query gets400 INVALID_CURSOR. - If you didn’t send
referenceDate, take the resolved one frommeta.referenceDateand send it from the second page on. - Pages aren’t a snapshot, so changes made while you page can show up on later pages.
- Pace yourself. Reports and work statuses allow 5 requests a minute, so wait about 12 seconds between pages. See Rate limits.
- CSV exports aren’t paginated:
cursorandlimitaren’t allowed withformat=csv.
Example
Section titled “Example”curl "https://api.officelycrew.com/v1/users?limit=100" \ -H "Authorization: Bearer $OFFICELY_API_TOKEN"The meta part of the response, trimmed from the UsersExample in openapi.json:
{ "meta": { "generatedAt": "2026-10-15T12:00:00Z", "referenceDate": "2026-10-15", "selection": { "officeIds": [], "teamIds": [], "userIds": [] }, "page": { "limit": 100, "nextCursor": null, "totalCount": 1 } }}Here nextCursor is null, so this is the last page. Otherwise, call again with cursor=<nextCursor>&referenceDate=2026-10-15.
The same loop in Python, using only the standard library:
import json, os, time, urllib.error, urllib.parse, urllib.request
BASE = "https://api.officelycrew.com"TOKEN = os.environ["OFFICELY_API_TOKEN"]
def get(path, params): url = f"{BASE}{path}?{urllib.parse.urlencode(params)}" req = urllib.request.Request(url, headers={"Authorization": f"Bearer {TOKEN}"}) while True: try: with urllib.request.urlopen(req) as r: return json.load(r) except urllib.error.HTTPError as e: if e.code != 429: raise time.sleep(int(e.headers.get("Retry-After", "60")))
params = {"from": "2026-10-01", "to": "2026-10-31", "types": "office", "limit": 500}rows = []while True: page = get("/v1/insights/work-statuses", params) rows += page["data"] cursor = page["meta"]["page"]["nextCursor"] if cursor is None: break params["cursor"] = cursor params["referenceDate"] = page["meta"]["referenceDate"] time.sleep(12) # 5 requests a minuteFor the preview /v1/work-statuses, read page["nextCursor"] instead.
Did this answer your question?Thanks for letting us know.
Related
Still need help? Chat to our support team.
Contact support