Pagination
List responses vary by operation — check the shape before you assume one.
Last updated on
There is no one pagination scheme across the whole API. Check the reference for the operation you are calling. Three shapes exist:
Cursor, with nextCursor
The simplest shape, used by log-style lists such as usage.events:
{
"items": [ { "id": 1042, "surface": "api", "operation": "/posts", "status": "ok", "...": "..." } ],
"nextCursor": 1001
}Pass the last id back as cursor to get the next page. No nextCursor in the response means you have reached the end.
curl "https://app.postonus.com/api/v1/usage/events?limit=25" -H "x-api-key: $POSTONUS_API_KEY"
curl "https://app.postonus.com/api/v1/usage/events?limit=25&cursor=1001" -H "x-api-key: $POSTONUS_API_KEY"Keyset cursor, for time-ordered lists
schedules.list (the calendar view) pages by a compound cursor of (scheduledAt, id), because a bare id cursor against a time-ordered list drops entries scheduled in the same minute:
{
"schedules": [ { "...": "..." } ],
"nextCursor": { "scheduledAt": "2026-08-20T09:00:00.000Z", "id": "sch_..." },
"hasMore": true
}Pass nextCursor back as the cursor object on the next request. hasMore: false means you are on the last page.
Page and limit, for everything else
posts.list pages the ordinary way, with page and limit query parameters:
{
"items": [ { "...": "..." } ],
"pageInfo": {
"page": 1,
"limit": 10,
"total": 42,
"totalPages": 5,
"hasNextPage": true,
"hasPreviousPage": false
}
}Increment page while pageInfo.hasNextPage is true.