Pagination
All list endpoints use cursor-based pagination. This approach is more efficient than offset-based pagination for large datasets and avoids the “shifting window” problem when records are added or removed.
Query parameters
Section titled “Query parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 25 | Number of items per page. Min: 1, Max: 100. |
cursor | string | — | Cursor from a previous response to fetch the next page. |
Response format
Section titled “Response format”List responses include a meta object with pagination info:
{ "data": [ ... ], "meta": { "count": 25, "hasMore": true, "nextCursor": "cm5x9abc123" }}| Field | Type | Description |
|---|---|---|
count | number | Number of items in the current page. |
hasMore | boolean | true if more items exist after this page. |
nextCursor | string | null | Cursor to pass as the cursor parameter for the next page. null if no more pages. |
Paginating through results
Section titled “Paginating through results”To fetch all items, keep requesting the next page until hasMore is false:
# First pagecurl "https://app.insigner.co/api/v1/documents?limit=10" \ -H "Authorization: Bearer isk_YOUR_API_KEY"
# Next page (using nextCursor from previous response)curl "https://app.insigner.co/api/v1/documents?limit=10&cursor=cm5x9abc123" \ -H "Authorization: Bearer isk_YOUR_API_KEY"async function fetchAllDocuments(apiKey) { const documents = []; let cursor = undefined;
do { const url = new URL('https://app.insigner.co/api/v1/documents'); url.searchParams.set('limit', '100'); if (cursor) url.searchParams.set('cursor', cursor);
const res = await fetch(url, { headers: { 'Authorization': `Bearer ${apiKey}` } }); const json = await res.json();
documents.push(...json.data); cursor = json.meta.hasMore ? json.meta.nextCursor : null; } while (cursor);
return documents;}import requests
def fetch_all_documents(api_key): documents = [] cursor = None
while True: params = {"limit": 100} if cursor: params["cursor"] = cursor
res = requests.get( "https://app.insigner.co/api/v1/documents", headers={"Authorization": f"Bearer {api_key}"}, params=params ) data = res.json() documents.extend(data["data"])
if not data["meta"]["hasMore"]: break cursor = data["meta"]["nextCursor"]
return documents