Pagination
Paginated list endpoints return a bare JSON array. The API accepts page and
per_page query parameters and returns pagination metadata in response headers.
The convention applies to lists such as /wins, /spaces, and /tags.
Query parameters
Section titled “Query parameters”| Parameter | Type | Default | Range | Description |
|---|---|---|---|---|
page | integer | 1 | 1 or greater | Page number |
per_page | integer | 25 | 1 through 100 | Number of items per page |
Values below the minimum are clamped. Values above the maximum are clamped to 100.
Response headers
Section titled “Response headers”| Header | Description |
|---|---|
X-Total-Count | Total number of matching records |
X-Page | Current page number |
X-Per-Page | Effective page size |
Example request:
curl 'https://app.myhypedoc.com/api/v1/wins?page=2&per_page=10' \ -H "Authorization: Bearer $HYPEDOC_TOKEN"Example headers:
X-Total-Count: 47X-Page: 2X-Per-Page: 10The response contains items 11 through 20. A page beyond the last page returns an empty array. Calculate the number of pages as:
ceil(X-Total-Count / X-Per-Page)