Concepts
Pagination
Every endpoint that returns a list returns one page at a time, newest first. Ask for the next page with the cursor from the one before.
The list shape
Response · 200
{
"object": "list",
"data": [
"…up to `limit` items…"
],
"has_more": true,
"next_cursor": "eyJvIjoyMH0"
}data— the items on this page.has_more—truewhen another page follows.next_cursor— pass it ascursorto get that page;nullon the last page.
Parameters
limit— how many items per page, from 1 to 100. Default 20.cursor— thenext_cursorof the previous page. Leave it out for the first page.
Keep every other filter the same while you follow a cursor: a cursor belongs to the query that produced it.
A cursor is opaque. Do not build or decode one yourself — its format may change. Calls that arrive while you page can shift later pages by a few items, so de-duplicate by
id when you need an exact copy.Fetching every page
Every call
// Fetch every call, one page at a time.
async function* allCalls() {
let cursor = null;
do {
const url = new URL('https://api.voximate.no/public/v1/calls');
url.searchParams.set('limit', '100');
if (cursor) url.searchParams.set('cursor', cursor);
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.VOXIMATE_API_KEY}` },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const page = await res.json();
yield* page.data;
cursor = page.has_more ? page.next_cursor : null;
} while (cursor);
}
for await (const call of allCalls()) {
console.log(call.id, call.status);
}List endpoints
- GET /agents — List agents
- GET /calls — List calls
- GET /phone-numbers — List phone numbers
- GET /webhooks — List webhook endpoints
- GET /webhooks/{webhook_id}/deliveries — List deliveries