Pagination & sorting
Page through collections with cursors and order results with the sort parameter.
Cursor pagination
Collections are paginated with an opaque cursor:
| Parameter | Description |
|---|---|
limit | Records per page, 1–100. Defaults to 25. |
cursor | Opaque cursor from a previous response. |
Each collection response tells you how to continue:
links.next— a ready-to-use URL for the next page (absent on the last page).meta.page.nextCursor— the raw cursor (nullon the last page).
curl "https://actions.einblick.xyz/api/v1/products?limit=50" \
-H "Authorization: Bearer api_YOUR_KEY"A typical loop:
async function fetchAll(resource: string, token: string) {
const records = []
let url = `https://actions.einblick.xyz/api/v1/${resource}?limit=100`
while (url) {
const response = await fetch(url, {
headers: { Authorization: `Bearer ${token}` },
})
const document = await response.json()
records.push(...document.data)
url = document.links.next ?? null
}
return records
}Cursors are opaque and tied to the query that produced them — don't store
them long-term or mix them across different sort orders.
Sorting
Order collections with the sort parameter. Pass one or more
comma-separated field keys; prefix a field with - for descending order:
curl "https://actions.einblick.xyz/api/v1/events?sort=-publishedAt,title" \
-H "Authorization: Bearer api_YOUR_KEY"Sortable keys per resource are the fields flagged sortable: true in
meta.fields, plus the system values slug, sort, publishedAt,
createdAt, and updatedAt.
Invalid sort fields are rejected with 400 Bad Request.