> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oktivo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination and filtering

> Page through list endpoints with cursors or page numbers, and filter results.

## v2

v2 list endpoints return an array in `data` and paging information in `meta`. There are two styles, chosen per resource.

| Style | Resources | Parameters | `meta` |
| - | - | - | - |
| Cursor | Calls, events | `limit`, `cursor` | `{ "limit": 25, "nextCursor": "..." }` |
| Page number | Call queue, webhook endpoints, webhook delivery logs, agents | `limit`, `page` | `{ "page": 1, "limit": 25, "total": 127 }` |

`limit` is 1 to 100 and defaults to 25. `page` starts at 1. `pageSize` is accepted as an alias of `limit`.

### Cursor pagination

Cursors are opaque strings. Do not decode or build them. Pass the `nextCursor` of one response as `cursor` in the next request, with the same filters. `nextCursor` is `null` on the last page. An invalid cursor returns `422`.

```bash theme={null}
curl "https://client-backend.oktivo.com/api/v2/events?limit=50&type=call.completed" \
  -H "Authorization: Bearer okt_your_token"
```

```json theme={null}
{
  "success": true,
  "requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
  "timestamp": "2026-03-02T04:05:00.000Z",
  "data": [ { "id": "...", "type": "call.completed" } ],
  "meta": { "limit": 50, "nextCursor": "eyJjIjoiMjAyNi0wMy0wMlQwNDowMzoxMS4wMDBaIiwiaSI6IjY0..." }
}
```

```bash theme={null}
curl "https://client-backend.oktivo.com/api/v2/events?limit=50&type=call.completed&cursor=eyJjIjoi..." \
  -H "Authorization: Bearer okt_your_token"
```

Cursor pages stay stable while new records arrive. Page numbers can shift.

### Filters

Unknown query parameters are ignored. A known parameter with an invalid value returns `422`.

| Resource | Filters |
| - | - |
| Calls | `direction` (`inbound`, `outbound`), `agentId`, `campaignId`, `callId`, `phone` (partial match), `source` (`api`, `crm_human`, `crm_p2p`, `campaign`), `status` (comma-separated), `from`, `to`, `sortOrder` (`asc`, `desc`, default `desc`) |
| Call queue | `status` (comma-separated: `scheduled`, `waiting`, `dialing`, `placed`, `failed`, `expired`, `cancelled`), `type` (`scheduled`, `deferred`), `agentId`, `search`, `from`, `to`, `sortBy` (`createdAt`, `notBefore`), `sortOrder` |
| Events | `type` (comma-separated), `group` (comma-separated), `callId`, `queueId`, `campaignId`, `agentId`, `phone`, `source`, `from`, `to` |
| Webhook delivery logs | `webhookId`, `eventId`, `eventType`, `status` (`pending`, `success`, `failed`), `from`, `to` |

`from` and `to` are ISO 8601 date-times with a UTC offset, for example `2026-03-02T00:00:00+05:30`. They are exact bounds. Several legacy names are accepted as aliases, for example `contactUID` for `callId` and `campaignUID` for `campaignId`.

## v1

v1 list endpoints keep their original page-number parameters and the legacy `pagination` object. Every paged response also carries `meta`, which repeats the keys of `pagination` (see [Versioning](https://docs.oktivo.com/api-reference/versioning.md#the-v1-envelope)). `pagination` is frozen; new code should read `meta`.

| Endpoint | Parameters | Response key |
| - | - | - |
| Calls, call queue, events | `page`, `pageSize` (1 to 100, default 25) | `pagination: { page, pageSize, total, totalPages, hasMore }` and `meta` with the same keys |
| Webhook delivery logs | `page`, `limit` (1 to 100, default 20) | `pagination: { total, page, limit, pages, totalPages }` and `meta: { total, page, limit, totalPages }` |

v1 `from` and `to` are calendar days in the form `YYYY-MM-DD`, in Indian Standard Time (IST), and `to` is inclusive.

Query parameters are validated: an unknown enum value, a bad date or a non-numeric `page` returns `400` instead of being ignored. Values of `pageSize` or `limit` above 100 are still accepted and capped at 100.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.