# Calls API

Source: https://aicallstudio.com/docs/api/calls. Authentication, scopes, limits, errors and webhooks: https://aicallstudio.com/docs/api

### List calls

`GET /api/analytics/calls` (scope `calls:read`)

The call log, a page at a time, newest first, with totals for everything that matches.

Each call comes with its outcome, score, summary, cost and who answered it, and `stats` counts every matching call, not just this page. By default the last 30 days; `date_from` and `date_to` (IST calendar days) pick a range instead. Test calls are left out unless asked for. A page holds at most 200 calls. A recording link expires: fetch the call again when you need it.

**Parameters**

| Parameter | Type | What it is |
| --- | --- | --- |
| `page` | integer, at least 1, in the query | Default: 1. |
| `page_size` | integer, 1 to 200, in the query | Default: 50. |
| `sort` | string, in the query | By start time: newest or oldest first. Default: newest. |
| `days` | integer, 1 to 365, in the query | The last this many days, 1 to 365. date_from overrides it. Default: 30. |
| `status` | string, or null, in the query | The call's status, such as completed, no_answer, busy or failed. |
| `classification` | string, or null, in the query | Lead classification: hot, warm or cold. |
| `agent_id` | string, or null, in the query | Calls answered by this AI agent. |
| `team_id` | string, or null, in the query | Calls answered by this AI team. |
| `contact_id` | string, or null, in the query | Calls with this contact. |
| `direction` | string, or null, in the query | inbound or outbound. |
| `campaign_id` | string, or null, in the query | Calls this campaign placed. |
| `disposition` | string, or null, in the query | Calls with this outcome key. |
| `initiator` | string, or null, in the query | What started the call, comma-separated: manual,campaign,web,inbound,workflow,workspace,test,api,callback |
| `missed` | boolean, or null, in the query | true: calls where nobody spoke to the customer (not answered, a machine, or a failed attempt); false: the others. |
| `search` | string, or null, in the query | Text to find in the contact's name, a number on the call, or the summary. |
| `date_from` | string (date), or null, in the query | IST calendar day, YYYY-MM-DD. Beats `days`. |
| `date_to` | string (date), or null, in the query | IST calendar day, inclusive. |
| `campaign_only` | boolean, in the query | Only calls a campaign placed. Default: false. |
| `did` | string, or null, in the query | Comma-separated: your own numbers. Matches every stored spelling of each line (+91…, 91…, 0…, national). |
| `handover` | one of: yes, no, answered, missed, not_rung, or null, in the query | Handed to a person: yes, no, answered (someone came on), missed (someone was rung, nobody came on) or not_rung (nobody was rung: outside the hours). |
| `handover_user` | string (uuid), or null, in the query | Only hand-overs this staff member answered. |
| `answered_by` | one of: agent, team, staff, or null, in the query | Any AI agent working alone, any AI team, or staff (a person's own call from the Workspace, no AI on it). |
| `staff_user` | string (uuid), or null, in the query | Calls this staff member took: hand-overs they answered and calls they dialled from the Workspace. |
| `ids` | string, or null, in the query | Comma-separated call ids (at most 500): the rows someone selected. |
| `desk_id` | string (uuid), or null, in the query | Calls attributed to this desk: to or from one of its numbers, or handed over through an 'A desk' step and taken by someone on it. |
| `channel` | one of: phone, web, or null, in the query | What carried the call: phone (a phone line) or web (in a browser). With direction=inbound, web is the website widget's calls. |
| `hide_test` | boolean, in the query | Leave out test calls (the default, as on Home and Analytics). initiator=test shows them regardless. Default: true. |
| `scored` | one of: yes, no, or null, in the query | Whether the call has a score (Call Scoring's coverage). |
| `qa` | one of: graded, not_graded, pass, review, fail, disputed, or null, in the query | Call QA: graded, not_graded, or by the call's QA band (the worst of its grades: pass, review, fail), or disputed (a grade with an open dispute). |
| `mode` | one of: ai, power, or null, in the query | Campaign mode: power (calls a power-dialer campaign placed for your staff) or ai (every other call). |
| `insights` | one of: none, read, or null, in the query | Conversation insights: none (connected, 15 seconds or longer, with a transcript, not read yet: what Intelligence counts as unread) or read. |
| `call_class` | one of: ai, human, hybrid, or null, in the query | Who worked the call: ai (the AI alone), human (people only) or hybrid (the AI, then a person who came on). |

**Answer (200): these fields**

| Field | Type | What it is |
| --- | --- | --- |
| `total` (required) | integer | — |
| `page` (required) | integer | — |
| `page_size` (required) | integer | — |
| `items` (required) | list of objects | — |
| `items[].id` (required) | string (uuid) | — |
| `items[].direction` | string, or null | inbound or outbound. |
| `items[].initiator` | string, or null | What started the call: manual, campaign, web, inbound, workflow, workspace, test, api or callback. Null on older calls. |
| `items[].status` | string, or null | — |
| `items[].started_at` | string (date-time), or null | — |
| `items[].duration_sec` | integer, or null | — |
| `items[].billed_minutes` | number, or null | — |
| `items[].classification` | string, or null | Lead classification: hot, warm or cold. |
| `items[].disposition` | string, or null | The call's outcome key. |
| `items[].score` | number, or null | Lead score, 0 to 100. |
| `items[].sentiment` | string, or null | — |
| `items[].summary` | string, or null | — |
| `items[].cost` | number, or null | What the call cost in all, in rupees. |
| `items[].languages_used` | list of string, or null | — |
| `items[].agent_id` | string (uuid), or null | — |
| `items[].agent_name` | string, or null | — |
| `items[].team_id` | string (uuid), or null | — |
| `items[].team_name` | string, or null | — |
| `items[].answered_by` | string, or null | The name of the agent, team or person who took the call. |
| `items[].placed_by` | string, or null | The person who placed the call, when a person did. |
| `items[].campaign_id` | string (uuid), or null | — |
| `items[].campaign_name` | string, or null | — |
| `items[].contact_id` | string (uuid), or null | Null when there is no contact, or it was deleted. |
| `items[].contact_deleted` | boolean | Default: false. |
| `items[].contact_name` | string, or null | — |
| `items[].contact_phone` | string, or null | — |
| `items[].did` | string, or null | Your own number on the call. |
| `items[].has_recording` | boolean | Default: false. |
| `items[].recording_url` | string, or null | A link to play the recording. It expires: fetch it when you need it. |
| `items[].missed` | boolean | Nobody spoke to the customer: not answered, a machine, or a failed attempt. Default: false. |
| `items[].disposed_by` | string, or null | Who set the outcome. |
| `items[].callback_requested` | boolean | Default: false. |
| `items[].callback_time` | string, or null | — |
| `items[].handover` | string, or null | Handed to a person: answered, missed or not_rung; null if never. |
| `items[].qa` | object, or null | The call's quality grade; null when it was never graded. |
| `stats` (required) | object | — |
| `stats.total` (required) | integer | Calls matching the filters, across every page. |
| `stats.completed` (required) | integer | Of those, calls someone picked up. |
| `stats.talk_minutes` (required) | integer | — |
| `stats.total_cost` | number, or null | What those calls cost in all, in rupees. |

**Errors**

| Code | When |
| --- | --- |
| `401` | The token is missing, unknown or revoked, or its workspace was deleted. |
| `402` | The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. |
| `403` | The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow. |
| `422` | A field is missing or not in the form this endpoint takes. `detail` says which, and why. |
| `429` | This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait. |

```bash
curl "https://aicallstudio.com/api/analytics/calls?page_size=50&days=30" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN"
```

### Place a call

`POST /api/calls/dial` (scope `calls:write`)

Ring one number now, with an AI agent or team speaking. A real call, billed like any other.

Send `phone` (a 10-digit Indian mobile) or `contact_id`, and exactly one of `agent_id` or `team_id`. The same checks as any outbound call apply first: the plan, Do-Not-Call, the agent's calling hours and the calls-at-once limits. The answer means ringing has started, not that anyone picked up: the outcome arrives with the call.completed webhook and in the call log.

`variables` fills your agent's script for this person (a name, an amount, a due date): they are saved on the contact, and a number that is not a contact yet is saved as one, under `name`. Send an Idempotency-Key header so that a retried request never rings the person twice.

This rings real customers. Each call is billed from your wallet like any other call, at your plan's rates.

**Parameters**

| Parameter | Type | What it is |
| --- | --- | --- |
| `Idempotency-Key` | string, up to 255 characters, in the headers | Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422. |

**Request body (application/json)**

| Field | Type | What it is |
| --- | --- | --- |
| `phone` | string, or null | A 10-digit Indian mobile number starting with 6 to 9, without +91. Send this or contact_id. |
| `contact_id` | string (uuid), or null | A contact to call, by id: the contact's own number is rung. |
| `agent_id` | string (uuid), or null | The AI agent that speaks. Send this or team_id, not both. |
| `team_id` | string (uuid), or null | The AI team that speaks. Send this or agent_id, not both. |
| `name` | string, up to 255 characters, or null | The person's name. A number that is not a contact yet is saved as one under this name; for a known contact it is left as it is. |
| `variables` | object, or null | Values your agent's script uses, by name: {"amount": "12,500", "due_date": "5 December"} fills {amount} and {due_date}. Up to 30, each name lower-case letters, digits and _, each value up to 500 characters. They are saved on the contact as its fields, so the next call has them too. |

**Answer (200): these fields**

| Field | Type | What it is |
| --- | --- | --- |
| `status` (required) | string | Always dialing: the number is being rung. |
| `phone` (required) | string | The number rung, with +91. |
| `answerer` (required) | string | The name of the agent or team that will speak. |
| `room` (required) | string | An id for this call attempt. |

**Errors**

| Code | When |
| --- | --- |
| `401` | The token is missing, unknown or revoked, or its workspace was deleted. |
| `402` | The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. The plan has no calls left, or does not include this voice tier. |
| `403` | The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow. The number cannot be called: on a Do-Not-Call or Do-Not-Disturb list, no consent, or outside the workspace's calling window. |
| `404` | The agent, team or contact was not found, or is switched off. |
| `409` | The call cannot start now: the plan's calls-at-once limit, the agent's own limit, the agent's calling hours, a draft or paused agent, or no phone line to call from. |
| `422` | A field is missing or not in the form this endpoint takes. `detail` says which, and why. |
| `429` | This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait. |
| `502` | The call could not be started. Nothing was rung; try again. |
| `503` | Calling is halted for a moment by the platform. |

```bash
curl -X POST "https://aicallstudio.com/api/calls/dial" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"phone":"9876543210","agent_id":"YOUR_AGENT_ID","name":"Asha Verma","variables":{"amount":"12,500","due_date":"5 December"}}'
```

### Schedule a call-back

`POST /api/v1/callbacks` (scope `calls:write`)

Book an AI call to one person at a set time. A real call, billed like any other.

Send `contact_id`, or `phone` (and `name`) for a number that is not a contact yet, and exactly one of `agent_id` or `team_id`. When the time comes the usual checks run first: Do-Not-Call, your calling window and the agent's calling hours, and the wallet. A call-back that falls outside the hours moves to the next opening. It shows in the Workspace's call-backs list, and can be cancelled until it rings.

This rings real customers. Each call is billed from your wallet like any other call, at your plan's rates.

**Parameters**

| Parameter | Type | What it is |
| --- | --- | --- |
| `Idempotency-Key` | string, up to 255 characters, in the headers | Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422. |

**Request body (application/json)**

| Field | Type | What it is |
| --- | --- | --- |
| `contact_id` | string (uuid), or null | The contact to call back. Send this or phone. |
| `phone` | string, up to 20 characters, or null | The number to call back, if it is not a contact yet: 8 to 15 digits, optionally starting with +. It is saved as a contact. |
| `name` | string, up to 255 characters, or null | The person's name, for a new number. |
| `agent_id` | string (uuid), or null | The AI agent that calls. Send this or team_id, not both. |
| `team_id` | string (uuid), or null | The AI team that calls. Send this or agent_id, not both. |
| `at` (required) | string (date-time) | When to call, with a time zone (2026-12-01T10:30:00+05:30). In the future, at most 30 days ahead. |

**Answer (201): these fields**

| Field | Type | What it is |
| --- | --- | --- |
| `id` (required) | string (uuid) | — |
| `contact_id` (required) | string (uuid) | — |
| `at` (required) | string (date-time) | — |
| `status` (required) | string | booked, or cancelled. |

**Errors**

| Code | When |
| --- | --- |
| `401` | The token is missing, unknown or revoked, or its workspace was deleted. |
| `402` | The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. |
| `403` | The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow. The number is on Do-Not-Call. |
| `404` | The contact, agent or team was not found. |
| `409` | The agent or team is a draft or paused. |
| `422` | A field is missing or not in the form this endpoint takes. `detail` says which, and why. |
| `429` | This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait. |

```bash
curl -X POST "https://aicallstudio.com/api/v1/callbacks" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"contact_id":"YOUR_CONTACT_ID","agent_id":"YOUR_AGENT_ID","at":"2026-12-01T10:30:00+05:30"}'
```

### Cancel a call-back

`DELETE /api/v1/callbacks/{callback_id}` (scope `calls:write`)

Cancel a booked call-back before it rings. Nobody is called.

This rings real customers. Each call is billed from your wallet like any other call, at your plan's rates.

**Parameters**

| Parameter | Type | What it is |
| --- | --- | --- |
| `callback_id` (required) | string (uuid), in the path | — |
| `Idempotency-Key` | string, up to 255 characters, in the headers | Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422. |

**Answer (200): these fields**

| Field | Type | What it is |
| --- | --- | --- |
| `id` (required) | string (uuid) | — |
| `contact_id` (required) | string (uuid) | — |
| `at` (required) | string (date-time) | — |
| `status` (required) | string | booked, or cancelled. |

**Errors**

| Code | When |
| --- | --- |
| `401` | The token is missing, unknown or revoked, or its workspace was deleted. |
| `402` | The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. |
| `403` | The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow. |
| `404` | No call-back of yours has this id. |
| `409` | It already rang, or was already cancelled. |
| `422` | A field is missing or not in the form this endpoint takes. `detail` says which, and why. |
| `429` | This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait. |

```bash
curl -X DELETE "https://aicallstudio.com/api/v1/callbacks/YOUR_CALLBACK_ID" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"
```

### List calls

`GET /api/v1/calls` (scope `calls:read`)

Your calls, newest first, a page at a time.

Each call carries its outcome, lead score and summary. For the transcript, what was captured and the recording, fetch the call by id. Test calls from the dashboard are left out. Page with `cursor`: pass the `next_cursor` of one page to get the next, until it is null.

**Parameters**

| Parameter | Type | What it is |
| --- | --- | --- |
| `status` | string, or null, in the query | Only calls with this status, such as completed or no-answer. |
| `direction` | string, or null, in the query | inbound or outbound. |
| `disposition` | string, or null, in the query | Only calls with this outcome key. |
| `campaign_id` | string (uuid), or null, in the query | — |
| `agent_id` | string (uuid), or null, in the query | — |
| `team_id` | string (uuid), or null, in the query | — |
| `contact_id` | string (uuid), or null, in the query | — |
| `room` | string, up to 128 characters, or null, in the query | The `room` that placing a call answered with. |
| `since` | string (date-time), or null, in the query | Calls that started at or after this moment (ISO 8601, with a time zone). |
| `until` | string (date-time), or null, in the query | Calls that started before this moment. |
| `limit` | integer, 1 to 100, in the query | Calls per page. Default: 50. |
| `cursor` | string, or null, in the query | `next_cursor` from the previous page. |

**Answer (200): these fields**

| Field | Type | What it is |
| --- | --- | --- |
| `data` (required) | list of objects | — |
| `data[].id` (required) | string (uuid) | — |
| `data[].status` | string, or null | completed, no-answer, failed, voicemail or busy. |
| `data[].direction` | string, or null | inbound or outbound. |
| `data[].initiator` | string, or null | What started the call: manual, campaign, web, inbound, workflow, workspace, api or callback. |
| `data[].room` | string, or null | The call attempt's id, the same `room` that placing a call answers with. |
| `data[].started_at` | string (date-time), or null | — |
| `data[].answered_at` | string (date-time), or null | When the customer picked up; null when nobody did. |
| `data[].ended_at` | string (date-time), or null | — |
| `data[].duration_seconds` | integer, or null | — |
| `data[].billed_minutes` | number, or null | — |
| `data[].disposition` | string, or null | The call's outcome key. |
| `data[].classification` | string, or null | Lead classification: hot, warm or cold. |
| `data[].score` | number, or null | Lead score, 0 to 100. |
| `data[].sentiment` | string, or null | — |
| `data[].summary` | string, or null | — |
| `data[].contact_id` | string (uuid), or null | — |
| `data[].campaign_id` | string (uuid), or null | — |
| `data[].agent_id` | string (uuid), or null | — |
| `data[].team_id` | string (uuid), or null | — |
| `data[].from_number` | string, or null | — |
| `data[].to_number` | string, or null | — |
| `next_cursor` | string, or null | Pass as `cursor` for the next page; null on the last page. |

**Errors**

| Code | When |
| --- | --- |
| `401` | The token is missing, unknown or revoked, or its workspace was deleted. |
| `402` | The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. |
| `403` | The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow. |
| `422` | A field is missing or not in the form this endpoint takes. `detail` says which, and why. |
| `429` | This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait. |

```bash
curl "https://aicallstudio.com/api/v1/calls?limit=50" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN"
```

### Get a call

`GET /api/v1/calls/{call_id}` (scope `calls:read`)

One call with its transcript, what it captured and its outcome.

`recording_url` is a link to play the recording that works for a short time; it is filled only when the token has the `recordings:read` scope and the call was recorded. Fetch the call again for a fresh link rather than storing one.

**Parameters**

| Parameter | Type | What it is |
| --- | --- | --- |
| `call_id` (required) | string (uuid), in the path | — |

**Answer (200): these fields**

| Field | Type | What it is |
| --- | --- | --- |
| `id` (required) | string (uuid) | — |
| `status` | string, or null | completed, no-answer, failed, voicemail or busy. |
| `direction` | string, or null | inbound or outbound. |
| `initiator` | string, or null | What started the call: manual, campaign, web, inbound, workflow, workspace, api or callback. |
| `room` | string, or null | The call attempt's id, the same `room` that placing a call answers with. |
| `started_at` | string (date-time), or null | — |
| `answered_at` | string (date-time), or null | When the customer picked up; null when nobody did. |
| `ended_at` | string (date-time), or null | — |
| `duration_seconds` | integer, or null | — |
| `billed_minutes` | number, or null | — |
| `disposition` | string, or null | The call's outcome key. |
| `classification` | string, or null | Lead classification: hot, warm or cold. |
| `score` | number, or null | Lead score, 0 to 100. |
| `sentiment` | string, or null | — |
| `summary` | string, or null | — |
| `contact_id` | string (uuid), or null | — |
| `campaign_id` | string (uuid), or null | — |
| `agent_id` | string (uuid), or null | — |
| `team_id` | string (uuid), or null | — |
| `from_number` | string, or null | — |
| `to_number` | string, or null | — |
| `disposition_label` | string | The outcome in your workspace's own words. Default: . |
| `captured_fields` | object | What the call captured, by field name: the values your agent was asked to collect, such as a promised payment date or a site-visit slot. |
| `captured_lead` | object, or null | The lead the agent saved during the call, when it saved one. |
| `transcript` | string | The conversation as text, one line per turn, each labelled with who spoke. Default: . |
| `transcript_turns` | list of objects | — |
| `transcript_turns[].speaker` (required) | string | lead, agent, staff or supervisor. |
| `transcript_turns[].text` (required) | string | — |
| `transcript_turns[].name` | string, or null | The person's name, when a person spoke. |
| `handover` | object, or null | When the call was handed to a person: how that went. |
| `cost_inr` | number | What the call has cost so far, in rupees. Default: 0. |
| `has_recording` | boolean | Default: false. |
| `recording_url` | string, or null | A link to play the recording, valid for a short time: fetch it when you need it. Null unless the token has the `recordings:read` scope and the call was recorded. |
| `recording_tracks` | list of objects | One recording per speaker (the customer, the AI, a person who joined), when the call kept them. Each `url` follows the same rule as `recording_url`. |
| `recording_tracks[].kind` | string, or null | Whose voice it is: customer, ai, staff or supervisor. |
| `recording_tracks[].label` | string, or null | Who it is, in words. |
| `recording_tracks[].url` | string, or null | A short-lived link to play it; null without `recordings:read`. |
| `recording_tracks[].missing` | boolean | The file could not be found in storage. Default: false. |

**Errors**

| Code | When |
| --- | --- |
| `401` | The token is missing, unknown or revoked, or its workspace was deleted. |
| `402` | The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. |
| `403` | The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow. |
| `404` | No call of yours has this id. |
| `422` | A field is missing or not in the form this endpoint takes. `detail` says which, and why. |
| `429` | This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait. |

```bash
curl "https://aicallstudio.com/api/v1/calls/YOUR_CALL_ID" \
  -H "Authorization: Bearer mtc_YOUR_TOKEN"
```
