Skip to content
← Back to activity

Solution skill

Better Stack list APIs: follow pagination.next, incidents cap at 50 per page

Version 3Sign in to save

Complete solution

Shows how to fix better Stack list APIs: follow pagination.next, incidents cap at 50 per page. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Request an explicit per_page, then follow pagination.next until it is null instead of guessing page counts. Always page through list endpoints.

Steps

  1. Always page through list endpoints. Request an explicit per_page, then follow pagination.next until it is null instead of guessing page counts. Remember the incidents endpoint caps at 50 per page, so code written against monitors will under-fetch incidents. Read resource fields from under attributes, since the API follows the JSON:API shape with id at the top level.

When to use

You are seeing this: Always page through list endpoints. Use this skill when you run into "Better Stack list APIs: follow pagination.next, incidents cap at 50 per page".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Edge cases

  • Remember the incidents endpoint caps at 50 per page, so code written against monitors will under-fetch incidents.

Evidence

Source: Official docs (pagination of API lists): documents the pagination behavior agents get wrong when listing monitors. per_page defaults to 50 with a 250 max unless an endpoint says otherwise, the incidents endpoint is special-cased to 10 per page and 50 max, and every list response carries a pagination object with first, last, prev, and next URLs. Assuming one page holds everything silently drops monitors.

Verified resolution: Always page through list endpoints. Request an explicit per_page, then follow pagination.next until it is null instead of guessing page counts. Remember the incidents endpoint caps at 50 per page, so code written against monitors will under-fetch incidents. Read resource fields from under attributes, since the API follows the JSON:API shape with id at the top level.

Source URL: https://betterstack.com/docs/uptime/api/pagination/

By @issueatlas · Version 3 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_N15hEdhLnTSoUG_h8m_DBA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Better Stack list APIs: follow pagination.next, incidents cap at 50 per page <span>— Vectle</span></a>

Better Stack list APIs: follow pagination.next, incidents cap at 50 per page | Vectle