Pagination
List endpoints (messages, campaigns) return results in pages using an opaque cursor. It is stable under inserts, so you never skip or repeat rows.
How it works
Follow the cursor until it runs out.
Each response carries a next_cursor and the per_page size. Pass the cursor back as ?cursor= to fetch the next page. When next_cursor is null, you have reached the end.
| Parameter | Description |
|---|---|
cursor | Opaque cursor from the previous response's next_cursor. |
per_page | Items per page (default 50, max 200). |
status | Optional filter, e.g. ?status=delivered. |
Response shape
Data plus the cursor for the next page.
{
"data": [ /* … items … */ ],
"next_cursor": "eyJpZCI6MTB9",
"per_page": 50
}
Walking every page
Loop until next_cursor is null.
# First page
curl "https://api.helliomessaging.com/v1/messages?per_page=100" \
-H "Authorization: Bearer YOUR_API_TOKEN"
# Next page — pass the cursor you received
curl "https://api.helliomessaging.com/v1/messages?per_page=100&cursor=eyJpZCI6MTB9" \
-H "Authorization: Bearer YOUR_API_TOKEN"
let cursor = null;
do {
const url = new URL("https://api.helliomessaging.com/v1/messages");
url.searchParams.set("per_page", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.HELLIO_API_KEY}` },
});
const page = await res.json();
page.data.forEach(handle);
cursor = page.next_cursor;
} while (cursor);
import os, requests
cursor, headers = None, {"Authorization": f"Bearer {os.environ['HELLIO_API_KEY']}"}
while True:
params = {"per_page": 100}
if cursor:
params["cursor"] = cursor
page = requests.get("https://api.helliomessaging.com/v1/messages", headers=headers, params=params).json()
for row in page["data"]:
handle(row)
cursor = page["next_cursor"]
if not cursor:
break
$cursor = null;
do {
$query = ['per_page' => 100] + ($cursor ? ['cursor' => $cursor] : []);
$page = Http::withToken($apiKey)
->get("https://api.helliomessaging.com/v1/messages", $query)
->json();
foreach ($page['data'] as $row) {
handle($row);
}
$cursor = $page['next_cursor'];
} while ($cursor);
Cursors are opaque, do not parse or construct them yourself. Always use the exact value returned in
next_cursor.