Aurion Docs

Pagination

Paginate through list results using offset-based pagination.

Pagination

All list endpoints return paginated results using offset-based pagination.

Query Parameters

ParameterTypeDefaultDescription
limitinteger25Number of results per page (max: 100)
offsetinteger0Number 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
}
FieldTypeDescription
dataarrayThe page of results
totalintegerTotal number of matching results
limitintegerPage size used
offsetintegerOffset 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

Python
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 tickets
TypeScript
async 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 total to determine if more pages exist rather than checking for empty data
  • Add filters to reduce result sets — filtering server-side is faster than fetching everything

On this page