# Supervise a call

`POST https://api.morevoice.ai/v1/calls/{id}/supervise`

Starts supervising a live call handled by an agent: `listen` (hear both sides, unheard), `whisper` (only the agent hears you) or `barge` (both hear you). Returns a pending supervision with a short-lived `client_token`: pass it to the supervisor's browser, where `supervise({ token })` of @morevoice/web connects the audio (WebRTC) over `ws_url`. The organisation's supervisor policy and the supervisor's role apply as on the supervisor board, and the agent is shown the supervisor when the policy says so. Change the mode with PATCH, end it with DELETE. AI calls answer 409 `unsupported_for_call_mode`.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `calls_supervise`.

## Parameters

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | A call ID (`call_…`). |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |
| `Idempotency-Key` | `string` | no | A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice. |

## Request body

Optional, `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `mode` | `"listen" \| "whisper" \| "barge"` | no | `listen`: the supervisor hears both sides and nobody hears them. `whisper`: the agent hears the supervisor, the customer never does. `barge`: the supervisor joins the conversation and both hear them. |
| `name` | `string` | no | The name the agent sees (when your supervisor policy shows supervisors to agents) and the audit trail records. Default: the member's name, else `Supervisor`. |
| `origin` | `string` | no | The only website the token opens the supervision from (`https://app.example.com`): the browser's Origin must match. Strongly recommended. Default: the agent session's origin, when `supervisor.agent_session_id` names one. http is accepted for localhost only. |
| `supervisor` | `object` | no | Who supervises. Omitted: your API key itself (its `supervision:write` scope), shown to the agent as `name`. |
| `supervisor.agent_session_id` | `string` | no | An agent session (POST /v1/agent_sessions) of a supervisor: the supervision is that member's, and it ends with the session. |
| `supervisor.user_id` | `string` | no | The member who supervises (a supervisor, admin or owner of the organisation): their role's permissions apply (whisper needs `supervisor.whisper`, barge `supervisor.barge`). |
| `ttl_s` | `integer` | no | How long the browser has to connect, in seconds (300–900, default 300). A supervision nobody joins in time ends (`not_connected`). Once connected, the socket hands out fresh tokens, so the supervision lasts as long as the call. |

Example:

```json
{
  "mode": "listen",
  "origin": "https://app.example.com",
  "supervisor": {
    "user_id": "usr_5ZaH2Ld9QmPx3RtYk8BvNw"
  }
}
```

## Responses

### 201 Created

The supervision, with the token its browser connects with. Returns `SupervisionWithToken`.

| Field | Type | Description |
| --- | --- | --- |
| `id` | `string` | The supervision's ID. |
| `object` | `"supervision"` | — |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `call_id` | `string` | The call being supervised. |
| `mode` | `"listen" \| "whisper" \| "barge"` | `listen`: the supervisor hears both sides and nobody hears them. `whisper`: the agent hears the supervisor, the customer never does. `barge`: the supervisor joins the conversation and both hear them. |
| `status` | `"pending" \| "active" \| "reconnecting" \| "ended"` | `pending`: the browser has not joined yet. `active`: the supervisor is on the call. `reconnecting`: the browser's connection dropped; it rejoins in the same mode by itself (the supervision ends if it is not back within 30 seconds). `ended`: see `end_reason`. |
| `supervisor` | `object` | Who supervises. |
| `supervisor.user_id` | `string \| null` | The member who supervises (given as `user_id`, or the agent session's member). |
| `supervisor.agent_session_id` | `string \| null` | The agent session it was started for, or null. |
| `supervisor.name` | `string` | The name the agent sees and the audit trail records. |
| `created` | `string` | An ISO-8601 timestamp in UTC. |
| `started_at` | `string \| null` | When the supervisor first joined the call. |
| `ended_at` | `string \| null` | — |
| `end_reason` | `"api" \| "left" \| "call_ended" \| "disconnected" \| "not_connected" \| "agent_session_ended" \| null` | Why it ended: `api` (DELETE), `left` (the browser left), `call_ended`, `disconnected` (the browser did not come back within 30 seconds), `not_connected` (nobody joined before the token expired), `agent_session_ended`. |
| `client_token` | `string` | A short-lived token for the supervisor's browser: `supervise({ token })` of @morevoice/web connects with it. It opens this supervision only; never put your API key in the page. |
| `ws_url` | `string` | Where the browser connects: `<ws_url>?client_token=<token>` (supervise() does it for you). |
| `expires_at` | `string` | The browser must connect before this. Once connected, it gets fresh tokens over the socket. |

Example:

```json
{
  "call_id": "call_8tRPaZp5hLMbrGqdJ9AmNa",
  "client_token": "<client_token: short-lived JWT, pass it to supervise() unchanged>",
  "created": "2026-11-23T09:14:22.000Z",
  "end_reason": null,
  "ended_at": null,
  "expires_at": "2026-11-23T09:19:22.000Z",
  "id": "sup_4Kx9QmZ2rTnB7dWc3Lp8Hs",
  "livemode": true,
  "mode": "listen",
  "object": "supervision",
  "started_at": null,
  "status": "pending",
  "supervisor": {
    "agent_session_id": null,
    "name": "Dana Levi",
    "user_id": "usr_5ZaH2Ld9QmPx3RtYk8BvNw"
  },
  "ws_url": "wss://api.morevoice.ai/ws/supervision"
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID (in the path or the body) exists in this organisation and mode. Returns `ErrorEnvelope`.

### 409 Conflict

The request conflicts with the object's state, or the Idempotency-Key was reused with other parameters. Returns `ErrorEnvelope`.

### 413 Payload Too Large

The request body is larger than the endpoint accepts, or has more parts or files than it takes. Returns `ErrorEnvelope`.

### 415 Unsupported Media Type

The request body's Content-Type is not one the endpoint takes. Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const supervisionWithToken = await mv.calls.supervise("call_7Hk2Lm9Qp", {
	mode: "listen",
	origin: "https://app.example.com",
	supervisor: {
		user_id: "usr_5ZaH2Ld9QmPx3RtYk8BvNw",
	},
});
console.log(supervisionWithToken);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

supervision_with_token = client.calls.supervise("call_7Hk2Lm9Qp", {
    "mode": "listen",
    "origin": "https://app.example.com",
    "supervisor": {
        "user_id": "usr_5ZaH2Ld9QmPx3RtYk8BvNw",
    },
})
print(supervision_with_token)
```

**cURL**

```sh
curl -X POST https://api.morevoice.ai/v1/calls/call_7Hk2Lm9Qp/supervise \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "mode": "listen",
  "origin": "https://app.example.com",
  "supervisor": {
    "user_id": "usr_5ZaH2Ld9QmPx3RtYk8BvNw"
  }
}'
```
