# Paging and filters

> Get long lists page by page, and narrow them by date, campaign, status or your own ID.

Lists come back one page at a time, newest first:

```json
{
  "data": [ { "id": "e4d3c2b1-a09f-4e8d-9c7b-6a5f4e3d2c1b", "...": "..." } ],
  "meta": { "next_cursor": "e4d3c2b1-a09f-4e8d-9c7b-6a5f4e3d2c1b", "has_more": true }
}
```

For the next page, send `starting_after` with the `next_cursor` you got. When `has_more` is `false`, you have it all. There are no page numbers and no totals: that keeps every page fast, however long the list.

```bash
curl 'https://v2-api.callview.ai/api/v1/external/calls?limit=100&starting_after=e4d3c2b1-a09f-4e8d-9c7b-6a5f4e3d2c1b' \
  -u "$CALLVIEW_KEY_ID:$CALLVIEW_SECRET"
```

| List | Page size (default, most) | Next page with |
| --- | --- | --- |
| `GET /leads` | 20, 100 | `starting_after` |
| `GET /calls` | 50, 100 | `starting_after` |
| `GET /events` | 50, 100 | `starting_after` |
| `GET /webhook_endpoints/{id}/deliveries` | 25, 100 | `starting_after` |
| `GET /campaigns`, `GET /dnc`, `GET /campaigns/{campaignId}/leads` | 50, 100 | `cursor` |

The last row are older lists. They work the same way, but the parameter is called `cursor`.

With a `status` filter on `GET /leads`, a page can have fewer leads than `limit` while `has_more` is still `true`. Keep going until `has_more` is `false`.

## Filters

| Filter | Works on | Example |
| --- | --- | --- |
| `created[gte]`, `created[lte]` | `/calls`, `/events` (and `created[gte]` on `/leads`) | `created[gte]=2026-10-01` or `created[gte]=1791306131` |
| `campaign_id` | `/leads`, `/calls`, `/events` | `campaign_id=7c1f2b9e-4a3d-4e8f-9b21-5d6a7e8f9a01` |
| `external_id` | `/leads`, `/calls` | `external_id=crm-10442` |
| `status` | `/leads`, `/webhook_endpoints/{id}/deliveries` | `status=queued` |
| `outcome` | `/calls` | `outcome=interested` |
| `type` | `/events` | `type=call.completed,lead.interested` |
| `lead_id`, `object_id` | `/calls`, `/events` | `object_id=2b8e4c1d-9f3a-4b7e-8c21-6a5d4e3f2b10` |

Dates are UTC: a plain date like `2026-10-01` means midnight UTC. Unix seconds work too. Some tools need the square brackets written as `%5B` and `%5D`.
