Pagination

Each list in the table below comes a page at a time. You choose the page size with limit, and each page gives you a next_cursor to send back for the page after it.

Reading every page

  1. Call the list with the limit you want, written in digits, and no cursor. A blank limit means the default, and so does leaving it out.
  2. Read data, then send the page's next_cursor as the operation's cursor parameter, with the same filters, for the next page.
  3. Stop when next_cursor is null, or, where the list has has_more, when it is false.

Send a cursor back exactly as you received it, and don't build one yourself.

Page sizes

limit takes a whole number from 1 to the largest size below.

OperationDefaultLargestCursor
GET /api/gap/v1/referrals25100starting_after
GET /api/gap/v1/plans/enrollments100200cursor
GET /api/gap/v1/plans/loss-notices100200cursor
GET /api/gap/v1/plans/redemptions200200cursor
GET /api/gap/v1/plans/statements/{id}/lines1001000starting_after
GET /api/gap/v1/eventsAt launch25100starting_after
GET /api/gap/v1/auditAt launch25100starting_after

Lists that come in one answer

These lists take no limit and no cursor: each comes in one answer, and its entry in the reference says how many it can hold.

Each list's cursor

GET /api/gap/v1/referrals

starting_after: Cursor: the previous page's next_cursor (its last referral's id, or with updated_after an opaque u1. cursor). ?starting_after= is the first page; only spaces is refused.

next_cursor: Pass as starting_after for the next page; null on the last page. With updated_after it is never null: has_more says whether to fetch the next page now, and the last page's cursor is where your next poll resumes.

GET /api/gap/v1/plans/enrollments

cursor: The previous page's next_cursor. ?cursor= is the first page; only spaces is refused.

next_cursor: Pass as cursor for the next page; null on the last page.

GET /api/gap/v1/plans/loss-notices

cursor: The previous page's next_cursor. ?cursor= is the first page; only spaces is refused.

GET /api/gap/v1/plans/redemptions

cursor: The previous page's next_cursor. ?cursor= is the first page; only spaces is refused.

GET /api/gap/v1/plans/statements/{id}/lines

starting_after: The previous page's next_cursor, an opaque position in this statement's lines; the page starts after it. Anything else is a 400. ?starting_after= is the first page; only spaces is refused.

next_cursor: Pass as starting_after for the next page; null on the last page.

GET /api/gap/v1/events

starting_after: The previous page's next_cursor: an opaque position, the last event this feed listed to you; the page starts after it. Never an event's id, not even one a webhook delivered: an event can reach the feed after a newer one's webhook has gone out, so a position taken from a webhook would skip it. A cursor works only for the institution and mode it was issued to; anything else is 400 invalid_cursor. ?starting_after= is the first page; only spaces is refused.

next_cursor: Every page has one, the last and an empty one too: where your next poll resumes. Keep the latest and send it as starting_after; has_more says whether to fetch the next page now.

GET /api/gap/v1/audit

starting_after: The previous page's next_cursor, an opaque position; the page starts after it. Anything else is 400 invalid_cursor. Send the same from and to with it. ?starting_after= is the first page; only spaces is refused.

next_cursor: Send as starting_after for the next page, with the same from and to; null on the last page.