Skip to content

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.

ParameterTypeDefaultRangeDescription
pageinteger11 or greaterPage number
per_pageinteger251 through 100Number of items per page

Values below the minimum are clamped. Values above the maximum are clamped to 100.

HeaderDescription
X-Total-CountTotal number of matching records
X-PageCurrent page number
X-Per-PageEffective page size

Example request:

Terminal window
curl 'https://app.myhypedoc.com/api/v1/wins?page=2&per_page=10' \
-H "Authorization: Bearer $HYPEDOC_TOKEN"

Example headers:

X-Total-Count: 47
X-Page: 2
X-Per-Page: 10

The 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)