ListPackageReports, ListCampaigns and GetCampaignPackageReports use the same cursor pagination. ListPackageReports and ListCampaigns also take a since filter for incremental sync. Use pageSize and pageToken to page through results, sortOrder to pick the direction, and since to fetch only what changed after a timestamp.
Cursor pagination
Pass apagination object in the request:
Use
"pageSize": 100 for a bulk backfill, and a smaller value to browse. Use SORT_ORDER_DESCENDING only to see the newest reports first. Keep the default ascending order for sync.
since is a filter, not part of pagination. For example, "filters": {"since": "2026-08-01T00:00:00Z"} fetches only what changed after that time.
The response carries the cursor for the next page:
Repeat until
nextPageToken is empty. Pass it back as pageToken each time:
Ordering
A composite change cursor sets the order. You choose the direction:- Reports use the order
(updatedAt, reportId). Ascending (oldest change first) is the default, and incremental pulls need it. For newest-first browsing, passSORT_ORDER_DESCENDING. - Campaigns use the order
(lastActivityAt, campaignId), with the same directions.
Incremental pull: keep a mirror in sync
A report re-surfaces when its verdict, indicators, or campaign links change. A campaign re-surfaces when it changes. The cursor moves only on a real change, never on a no-op refresh. To pull only what changed since your last sync:1
Keep the default ascending order
Ascending order goes from the oldest change to the newest. This gives you a durable watermark.
2
Track your high-water mark
Store the highest
updatedAt (for reports) or lastActivityAt (for campaigns) you have ingested.3
Pass it as the since filter on the next run
since is a strict greater-than. You never re-fetch a row at that exact timestamp.reportId and upsert, so a repeat just overwrites. A withdrawal is a change too. When withdrawn: true arrives, remove that report on your side.
See Recipes for a complete mirror-and-sync script.
