Skip to main content
List endpoints return results in pages. Every list response has the same shape: a data array and a meta object describing the page.

Parameters

ParameterTypeDefaultNotes
pageinteger1The 1-based page number.
pageSizeinteger25Items per page. Maximum 100.
curl "https://backend.leadey.ai/v1/leads?page=2&pageSize=50" \
  -H "Authorization: Bearer $LEADEY_API_KEY"

Response shape

{
  "data": [ /* … up to pageSize items … */ ],
  "meta": {
    "page": 2,
    "pageSize": 50,
    "totalCount": 134,
    "totalPages": 3
  }
}
  • totalCount — total items matching the query across all pages.
  • totalPagesceil(totalCount / pageSize). You’ve reached the end when page >= totalPages.

Iterating every page

Request pages until you’ve seen totalPages:
import os, requests

headers = {"Authorization": f"Bearer {os.environ['LEADEY_API_KEY']}"}
page, leads = 1, []
while True:
    r = requests.get(
        "https://backend.leadey.ai/v1/leads",
        headers=headers,
        params={"page": page, "pageSize": 100},
    ).json()
    leads.extend(r["data"])
    if page >= r["meta"]["totalPages"]:
        break
    page += 1

print(f"Fetched {len(leads)} leads")
Use the largest pageSize (100) to minimise round trips, and combine it with filters like search, status, or campaignId to narrow results before paging.