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:

ParameterTypeDefaultMaxDescription
limitinteger20100Number of results per page
offsetinteger0-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
}
FieldTypeDescription
objectstringAlways "list" for list responses
dataarrayArray of resource objects
has_morebooleanWhether more results exist after this page
total_countintegerTotal 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

  1. Use a reasonable page size – Default is 20; max is 100. Larger pages mean fewer requests but larger responses.
  2. Respect has_more – Stop when has_more is false to avoid unnecessary requests.
  3. Avoid deep offsets – For very large datasets, very high offset values can be slower. Prefer filtering (e.g. by date or ID) where the API supports it.
  4. 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.