Pagination
List endpoints return paginated results. Use query parameters to control the page and number of results.
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-indexed) |
limit | integer | 20 | Results per page (max: 100) |
Response format
Paginated responses include a pagination object:
json
{
"data": [...],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8
},
"requestId": "req-abc123"
}| Field | Description |
|---|---|
page | Current page number |
limit | Results per page |
total | Total number of results |
totalPages | Total number of pages |
Example
bash
# Get page 2 with 50 results per page
curl "https://api.replicer.ai/v1/calls?page=2&limit=50" \
-H "Authorization: Bearer rpl_live_your_key"Iterating through all results
javascript
async function fetchAllCalls(apiKey) {
const allCalls = []
let page = 1
while (true) {
const response = await fetch(
`https://api.replicer.ai/v1/calls?page=${page}&limit=100`,
{ headers: { 'Authorization': `Bearer ${apiKey}` } }
)
const { data, pagination } = await response.json()
allCalls.push(...data)
if (page >= pagination.totalPages) break
page++
}
return allCalls
}
