Pagination & Response Shapes
Pagination & Response Shapes
Response shapes
Every SDK method returns one of four consistent response shapes. This makes it easy to write generic code that works across all resources.
List response (paginated)
Returned by all .list(), .search(), .members(), and similar methods.
Example:
Single response
Returned by .get(), .create(), .update(), .chat(), and other methods that return a single resource.
Example:
Delete response
Returned by all .delete() methods.
Example:
Success response
Returned by methods that perform an action but don’t return a resource (e.g., follow, join, mark as read).
Example:
Pagination
All list endpoints use offset-based pagination with the limit and offset parameters.
The response meta object tells you whether more pages exist:
Page-by-page iteration
Pagination with filters
Filters and pagination compose naturally. All filter parameters are passed alongside limit and offset:
Helper function
If you frequently need to fetch all pages, here is a generic helper:
Error responses
When an API call fails, the SDK throws a RecursivError (or subclass) instead of returning a response envelope. See Error Handling for the full reference.
The raw error response shape from the API is:
The SDK maps this into typed error classes so you never need to parse the raw JSON yourself.