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

# Calls

> Initiate web and phone calls, then retrieve transcripts and analysis.

## Overview

The Calls API handles two distinct call modes:

* **Web calls** — real-time audio over WebSocket, initiated from a browser or server
* **Phone calls** — outbound calls to a real phone number via a purchased Indigenius number

After a call ends you can retrieve the full transcript and AI-generated post-call analysis.

**Required scopes:** `calls:read` (read), `calls:write` (initiate)

***

## `GET /v1/calls`

Lists all calls for your organization.

<CodeGroup>
  ```bash Bash theme={null}
  curl https://api.indigenius.ai/v1/calls \
    -H "X-API-Key: $INDIGENIUS_API_KEY"
  ```

  ```javascript Node theme={null}
  const response = await fetch('https://api.indigenius.ai/v1/calls', {
    headers: { 'X-API-Key': process.env.INDIGENIUS_API_KEY },
  });
  console.log(await response.json());
  ```

  ```python Python theme={null}
  import requests, os

  response = requests.get(
      "https://api.indigenius.ai/v1/calls",
      headers={"X-API-Key": os.environ["INDIGENIUS_API_KEY"]},
      timeout=30,
  )
  print(response.json())
  ```
</CodeGroup>

**`200 OK`**

```json theme={null}
{
  "status": true,
  "message": "Calls fetched",
  "data": [
    {
      "id": "665e4a34c65bb95f2f2d72e1",
      "type": "web",
      "status": 1,
      "assistantId": "665e4a34c65bb95f2f2d72e2",
      "createdAt": "2026-06-05T14:00:00.000Z"
    }
  ]
}
```

**Common errors:** `403` missing `calls:read` scope

***

## `POST /v1/calls/initiate`

Creates a web call session. Returns a WebSocket URL that your client connects to for real-time audio.

<CodeGroup>
  ```bash Bash theme={null}
  curl -X POST https://api.indigenius.ai/v1/calls/initiate \
    -H "X-API-Key: $INDIGENIUS_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"assistantId": "665e4a34c65bb95f2f2d72e2", "type": "web"}'
  ```

  ```javascript Node theme={null}
  const response = await fetch('https://api.indigenius.ai/v1/calls/initiate', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': process.env.INDIGENIUS_API_KEY,
    },
    body: JSON.stringify({
      assistantId: '665e4a34c65bb95f2f2d72e2',
      type: 'web',
    }),
  });
  console.log(await response.json());
  ```

  ```python Python theme={null}
  import requests, os

  response = requests.post(
      "https://api.indigenius.ai/v1/calls/initiate",
      headers={
          "X-API-Key": os.environ["INDIGENIUS_API_KEY"],
          "Content-Type": "application/json",
      },
      json={"assistantId": "665e4a34c65bb95f2f2d72e2", "type": "web"},
      timeout=30,
  )
  print(response.json())
  ```
</CodeGroup>

**`201 Created`**

```json theme={null}
{
  "status": true,
  "message": "Call initiated with location data",
  "callId": "665e4a34c65bb95f2f2d72e1",
  "gateway": {
    "transport": "websocket",
    "path": "/new-web-call/connection",
    "url": "wss://api.indigenius.ai/new-web-call/connection?assistant_id=665e4a34c65bb95f2f2d72e2&call_id=665e4a34c65bb95f2f2d72e1"
  }
}
```

Connect your audio client to `gateway.url` to begin the real-time session. Save `callId` to retrieve the transcript and analysis after the call ends.

**Common errors:** `400` invalid payload · `403` missing `calls:write` scope

***

## `POST /v1/calls/phone/initiate`

Initiates an outbound phone call to a real number via your purchased Indigenius phone number.

<CodeGroup>
  ```bash Bash theme={null}
  curl -X POST https://api.indigenius.ai/v1/calls/phone/initiate \
    -H "X-API-Key: $INDIGENIUS_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "phone_purchase_id": "665e4a34c65bb95f2f2d72e1",
      "phoneNumber": "+14155552671",
      "provider": "indigenius_telephony_1"
    }'
  ```

  ```javascript Node theme={null}
  const response = await fetch(
    'https://api.indigenius.ai/v1/calls/phone/initiate',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-API-Key': process.env.INDIGENIUS_API_KEY,
      },
      body: JSON.stringify({
        phone_purchase_id: '665e4a34c65bb95f2f2d72e1',
        phoneNumber: '+14155552671',
        provider: 'indigenius_telephony_1',
      }),
    },
  );
  console.log(await response.json());
  ```

  ```python Python theme={null}
  import requests, os

  response = requests.post(
      "https://api.indigenius.ai/v1/calls/phone/initiate",
      headers={
          "X-API-Key": os.environ["INDIGENIUS_API_KEY"],
          "Content-Type": "application/json",
      },
      json={
          "phone_purchase_id": "665e4a34c65bb95f2f2d72e1",
          "phoneNumber": "+14155552671",
          "provider": "indigenius_telephony_1",
      },
      timeout=30,
  )
  print(response.json())
  ```
