Pagination
Paginate through list results using offset-based pagination.
Pagination
All list endpoints return paginated results using offset-based pagination.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 25 | Number of results per page (max: 100) |
offset | integer | 0 | Number of results to skip |
Response Envelope
List responses include pagination metadata:
{
"data": [
{ "id": 1, "subject": "Ticket A" },
{ "id": 2, "subject": "Ticket B" }
],
"total": 142,
"limit": 25,
"offset": 0
}| Field | Type | Description |
|---|---|---|
data | array | The page of results |
total | integer | Total number of matching results |
limit | integer | Page size used |
offset | integer | Offset used |
Paginating Through Results
Fetch the first page:
curl "https://apps.aurionai.net/api/v1/tickets?limit=25&offset=0" \
-H "X-API-Key: ak_live_xxxx"Fetch the next page by incrementing offset by limit:
curl "https://apps.aurionai.net/api/v1/tickets?limit=25&offset=25" \
-H "X-API-Key: ak_live_xxxx"Iterating All Pages
import requests
def get_all_tickets(api_key: str) -> list:
tickets = []
offset = 0
limit = 100
while True:
response = requests.get(
"https://apps.aurionai.net/api/v1/tickets",
headers={"X-API-Key": api_key},
params={"limit": limit, "offset": offset},
)
page = response.json()
tickets.extend(page["data"])
if offset + limit >= page["total"]:
break
offset += limit
return ticketsasync function getAllTickets(apiKey: string) {
const tickets = [];
let offset = 0;
const limit = 100;
while (true) {
const response = await fetch(
`https://apps.aurionai.net/api/v1/tickets?limit=${limit}&offset=${offset}`,
{ headers: { "X-API-Key": apiKey } }
);
const page = await response.json();
tickets.push(...page.data);
if (offset + limit >= page.total) break;
offset += limit;
}
return tickets;
}Best Practices
- Use the maximum
limit(100) when fetching all records to minimize API calls - Check
totalto determine if more pages exist rather than checking for emptydata - Add filters to reduce result sets — filtering server-side is faster than fetching everything