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 ascursoron the next request to get the following page. It'snullon the last page.
Parameters
limitintegerPage size. What you get by default, and how high you can go, depends on the endpoint:
| Endpoint | Default | Maximum |
|---|---|---|
GET /1.0/flows/public | 50 | 100 |
GET /1.0/tasks | 100 | 500 |
GET /1.0/knowledge-bases | 100 | 500 |
GET /1.0/ledger/metrics | 100 | 500 |
GET /1.0/ledger/metrics/:id/readings | 200 | 1,000 |
Ask for more than the maximum and you get the maximum.
cursorstringOpaque 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