Filtering and Pagination
8 min
list endpoints use cursor pagination and resource specific query filters the same rules apply to transactions, vaults, contacts, and bank accounts supported list endpoints resource endpoint javascript sdk transactions get /api/external/transactions/ gettransactions() vaults get /api/external/vaults/ getvaults() contacts get /api/external/contacts/ getcontacts() bank accounts get /api/external/bank accounts/ getbankaccounts() query parameters parameter type required description limit number no requested page size the javascript sdk default is 20 cursor string | null no opaque cursor returned by the preceding page omit it or send an empty value for the first page resource filters string no endpoint specific filters supplied through record\<string, string> filters are query string values preserve the same filters and page size while following a cursor chain first page request the json below is a documentation representation of url parameters; it is not sent as a request body { "query" { "limit" 20, "cursor" null, "vaultname" "treasury" } } equivalent request get /api/external/vaults/?limit=20\&cursor=\&vaultname=treasury cursor response interface cursorlistresponse\<t> { results t\[]; nextcursor? string | null; hasnext? boolean; } { "results" \[ { "id" "vault 123", "vaultname" "treasury vault" } ], "nextcursor" "eyjpzci6inzhdwx0xzeymyj9", "hasnext" true } treat nextcursor as opaque do not decode it, edit it, construct it, or infer record ordering from it javascript sdk example let cursor string | null | undefined = null; do { const page = await apiclient getvaults( { vaultname "treasury" }, 20, cursor, ); for (const vault of page results) { console log(vault id, vault vaultname); } cursor = page hasnext ? page nextcursor null; } while (cursor); pagination rules start with a null or empty cursor continue only when hasnext === true and nextcursor is present reuse the preceding nextcursor exactly keep filters and page size stable across the cursor chain do not mix cursor responses with legacy page number fields such as count , next , or previous restart from the first page when filters or sort inputs change do not assume an empty results array means there can never be another page; follow hasnext filtering rules send only filters documented by the resource page encode every filter value as a string when using the sdk filter map treat ids as opaque and organization scoped never use a filter to bypass the api user's organization or sub organization permissions when a value is optional, omit the filter instead of sending the string "undefined" or "null"