Pagination
Learn how to page through list endpoints using page and limit query parameters and the standard response envelope.
Overview
List endpoints use offset pagination. Pass page and limit as query parameters.
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| page | number | 1 | 1-based page number. |
| limit | number | 10 | Records per page. Max 100 on tickets, wallet transactions, and shipping labels. Campaign details employees default to 50. |
curl -X GET 'https://uat.unduit.com/api-exposed/api/v1/employees?page=2&limit=25' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json'Response envelope
Paginated responses include snake_case metadata alongside the result array. Endpoints that wrap payloads in success / message / data still use the same pagination fields at the top level.
| Field | Type | Description |
|---|---|---|
| current_page | number | Current page number (1-based). |
| total_pages | number | Total number of pages available. |
| total | number | Total matching records across all pages. |
| per_page | number | Page size used for this response (matches limit). |
| from | number | null | 1-based index of the first record on this page. null when total is 0. |
| to | number | null | 1-based index of the last record on this page. null when total is 0. |
{
"current_page": 2,
"total_pages": 5,
"total": 47,
"per_page": 10,
"from": 11,
"to": 20
}The result array key varies by endpoint — for example users, orders, assets, data, labels, or campaigns. Some endpoints also include a resource-specific total field such as total_users or total_orders alongside total.
Paginated endpoints
| Resource | Endpoint | Array key |
|---|---|---|
| Employees | /employees | users |
| Assets | /assets | assets |
| Team users | /team-users | users / invitations |
| Orders | /itad/orders, /deployment/orders, … | orders |
| Tickets | /tickets | data |
| Wallet transactions | /wallet/transactions | data |
| Legal hold | /legal-hold/active-holds | data |
| Shipping labels | /shipping/labels | labels |
| Recover campaigns | /recover/campaigns | campaigns |
| Campaign employees | /recover/campaign/:id | employees |
Fetching all pages
Start at page=1 and request subsequent pages until currentPage >= totalPages.
let page = 1;
let employees = [];
while (true) {
const response = await fetch(
`https://uat.unduit.com/api-exposed/api/v1/employees?page=${page}&limit=50`,
{ headers: { Authorization: `Bearer ${token}` } }
);
const body = await response.json();
employees.push(...body.users);
if (body.currentPage >= body.totalPages) break;
page += 1;
}