Skip to main content

Pagination

Every list method returns a cursor envelope:
The default limit is 20. The maximum is 100.
For ergonomics, all list methods are also iterable — the iterator transparently fetches the next page when you reach the end of the current one.
Most retrieval methods accept expand to inline related resources in the same response, à la SQL JOIN. This avoids the N+1 problem.
You can expand up to 3 levels deep, and up to 5 paths per call. Expanding past the limit returns 400 invalid_request_error with code: "expand_too_deep".

What’s expandable on each resource

Anything not in this table is fetched lazily — i.e. you’ll need a separate retrieval call.

Filtering on lists

List methods accept resource-specific filters as parameters:
Refer to each list method’s API reference for the exhaustive list.