</CodeGroup>

**Common errors:** `400` invalid payload · `403` missing `calls:write` scope · `404` phone purchase not found

***

## `GET /v1/calls/{id}`

Returns details for a specific call.

<CodeGroup>
  ```bash Bash theme={null}
  curl https://api.indigenius.ai/v1/calls/665e4a34c65bb95f2f2d72e1 \
    -H "X-API-Key: $INDIGENIUS_API_KEY"
  ```

  ```javascript Node theme={null}
  const callId = '665e4a34c65bb95f2f2d72e1';
  const response = await fetch(`https://api.indigenius.ai/v1/calls/${callId}`, {
    headers: { 'X-API-Key': process.env.INDIGENIUS_API_KEY },
  });
  console.log(await response.json());
  ```

  ```python Python theme={null}
  import requests, os

  call_id = "665e4a34c65bb95f2f2d72e1"
  response = requests.get(
      f"https://api.indigenius.ai/v1/calls/{call_id}",
      headers={"X-API-Key": os.environ["INDIGENIUS_API_KEY"]},
      timeout=30,
  )
  print(response.json())
  ```
</CodeGroup>

**`200 OK`**

```json theme={null}
{
  "status": true,
  "message": "Call details fetched",
  "data": {
    "id": "665e4a34c65bb95f2f2d72e1",
    "type": "web",
    "status": 2,
    "assistantId": "665e4a34c65bb95f2f2d72e2",
    "durationSeconds": 142,
    "createdAt": "2026-06-05T14:00:00.000Z",
    "endedAt": "2026-06-05T14:02:22.000Z"
  }
}
```

**Common errors:** `403` missing `calls:read` scope · `404` call not found

***

## `GET /v1/calls/{id}/transcripts`

Returns the full conversation transcript for a call.

<CodeGroup>
  ```bash Bash theme={null}
  curl https://api.indigenius.ai/v1/calls/665e4a34c65bb95f2f2d72e1/transcripts \
    -H "X-API-Key: $INDIGENIUS_API_KEY"
  ```

  ```javascript Node theme={null}
  const callId = '665e4a34c65bb95f2f2d72e1';
  const response = await fetch(
    `https://api.indigenius.ai/v1/calls/${callId}/transcripts`,
    { headers: { 'X-API-Key': process.env.INDIGENIUS_API_KEY } },
  );
  console.log(await response.json());
  ```

  ```python Python theme={null}
  import requests, os

  call_id = "665e4a34c65bb95f2f2d72e1"
  response = requests.get(
      f"https://api.indigenius.ai/v1/calls/{call_id}/transcripts",
      headers={"X-API-Key": os.environ["INDIGENIUS_API_KEY"]},
      timeout=30,
  )
  print(response.json())
  ```
</CodeGroup>

**`200 OK`**

```json theme={null}
{
  "status": true,
  "message": "Call transcripts fetched",
  "data": [
    { "role": "assistant", "content": "Hello, how can I help you today?" },
    { "role": "user", "content": "I'd like to track my order." }
  ]
}
```

***

## `GET /v1/calls/{id}/analysis`

Returns AI-generated post-call analysis including summary, sentiment, and tags.

<CodeGroup>
  ```bash Bash theme={null}
  curl https://api.indigenius.ai/v1/calls/665e4a34c65bb95f2f2d72e1/analysis \
    -H "X-API-Key: $INDIGENIUS_API_KEY"
  ```

  ```javascript Node theme={null}
  const callId = '665e4a34c65bb95f2f2d72e1';
  const response = await fetch(
    `https://api.indigenius.ai/v1/calls/${callId}/analysis`,
    { headers: { 'X-API-Key': process.env.INDIGENIUS_API_KEY } },
  );
  console.log(await response.json());
  ```

  ```python Python theme={null}
  import requests, os

  call_id = "665e4a34c65bb95f2f2d72e1"
  response = requests.get(
      f"https://api.indigenius.ai/v1/calls/{call_id}/analysis",
      headers={"X-API-Key": os.environ["INDIGENIUS_API_KEY"]},
      timeout=30,
  )
  print(response.json())
  ```
</CodeGroup>

**`200 OK`**

```json theme={null}
{
  "status": true,
  "message": "Call analysis fetched",
  "data": {
    "summary": "User called to track an order. Assistant confirmed delivery date.",
    "sentiment": "positive",
    "tags": ["order-tracking", "resolved"]
  }
}
```

**Common errors for all read endpoints:** `403` missing `calls:read` scope · `404` call not found
