Skip to main content

Pagination

Every list endpoint returns the same envelope and pages the same way, so once you've handled one you've handled all of them. Page sizes differ by endpoint — see the table below before you hard-code one.

The envelope

{
  "data": [ /* the page of results */ ],
  "nextCursor": "eyJ1IjoiMjAyNi0wNi0xN1QwOTo0MTo1NVoiLCJpIjoiYzEifQ"
}
  • data — the array of results for this page.
  • nextCursor — an opaque string. Pass it as cursor on the next request to get the following page. It's null on the last page.

Parameters

limitinteger

Page size. What you get by default, and how high you can go, depends on the endpoint:

EndpointDefaultMaximum
GET /1.0/flows/public50100
GET /1.0/tasks100500
GET /1.0/knowledge-bases100500
GET /1.0/ledger/metrics100500
GET /1.0/ledger/metrics/:id/readings2001,000

Ask for more than the maximum and you get the maximum.

cursorstring

Opaque cursor from the previous response's nextCursor. Omit it for the first page.

Paging through everything

# First page
curl "https://api.zerowidth.ai/1.0/flows/public?limit=50"

# Next page — pass the previous nextCursor
curl "https://api.zerowidth.ai/1.0/flows/public?limit=50&cursor=eyJ1IjoiMjAyNi0…"

Stop when nextCursor comes back null.

2 min read