How to walk a list endpoint to the end, which field to follow, and the two that are always null.
Follow next_cursor. Send it back as cursor on the next call, and stop when the response omits it.
cURL
curl -X POST "https://api.mixpeek.com/v1/collections/list?limit=100" \ -H "Authorization: Bearer YOUR_MIXPEEK_API_KEY" \ -H "X-Namespace: ns_your_namespace_id"# then, for each subsequent page:curl -X POST "https://api.mixpeek.com/v1/collections/list?limit=100&cursor=CURSOR_FROM_LAST_RESPONSE" \ -H "Authorization: Bearer YOUR_MIXPEEK_API_KEY" \ -H "X-Namespace: ns_your_namespace_id"
next_page and previous_page are always null. They are deprecated and no endpoint populates them.A loop that treats next_page: null as “last page” stops after the first page and reads as a completed walk. That is the failure this page exists to prevent: a namespace with 130 collections returning its first 100 and nothing signalling that 30 were missed.
Every list endpoint accepts all of these as query parameters. Pick one style and keep to it.
Parameter
Means
cursor
Where to resume. The value comes from the previous response’s next_cursor
next_cursor, after
Aliases for cursor. If you send cursor too, cursor wins
limit
How many items to return
page_size
Alias for limit
offset
Skip this many items
page
Alias for offset, in pages rather than items
include_total
Defaults to false. Setting it adds a count, and 50 to 200ms
next_cursor and after are accepted as aliases specifically because the response calls the field next_cursor, so sending it straight back is the natural thing to do. An undeclared query parameter is dropped silently before any handler sees it, which is what made an earlier version of this loop run forever.