Skip to main content
All list endpoints in the ByDoctor API return paginated responses. Rather than using traditional page-number pagination, the API uses cursor-based pagination — a technique that is more reliable and performant when working with large or frequently-updated datasets. Instead of asking for “page 3”, you ask for “the next batch after this specific record”, which prevents duplicate or missing items if the underlying data changes between requests.

Query Parameters

Every list endpoint accepts the following pagination query parameters:
Set limit to the largest value your use case can process at once (up to 100) to minimize the number of round trips when fetching large datasets.

Response Envelope

Every list response wraps results in a consistent JSON envelope:
The meta object contains the fields you need to drive pagination logic:
Cursor strings are opaque — they are base64-encoded and their internal structure may change. Treat them as black-box tokens and never attempt to construct or decode them manually.

Iterating Through All Pages

To retrieve all records from a list endpoint, keep making requests using the next_cursor from the previous response until has_more is false. The following JavaScript example demonstrates this pattern for fetching all appointments:
Avoid fetching all pages simultaneously in parallel. Because cursors encode a position in the dataset at a point in time, each cursor must be obtained from the previous response. Fire requests sequentially.

Filtering

Most list endpoints accept additional query parameters to narrow results without changing the pagination behavior. Filters combine with limit and cursor in the same query string.
Example — fetch confirmed appointments for a specific professional this week:

Sorting

The default sort order for all list endpoints is created_at DESC — newest records first. For the /v1/appointments endpoint you can override sorting using the sort and order parameters: Example — fetch upcoming appointments in chronological order:
Cursors are tied to the sort order used when they were generated. If you change the sort or order parameters mid-pagination, you must restart from the first page (omit the cursor parameter).