Pagination
List endpoints in the Crane Ledger REST API support pagination so you can fetch large result sets in manageable chunks. This page describes the parameters and response format used for pagination.
Query Parameters
List endpoints accept these query parameters:
| Parameter | Type | Default | Max | Description |
|---|---|---|---|---|
limit | integer | 20 | 100 | Number of results per page |
offset | integer | 0 | - | Number of results to skip |
Examples
# First page (default: 20 items)
GET /organizations/org_123/accounts
# Next 50 items
GET /organizations/org_123/accounts?limit=50&offset=0
# Second page of 50
GET /organizations/org_123/accounts?limit=50&offset=50
# Third page of 50
GET /organizations/org_123/accounts?limit=50&offset=100
List Response Format
Paginated list responses use a consistent structure:
{
"object": "list",
"data": [
{
"id": "act_xxxxxxxxxxxxxxxx",
"object": "account",
"name": "Cash",
"code": "1000",
"type": "asset"
}
],
"has_more": true,
"total_count": 142
}
| Field | Type | Description |
|---|---|---|
object | string | Always "list" for list responses |
data | array | Array of resource objects |
has_more | boolean | Whether more results exist after this page |
total_count | integer | Total number of items (when available) |
When has_more is true, request the next page by increasing offset by your limit (e.g. offset=20, then offset=40 for limit=20).
Pagination Examples
Fetching All Pages
Cursor-Style with limit Only
If you only need a fixed window (e.g. “first 100”), use limit and optionally offset:
# First 100 transactions
GET /organizations/org_123/transactions?limit=100
# Skip first 200, get next 50
GET /organizations/org_123/transactions?limit=50&offset=200
Best Practices
- Use a reasonable page size – Default is 20; max is 100. Larger pages mean fewer requests but larger responses.
- Respect
has_more– Stop whenhas_moreisfalseto avoid unnecessary requests. - Avoid deep offsets – For very large datasets, very high
offsetvalues can be slower. Prefer filtering (e.g. by date or ID) where the API supports it. - Cache when appropriate – List endpoints that change infrequently (e.g. chart of accounts) can be cached and refreshed periodically.
Filtering and sorting
Many list endpoints support extra query parameters (e.g. type, status, start_date, end_date). Combining these with limit and offset lets you page through filtered result sets. See the API Reference for each resource.
Need help?
Create a free account to access our support portal. Once signed in, use the Support tab in your dashboard to submit a support ticket — our team typically responds within 24 hours.
- ✨ For LLMs/AI assistants: Read our structured API reference