Skip to content

Pagination

Lists that can grow long return a page and a cursor:

{ "items": [ … ], "nextCursor": "eyJ0IjoiMjAyNi0xMS0xMFQxNDowMjowMFoifQ" }
  • limit sets the page size: 50 by default, at most 200.
  • Pass nextCursor as cursor to get the next page, with the same filters. nextCursor is null on the last page.
  • A cursor is opaque: do not build or change one. A cursor from another list answers 400 request.invalid_cursor.
Every incident of a project
cursor=""
while :; do
page=$(curl -fsS "https://app.monitorly.cloud/api/v1/projects/$PROJECT/incidents?limit=200${cursor:+&cursor=$cursor}" \
-H "Authorization: Bearer $MONITORLY_TOKEN")
echo "$page" | jq -c '.items[]'
cursor=$(echo "$page" | jq -r '.nextCursor // empty')
[ -n "$cursor" ] || break
done

These lists page, with cursor and limit:

List Operation
List checks GET /api/v1/projects/{projectId}/checks
List check runs GET /api/v1/checks/{checkId}/runs
List incidents GET /api/v1/projects/{projectId}/incidents
List audit events GET /api/v1/workspaces/{workspaceId}/audit
List a page’s email subscribers GET /api/v1/status-pages/{pageId}/subscribers/email

Every other list (projects, nodes, servers, maintenance windows, status pages, alert channels, members, invites, API tokens, escalation policies) answers a plain JSON array with every item at once and takes no cursor. Get response times accepts cursor and limit but ignores them: it answers the whole range.

Filters of each list are in the REST reference.