> ## 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.

# Versioning and compatibility

> Which API versions exist, how they relate, what changes without a new version, the frozen v1 fields and the deprecation policy.

The API version is part of the URL path.

| Version | Base path | Status |
| - | - | - |
| v1 | `https://client-backend.oktivo.com/api/v1/crm` | Current and supported. Responses only gained fields; nothing was removed or renamed. |
| v2 | `https://client-backend.oktivo.com/api/v2` | Available for calls, call queue, events, webhooks, agents, leads and tickets. |

v2 does not replace v1. Both run side by side, use the same API tokens and the same account permissions, and read and write the same data. A call created through v1 shows up in v2 and the other way round.

## What v2 covers

| Resource | v2 path |
| - | - |
| Calls | `/api/v2/calls` |
| Call queue | `/api/v2/queue` |
| Events | `/api/v2/events` |
| Webhook endpoints and delivery logs | `/api/v2/webhooks` |
| Agents | `/api/v2/agents` |
| Leads | `/api/v2/leads` |
| Tickets | `/api/v2/tickets` |

These parts of v1 have no v2 equivalent yet and stay on v1: API token management (`/tokens`), `/analysis-schemas`, `/retry-analysis`, `/track`, and `/shopify/confirmation-calls`.

## The v1 envelope

Every JSON object response from `/api/v1/crm` is a superset of the response it had before:

| Response | Added fields |
| - | - |
| Success (`success: true`) | `requestId`, `timestamp`, and `meta` on paged lists. `meta` mirrors the legacy `pagination` object. |
| Error | `requestId`, `code` (when the handler had not set one) and `errorInfo: { code, message, details? }`. |

A successful call list now looks like this. Fields that existed before are unchanged:

```json theme={null}
{
  "success": true,
  "data": [
    {
      "contactUID": "c_1",
      "campaignUID": "api_call_1",
      "source": "api",
      "agentId": "agt_1",
      "name": "Asha",
      "phone": "+919999999999",
      "direction": "outbound",
      "status": "done",
      "callStatus": "completed",
      "disconnectReason": null,
      "callDuration": 12,
      "billingDuration": 12,
      "attempts": 1,
      "lastError": null,
      "createdAt": "2026-03-01T10:00:00.000Z",
      "startedAt": null,
      "answeredAt": null,
      "endedAt": null,
      "hasRecording": true,
      "hasTranscription": false,
      "hasAnalysis": false
    }
  ],
  "pagination": { "page": 2, "pageSize": 10, "total": 31, "totalPages": 4, "hasMore": true },
  "requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
  "timestamp": "2026-03-02T04:05:00.000Z",
  "meta": { "page": 2, "pageSize": 10, "total": 31, "totalPages": 4, "hasMore": true }
}
```

Rules:

* `meta` only holds keys that the route's `pagination` object has. A response without `pagination` has no `meta`. Delivery logs mirror `page`, `total`, `limit` and `totalPages`.
* Arrays, files, streams, redirects and the `track.js` script are never wrapped or changed.
* `errorInfo` is the v1 spelling of the v2 `error` object. See [Errors](https://docs.oktivo.com/api-reference/errors.md#mapping-v1-errorinfo-to-v2-error).
* The webhook test delivery returns `200` with `success: false` when your receiver fails. It gets `requestId` and `timestamp` but no `errorInfo`.

## Frozen legacy fields

These v1 fields are frozen. They stay in the response with the same name, type and value. We will not extend them (no new keys inside them, no new routes using them). We will remove them only in a future major API version, with a Sunset date announced at least 6 months ahead. No Sunset date is set today and no v1 route is marked deprecated.

New integrations should read the replacement and ignore the frozen field.

| Route group | Frozen fields | Read instead |
| - | - | - |
| Calls and call queue (`/calls`, `/calls/queue*`) | `pagination`; `message` on cancel responses and on errors | `meta`; `errorInfo.message` |
| Events (`/events*`) | `pagination` | `meta` |
| Webhook endpoints (`/webhooks/endpoints*`) | `endpoint` (single), `endpoints` (list); the string `error` and `message` on errors | v2 `/api/v2/webhooks` returns `data`. On v1 keep reading `endpoint` and `endpoints`; use `errorInfo` for errors. |
| Webhook delivery logs (`/webhooks/delivery-logs*`) | `logs` (list), `log` (single), `pagination` (with `pages`); the string `error` | `meta` for paging. v2 `/api/v2/webhooks` returns `data`. |
| Leads, tickets, agents, analysis schemas, retry analysis, tokens | `message` on errors and on delete or retry responses | `errorInfo.message` on errors |
| Tracking (`/track`) | the nested `error: { code, message }` object on errors | `errorInfo` |
| Dashboard routes that the dashboard shares with v1: `/webhooks/*`, `/campaign-webhooks`, `/events`, `/call-queue`, `GET /contacts`, `/dynamic-tool-logs`, `/api/v2/mcp/tool-call-logs` | the same fields as the v1 route they mirror, the flat `total`, `page` and `limit` of `GET /contacts`, and the string `error` | Dashboard routes need a dashboard login and are not part of the API-token contract. |

The `message` field of an error duplicates `errorInfo.message`, and the `code` field duplicates `errorInfo.code`. Both are kept.

## Machine-readable contract

* v2: `GET https://client-backend.oktivo.com/api/v2/openapi.json` (no authentication). The same document is rendered in the **API v2 (OpenAPI)** tab.
* v1: rendered in the **API v1 (OpenAPI)** tab. It lists the existing `/api/v1/crm` operations. Response schemas for calls, the queue, events, webhooks, delivery logs, agents, analysis schemas, leads, tickets and tokens describe the real fields plus `requestId`, `timestamp`, `meta`, `errorInfo` and `code`. Frozen fields are marked `x-frozen`.

## Changes that do not need a new version

We may make these changes to either version at any time. Write clients that tolerate them.

* Adding a new field to a response body or a new key to a webhook `data` object.
* Adding a new optional request field or query parameter.
* Adding a new endpoint, event type or error `code`.
* Adding a new response header.
* Tightening validation so that a value that was silently ignored now returns a validation error.

Do not rely on the order of fields, and treat unknown enum values defensively where a field is an open list (for example event types).

## Changes that would need a new version

Removing or renaming a field, changing a field's type or meaning, changing a status code for an existing outcome, or removing an endpoint. The removal of a frozen field is one of these.

## Deprecation policy

1. A change that needs a new version ships in a new major version (for example v3) next to the old one. The old version keeps working.
2. Before we remove anything from a version, we announce a Sunset date at least 6 months ahead. The announcement goes to the account owners and to this documentation. Until then, nothing is removed.
3. From the announcement on, deprecated routes also return `Deprecation` and `Sunset` response headers. The backend can send them, but no route uses them today.
4. Frozen fields are removed, if ever, only together with such an announcement and only in a new major version.

Today no v1 route and no v1 field is deprecated, and no Sunset date exists.

## Choosing a version

Use v1 if your integration works today, or if you need an endpoint listed above as v1-only. Use v2 for new work on the resources it covers. See [Migrating from v1 to v2](https://docs.oktivo.com/guides/migrate-to-v2.md).


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