Pagination
Paginate through list results using offset-based pagination.
Pagination
The primary list endpoints (GET /api/v1/tickets, GET /api/v1/calls) return paginated
results using offset-based pagination via limit and offset query parameters. A few other
list endpoints differ slightly — see Endpoints that differ below.
Query Parameters
| Parameter | Type | Default | Constraints | Description |
|---|---|---|---|---|
limit | integer | 20 | 1–100 | Number of results per page. Out-of-range values return 422. |
offset | integer | 0 | >= 0 | Number of results to skip. Out-of-range values return 422. |
Response Envelope
List responses use a resource-named array key (matching the resource being listed —
tickets, calls, …), not a generic data key, plus pagination metadata:
{
"tickets": [
{ "id": "tkt_1", "subject": "Ticket A" },
{ "id": "tkt_2", "subject": "Ticket B" }
],
"total": 142,
"limit": 20,
"offset": 0
}The GET /api/v1/calls envelope is identical except the array key is calls:
{
"calls": [ /* ... */ ],
"total": 142,
"limit": 20,
"offset": 0
}| Field | Type | Description |
|---|---|---|
<resource> | array | The page of results (tickets for the tickets endpoint, calls for the calls endpoint) |
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=20&offset=0" \
-H "X-API-Key: itsm_sk_live_xxxx"Fetch the next page by incrementing offset by limit:
curl "https://apps.aurionai.net/api/v1/tickets?limit=20&offset=20" \
-H "X-API-Key: itsm_sk_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["tickets"])
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.tickets);
if (offset + limit >= page.total) break;
offset += limit;
}
return tickets;
}Endpoints that differ
Not every list endpoint follows the tickets/calls envelope above. When integrating with these
endpoints, do not assume a total/limit/offset envelope:
| Endpoint | Default limit | Max limit | Envelope |
|---|---|---|---|
GET /api/v1/tickets | 20 | 100 | { "tickets": [...], "total", "limit", "offset" } |
GET /api/v1/calls | 20 | 100 | { "calls": [...], "total", "limit", "offset" } |
GET /api/v1/usage/details | 50 | 200 | { "events": [...], "groups": [...], "total", "limit", "offset" } — the result array is events or groups depending on group_by; the pagination fields may be null. |
GET /api/v1/webhooks | n/a | n/a | { "webhooks": [...] } — returns the full list with no total/limit/offset. |
GET /api/v1/webhooks/{webhook_id}/deliveries | 50 | 200 | { "deliveries": [...] } — accepts a limit query param but returns no total/offset. |
Best Practices
- Use the maximum
limit(100 for tickets/calls) when fetching all records to minimize API calls - Check
totalto determine if more pages exist rather than checking for an empty result array (only on endpoints that returntotal— see the table above) - Add filters to reduce result sets — filtering server-side is faster than fetching everything
Error Handling
HTTP status codes, error response format, and retry strategies for the Aurion API.
Create Embed Token POST
Issue a LiveKit token for an externally embedded voice widget. This is a public endpoint — authentication is based on the widget's public key and origin allow-list rather than user credentials.