Every list endpoint returns the newest items first in this envelope:
{
"object": "list",
"data": [ … ],
"has_more": true,
"next_cursor": "c1.9fQ…"
}limit: 1–200, default 50.cursor: passnext_cursorfrom the previous page to continue. Whenhas_moreis false you have everything.- Keep the same filters while paging: a cursor is bound to the key, the endpoint and the filters it was issued for, and is refused (
400 INVALID_REQUEST) anywhere else. Cursors are opaque — never build or edit them. - Lists only ever contain what your key may see; fleet-limited keys page through their fleets only.
$cursor = null;
do {
$page = $api->get('/devices', ['limit' => 200, 'cursor' => $cursor]);
foreach ($page['data'] as $device) {
sync($device);
}
$cursor = $page['next_cursor'];
} while ($page['has_more']);