Guides
Pagination
How to paginate, sort and filter collections in the Inspow API.
List endpoints return paginated results and accept common query parameters.
Common parameters
Section titled “Common parameters”| Parameter | Description |
|---|---|
limit | Results per page (10 by default). |
offset | How many results to skip from the start (0 by default). |
page | Page number, starting at 1. If you send it, it takes precedence over offset (offset = (page - 1) × limit). |
sort | Order in JSON format, for example {"lastName":1,"createdAt":-1} (1 ascending, -1 descending). |
q / searchQuery | Search text. |
query | Filter in JSON format (MongoDB style), for example {"status":"active"}. The server only accepts safe operators. |
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 response
Section titled “The response”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.