Pagination
All list endpoints return paginated results. The API uses page-based pagination with configurable page sizes.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-based) |
page_size | integer | 50 | Items per page (max 200) |
Response Format
Every paginated response includes these fields:
json
{
"items": [...],
"total": 142,
"page": 1,
"page_size": 50,
"pages": 3
}
| Field | Description |
|---|---|
items | Array of records for the current page |
total | Total number of records matching the query |
page | Current page number |
page_size | Number of items per page |
pages | Total number of pages |
Example: Iterate All Pages
python
import httpx
page = 1
all_patients = []
while True:
response = httpx.get(
f"https://api.example.com/api/v1/{org_id}/patients",
params={"page": page, "page_size": 100},
headers={"Authorization": f"Bearer {token}"},
)
data = response.json()
all_patients.extend(data["items"])
if page >= data["pages"]:
break
page += 1
print(f"Fetched {len(all_patients)} patients")
For large datasets, prefer smaller page sizes (50-100) to reduce response times and memory usage on both client and server.