Skip to content

Guides

Pagination

How to paginate, sort and filter collections in the Inspow API.

List endpoints return paginated results and accept common query parameters.

ParameterDescription
limitResults per page (10 by default).
offsetHow many results to skip from the start (0 by default).
pagePage number, starting at 1. If you send it, it takes precedence over offset (offset = (page - 1) × limit).
sortOrder in JSON format, for example {"lastName":1,"createdAt":-1} (1 ascending, -1 descending).
q / searchQuerySearch text.
queryFilter in JSON format (MongoDB style), for example {"status":"active"}. The server only accepts safe operators.
Ventana de terminal
curl "https://api.inspow.tech/api/v1/restaurant/subscriptions?limit=20&page=2&query=%7B%22status%22%3A%22active%22%7D" \
-H "Authorization: Bearer <YOUR_TOKEN>"

Some endpoints also have their own filters, for example from / to (a date range in ISO format) on /audit-logs.

The data comes in data (the list for the page) and the metadata in meta:

{
"data": [ { "_id": "…" } ],
"meta": {
"totalRecords": 134,
"page": 2,
"limit": 20,
"totalPages": 7,
"hasMore": true,
"requestId": "…"
}
}

meta.total also exists, with the same value as totalRecords, but it is deprecated: use totalRecords.