Skip to content

Load every page

Some lists are too large to return at once. Mochi returns one page of results and a cursor for the next page. A cursor is an opaque continuation value: use it exactly as returned and do not try to read meaning from it.

Follow the pages

  1. Make the first request without a cursor.
  2. Process the returned data.
  3. If next_cursor contains a value, send that exact value as the next request's cursor.
  4. Stop when next_cursor is null.

Parameters

ParameterDescription
page_sizeNumber of records requested. Default: 50; maximum: 100.
cursorContinuation value returned in the previous response. Leave it out for the first page.

Example first page:

http
GET /v1/leads/?page_size=50

Example response:

json
{
  "data": [],
  "next_cursor": "opaque-value"
}

Request the next page by passing the value unchanged:

http
GET /v1/leads/?page_size=50&cursor=opaque-value

Do not parse, modify, generate, or store business meaning in a cursor. Mochi may reject a changed or old cursor. Treat that as an error. Do not silently restart at page one, because that can duplicate a full export.