Pagination
An endpoint that returns many things returns them a page at a time, as a list.
A page#
JSON
{
"object": "list",
"data": [
{ "object": "enrolment", "id": "pe8fdsi3tthy5hsaacus8cg5bfms" },
{ "object": "enrolment", "id": "pe3kq8xgmzt1fbyw5n6sdj9cahro" }
],
"has_more": true,
"next_cursor": "pe3kq8xgmzt1fbyw5n6sdj9cahro"
}Parameters#
| Parameter | Default | Meaning |
|---|---|---|
limit |
20 | How many to return, from 1 to 100. |
starting_after |
none | A next_cursor from the page before. |
Shell
curl "https://api.welly.no/v1/enrolments?limit=50&starting_after=pe3kq8xgmzt1fbyw5n6sdj9cahro" \
-H "Authorization: Bearer wk_test_…"Walking through a list#
Ask for the first page, then pass each page's next_cursor as starting_after until has_more is false.
A list is always in a fixed order, newest first unless the endpoint says otherwise. Cursors, not page numbers, mean a page does not shift when something new is added while you read.
Lists have no total count. Counting everything is slow and rarely needed; walk the list if you need it.