Documentation Index
Fetch the complete documentation index at: https://docs.spitshake.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
DocuTrust API endpoints that return lists of resources support pagination to keep response sizes manageable. The primary pagination method is cursor-based, which provides stable, performant iteration even as new records are created or deleted. Some endpoints additionally support page-based pagination for simpler random-access use cases.Cursor-Based Pagination
Cursor-based pagination uses resource IDs as cursors. You pass anafter or before parameter to fetch the next or previous page of results.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 10 | Number of items to return per page. Minimum 1, maximum 100. |
after | integer | — | Return items with an ID greater than this value. Use the next cursor from the previous response. |
before | integer | — | Return items with an ID less than this value. Use the prev cursor from the previous response. |
You may pass
after or before, but not both in the same request. If neither is provided, the first page of results is returned.Response Format
Every paginated response includes adata array and a pagination object:
Pagination Object Fields
| Field | Type | Description |
|---|---|---|
count | integer | Number of items returned in the current page (equal to the length of data). |
next | integer or null | The cursor to use as the after parameter to fetch the next page. null when there are no more results. |
prev | integer or null | The cursor to use as the before parameter to fetch the previous page. null when on the first page. |
Example: Fetching the First Page
Example: Fetching the Next Page
Use thenext value from the previous response as the after parameter:
Example: Fetching the Previous Page
Use theprev value from the current response as the before parameter:
Iterating Through All Results
To retrieve every record, loop untilpagination.next is null.
Page-Based Pagination
Some endpoints support traditional page-based pagination as an alternative. This is useful when you need to jump to a specific page or display a page count in a UI.Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | The page number to retrieve (1-indexed). |
per_page | integer | 10 | Number of items per page. Minimum 1, maximum 100. |
Response Format
Page-based responses includetotal and total_pages in the pagination object:
Page-Based Pagination Object Fields
| Field | Type | Description |
|---|---|---|
page | integer | The current page number. |
per_page | integer | The number of items per page. |
total | integer | The total number of items across all pages. |
total_pages | integer | The total number of pages available. |
Example Request
Best Practices
Prefer cursor-based pagination
Prefer cursor-based pagination
Cursor-based pagination is more performant and stable than page-based pagination. Results remain consistent even when records are created or deleted between page fetches. Use it as your default approach.
Use the maximum limit for bulk exports
Use the maximum limit for bulk exports
Set
limit=100 when iterating through all records to minimize the number of API calls and stay within rate limits.Do not construct cursors manually
Do not construct cursors manually
Always use the
next and prev values returned by the API. Cursor values are opaque and their format may change without notice.Handle empty pages gracefully
Handle empty pages gracefully
When
pagination.next is null, there are no more records. Do not make additional requests.Respect rate limits between pages
Respect rate limits between pages
When iterating through very large collections, monitor the
X-RateLimit-Remaining header and add brief delays if needed. See the Errors guide for rate limit details.