Pagination
How lists come back one page at a time, how to follow the cursor to the end, and what makes a cursor stop working.
Every list in the API answers one page at a time and hands you a cursor for the next page. Lists page by keyset, not by offset, so a page never skips or repeats an object, even while objects are added.
Ask for a page
Two query parameters control a page:
| Parameter | What it does |
|---|---|
limit | How many objects one page holds: 1 to 100, 20 when you leave it out. |
cursor | The nextCursor of the page before. Leave it out for the first page. |
GET/servicesReference
curl https://api.clouduxe.com/v1/services \
-H "Authorization: Bearer $CLOUDUXE_API_KEY"import { Clouduxe } from "@clouduxe/sdk";
const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY });
for await (const service of cx.services.list()) {
console.log(service.id);
}import os
import requests
res = requests.get(
"https://api.clouduxe.com/v1/services",
headers={
"Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}",
},
)
page = res.json()<?php
require 'vendor/autoload.php';
$cx = new \Clouduxe\Clouduxe(['apiKey' => getenv('CLOUDUXE_API_KEY')]);
foreach ($cx->services->list() as $service) {
echo $service->id, PHP_EOL;
}const res = await fetch("https://api.clouduxe.com/v1/services", {
headers: {
Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`,
},
});
const page = await res.json();{
"object": "list",
"data": [
{
"object": "service",
"id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d",
"type": "vps",
"status": "active",
"suspensionReason": null,
"deletesAt": null,
"planId": "vps-nvme-4-mumbai",
"planName": "NVMe VPS 4 GB",
"region": "mumbai",
"label": "node1",
"reference": "client-4471",
"metadata": {
"whmcsServiceId": "18342",
"plan": "starter"
},
"firewallAvailable": true,
"billing": {
"cycleMonths": 1,
"price": {
"amount": 129900,
"currency": "INR"
},
"currentPeriodStart": "2026-12-04",
"paidThrough": "2027-01-03",
"cancelAtPeriodEnd": false,
"endsOn": null
},
"server": {
"powerState": "running",
"hostname": "node1.acme.example",
"ipv4": [
"203.0.113.24"
],
"ipv6": [
"2001:db8:4f2a::24"
],
"image": {
"object": "image",
"id": "ubuntu-24.04",
"name": "Ubuntu 24.04 LTS",
"family": "linux"
},
"resources": {
"cpuCores": 2,
"memoryMb": 4096,
"diskGb": 80,
"trafficGb": 4000
},
"statusUpdatedAt": "2026-12-04T10:02:41Z",
"stale": false
},
"proxy": null,
"createdAt": "2026-12-04T09:15:24Z",
"livemode": true
},
{
"object": "service",
"id": "4e9b2d7a-1c6f-4b3e-a8d2-7f5c0e9a1b4d",
"type": "dedicated",
"status": "provisioning",
"suspensionReason": null,
"deletesAt": null,
"planId": "dedicated-e5-64-limburg",
"planName": "Dedicated E5 64 GB",
"region": "limburg",
"label": "db-primary",
"reference": "client-4471",
"metadata": {},
"firewallAvailable": false,
"billing": {
"cycleMonths": 1,
"price": {
"amount": 1149900,
"currency": "INR"
},
"currentPeriodStart": "2026-12-04",
"paidThrough": "2027-01-03",
"cancelAtPeriodEnd": false,
"endsOn": null
},
"server": {
"powerState": "unknown",
"hostname": "db1.acme.example",
"ipv4": [],
"ipv6": [],
"image": null,
"resources": null,
"statusUpdatedAt": null,
"stale": false
},
"proxy": null,
"createdAt": "2026-12-03T14:40:05Z",
"livemode": true
},
{
"object": "service",
"id": "a7d4c1e9-3f2b-4d8a-9c6e-0b5a2f7d3e1c",
"type": "proxy",
"status": "active",
"suspensionReason": null,
"deletesAt": null,
"planId": "proxy-game-standard",
"planName": "Protected Proxy Standard",
"region": null,
"label": "game-proxy",
"reference": "client-5102",
"metadata": {},
"firewallAvailable": false,
"billing": {
"cycleMonths": 1,
"price": {
"amount": 249900,
"currency": "INR"
},
"currentPeriodStart": "2026-12-04",
"paidThrough": "2027-01-03",
"cancelAtPeriodEnd": false,
"endsOn": null
},
"server": null,
"proxy": {
"profile": "fivem",
"ports": [
{
"protocol": "tcp",
"portStart": 30120,
"portEnd": 30120
},
{
"protocol": "udp",
"portStart": 30120,
"portEnd": 30120
}
]
},
"createdAt": "2026-11-28T11:02:19Z",
"livemode": true
}
],
"hasMore": true,
"nextCursor": "eyJsIjoic2VydmljZXMiLCJjIjoiMjAyNi0xMi0wNFQwOToxNToyMloifQ.x7Hq2N"
}Other responses
400Bad requestcursor_invalid, version_invalid, parameter_invalid
{
"error": {
"type": "invalid_request_error",
"code": "cursor_invalid",
"message": "The cursor is malformed, has expired, or belongs to a list with other filters.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#cursor_invalid"
}
}Also answered with this status: version_invalid, parameter_invalid.
401Unauthorizedtoken_missing, token_invalid, token_expired, token_revoked
{
"error": {
"type": "authentication_error",
"code": "token_missing",
"message": "No API token was sent. Send it as Authorization: Bearer <token>.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#token_missing"
}
}Also answered with this status: token_invalid, token_expired, token_revoked.
403Forbiddenip_not_allowed, api_access_disabled, scope_missing
{
"error": {
"type": "permission_error",
"code": "ip_not_allowed",
"message": "This request came from an address outside the token's IP allowlist.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#ip_not_allowed"
}
}Also answered with this status: api_access_disabled, scope_missing.
429Too many requestsrate_limited
{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#rate_limited"
}
}500Server errorinternal_error
{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "An unexpected error occurred. It has been logged with this request id.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#internal_error"
}
}503Unavailableunavailable
{
"error": {
"type": "api_error",
"code": "unavailable",
"message": "The API is briefly unavailable.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#unavailable"
}
}Read the page
A page is a list object:
| Field | What it holds |
|---|---|
object | Always list. |
data | The objects on this page. |
hasMore | Whether another page follows. |
nextCursor | The cursor for the next page, or null when hasMore is false. |
Walk every page
Keep asking with the last nextCursor until hasMore is false. At 100
objects a page, the read limit lets one token list about 2,000 objects a second.
let cursor;
do {
const url = new URL("https://api.clouduxe.com/v1/services");
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}` },
});
const page = await res.json();
for (const service of page.data) console.log(service.id);
cursor = page.hasMore ? page.nextCursor : undefined;
} while (cursor);The Node and PHP SDKs do this for you: their list methods return an iterator that fetches each page as you reach it.
When a cursor stops working
A cursor is opaque: do not build or change one. It is tied to the list's
filters and your token's account, and it lasts 24 hours. Using it with other
filters, from another account or after it expires answers 400
cursor_invalid. Start the list again without a
cursor.