Skip to content

Pagination

List endpoints return paginated results. Use query parameters to control the page and number of results.

Query parameters

ParameterTypeDefaultDescription
pageinteger1Page number (1-indexed)
limitinteger20Results 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"
}
FieldDescription
pageCurrent page number
limitResults per page
totalTotal number of results
totalPagesTotal 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
}

Replicer API Documentation