ElebneElebneDocs
Reference

Pagination

How to paginate through list endpoints using page and limit parameters.

Pagination

All list endpoints in the Elebne Developer API use page-based pagination with consistent parameters and response format.

Query parameters

ParameterTypeDefaultMaxDescription
pageinteger1--Page number (1-indexed)
limitinteger20100Number of items per page
curl https://api.elebne.ai/api/v1/dev/intents?page=2&limit=10 \
  -H "Authorization: Bearer sk_test_YOUR_KEY"

Response format

Every paginated response wraps the list inside data.items alongside pagination fields:

{
  "success": true,
  "data": {
    "items": [
      { "referenceNumber": "PI-3XXXXXXXXXXXXXX", "..." : "..." },
      { "referenceNumber": "PI-3XXXXXXXXXXXXXX", "..." : "..." }
    ],
    "page": 2,
    "limit": 10,
    "total": 47,
    "hasMore": true
  }
}
FieldTypeDescription
pageintegerCurrent page number
limitintegerItems per page (as requested or capped at 100)
totalintegerTotal number of items matching the query
hasMorebooleantrue if there are more pages after this one

Limit capping

If you request a limit greater than 100, the API silently caps it to 100. The pagination.limit field in the response reflects the actual limit used.

Iterating through all pages

To fetch all results, loop until hasMore is false:

let page = 1;
let hasMore = true;

while (hasMore) {
  const res = await fetch(
    `https://api.elebne.ai/api/v1/dev/intents?page=${page}&limit=100`,
    { headers: { Authorization: `Bearer ${apiKey}` } }
  );
  const json = await res.json();

  for (const intent of json.data.items) {
    // Process each intent
  }

  hasMore = json.data.hasMore;
  page++;
}
import requests

page = 1
has_more = True

while has_more:
    res = requests.get(
        f"https://api.elebne.ai/api/v1/dev/intents?page={page}&limit=100",
        headers={"Authorization": f"Bearer {api_key}"}
    )
    data = res.json()

    for intent in data["data"]["items"]:
        # Process each intent
        pass

    has_more = data["data"]["hasMore"]
    page += 1
# Fetch page 1
curl "https://api.elebne.ai/api/v1/dev/intents?page=1&limit=100" \
  -H "Authorization: Bearer sk_test_YOUR_KEY"

# Check data.hasMore in response, increment page

Sorting

List endpoints return results sorted by creation date, most recent first. This order is not configurable.

Next steps

Was this page helpful?

On this page