Most “list” endpoints in the Bluerails API (like listing accounts, payments, or payouts) return results in chunks, or “pages,” rather than all at once. This prevents overly large responses and allows you to fetch data incrementally. We use cursor-based pagination.Documentation Index
Fetch the complete documentation index at: https://docs.bluerails.com/llms.txt
Use this file to discover all available pages before exploring further.
How Cursor Pagination Works
Instead of traditional page numbers, cursor pagination uses an opaquecursor string that points to a specific item in the dataset. To get the next page of results, you provide the cursor received from the previous response.
Query Parameters:
You control pagination using these query parameters on list endpoints:
limit(optional, integer):- Specifies the maximum number of items to return per page.
- Default:
25 - Maximum:
100 cursor(optional, string):- The cursor string obtained from the
next_cursorfield of the previous page’s response. - Omit this parameter entirely for the very first request to get the beginning of the list.
Example Workflow: Listing Accounts
Initial Request(No cursor, limit=50)
Server Response(Data + next_cursor="abc")
Next Request(cursor="abc", limit=50)
Server Response(Data + next_cursor="xyz")
Repeat using latest next_cursor...
Final Response(Data + next_cursor=null)
End of List
-
Initial Request (Get the first page)
- Omit the
cursorparameter. - (See diagram: “Initial Request”)
- Omit the
-
Server Response (First Page)
- The server returns the first 50 accounts and a
next_cursor. - (See diagram: “Server Response (Data + next_cursor=“abc”)”)
- The server returns the first 50 accounts and a
-
Next Request (Get the second page)
- Use the
next_cursorvalue from the previous response as thecursorquery parameter. - (See diagram: “Next Request (cursor=“abc”, limit=50)”)
- Use the
-
Server Response (Second Page)
- The server returns the next 50 accounts and a new
next_cursor. - (See diagram: “Server Response (Data + next_cursor=“xyz”)”)
- The server returns the next 50 accounts and a new
-
Repeat
- Continue making requests, using the latest
next_cursorvalue each time. - (See diagram: “Repeat using latest next_cursor…”)
- Continue making requests, using the latest
-
Final Page
- Eventually, a response will have
next_cursorasnullor omitted, indicating there are no more pages. - (See diagram: “Final Response (Data + next_cursor=null)”)
- Eventually, a response will have