Pagination
Every list endpoint on https://api.paid.ai/v1 returns one page at a time, newest first. Each page tells you whether another follows and gives you a cursor to fetch it, so you can read a list of any length with the same loop.
Use pagination to:
- Read a whole list. Follow
nextCursoruntilhasMoreisfalse. - Control page size. Ask for up to 100 objects a page with
limit. - Resume where you stopped. Keep the last
nextCursorand send it later to continue from the same place.
How it works
- Call a list endpoint without a cursor. You get the newest objects first.
- If
hasMoreistrue, send the page’snextCursoras thecursorquery parameter to get the next page. - Repeat until
hasMoreisfalse. The last page’snextCursorisnull.
Objects are ordered by createdAt, newest first, with id breaking ties, so a page never repeats or skips an object that existed when you started. Objects created after your first request appear only on a new first page.
Query parameters
A list endpoint can take its own filters too, such as a status. Send the same filters with every page: the cursor marks a position in the list, not the filters that made it.
The list object
Every paginated response has the same shape:
Read every page
This loop reads a whole list with curl and jq. It works the same way for every list endpoint.
Cursors
Treat a cursor as an opaque string: don’t build, parse or change one. Only send a cursor to the list that returned it, with the same filters. The API doesn’t check which list produced a cursor, so one from another list or with other filters can silently skip objects. A cursor that isn’t one the API produced returns a 400 invalid_request error with param set to cursor.
A few lists are short, fixed sets, such as the betas your account can use. They return every object in data with no hasMore, nextCursor or limit. The API Reference shows which lists those are.