Pagination
All top-level API resources have support for bulk fetches through “list” API methods. These list API methods share a common structure and accept, at a minimum, the following three parameters: limit
, starting_after
, and ending_before
.
The list API methods use cursor-based pagination through the starting_after
and ending_before
parameters. Both parameters accept an existing object ID value and return objects in reverse chronological order. The ending_before
parameter returns objects listed before the named object. The starting_after
parameter returns objects listed after the named object. These parameters are mutually exclusive. You can use either the starting_after
or ending_before
parameter, but not both simultaneously.
limit
number
starting_after
string
A cursor to use in pagination. starting_after
is an object ID that defines your place in the list. For example, if you make a list request and receive 100 objects, ending with ID 4290c6c6-e505-4855-ae88-7f1b060562ce
, your subsequent call can include starting_after=4290c6c6-e505-4855-ae88-7f1b060562ce
to fetch the next page of the list.
ending_before
A cursor to use in pagination. ending_before
is an object ID that defines your place in the list. For example, if you make a list request and receive 100 objects, starting with 4290c6c6-e505-4855-ae88-7f1b060562ce
, your subsequent call can include ending_before=4290c6c6-e505-4855-ae88-7f1b060562ce
to fetch the previous page of the list.