Pagination

Cursor-based paging on list endpoints

View as Markdown

Cursor-paginated collection endpoints return this envelope:

1{
2 "data": [ /* ... */ ],
3 "next_cursor": "eyJpZCI6MTIzfQ==",
4 "has_more": true
5}
  • data — the page of records.
  • next_cursor — an opaque base64 cursor for the next page (null on the last page).
  • has_moretrue when more pages exist after this one.

This applies to workspaces, documents, contacts, bank accounts, bank statements, and transactions. Bank-account notification preferences return a bounded { data } list without a cursor.

Walking the pages

Call without a cursor to start, then pass the previous response’s next_cursor as the cursor query parameter until has_more is false:

$# First page
$curl "https://app.lucanto.eu/api/v1/workspaces/{workspace_id}/invoices?limit=25" \
> -H "Authorization: Bearer lct_pat_xxx"
$
$# Next page
$curl "https://app.lucanto.eu/api/v1/workspaces/{workspace_id}/invoices?limit=25&cursor=eyJpZCI6MTIzfQ==" \
> -H "Authorization: Bearer lct_pat_xxx"

Parameters

ParamDefaultMaxNotes
limit25100Items per page
cursorOpaque; pass the previous next_cursor verbatim

Cursors are keyset-based (stable under inserts), so paging never skips or duplicates rows the way offset paging can. Treat the cursor as opaque — don’t decode or construct it yourself.

Sorting

Document lists (invoices, quotes, proformas, credit notes) and transactions accept optional sort and order query parameters:

$curl "https://app.lucanto.eu/api/v1/workspaces/{workspace_id}/invoices?sort=created_at&order=asc" \
> -H "Authorization: Bearer lct_pat_xxx"
ParamValuesDefault
sortcreated_atunset → newest first
orderasc, descdesc
  • An unknown sort value is ignored (you get the default order, not an error).
  • contacts, bank_accounts, and bank_statements don’t support sorting yet.
  • Sorting composes with cursors — the keyset tiebreak keeps paging stable.

Filtering

Some list endpoints accept filters that compose with pagination. Contacts support q name search; transactions support account, date, matching-status, kind=credit|debit, and full-text filters; bank statements support account, period overlap, file type, source, and extraction-status filters.