# Assign a missed call

`POST https://api.morevoice.ai/v1/missed_calls/{id}/assign`

As a supervisor: gives the item to a member to call back (they get a notice when the organization has them on), or back to the queue with `agent_id` null. Sends `missed_call.assigned`. Needs a live key, and a key that sees all the organization's calls.

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

Operation ID: `missed_calls_assign`.

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

Required, `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | `string \| null` | yes | `usr_…` ID. |
| `call_ids` | `string[]` | no | The item's calls as you listed them (`calls[].id`). Default: every call of the item now (a missed call that came in since you listed it is included). |

Example:

```json
{
  "agent_id": "usr_4Gk2LmN9pQ4rS6tV8wX0yZ"
}
```

## Responses

### 200 OK

OK Returns `MissedCall`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"missed_call"` | — |
| `id` | `string` | The item's ID: its newest call. Pass it to the missed-call actions. |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `kind` | `"abandoned" \| "overflow" \| "voicemail" \| "unanswered" \| "failed"` | How the newest call was missed: `abandoned` (the caller left while waiting or ringing), `overflow` (a queue or route had nobody to take it), `voicemail` (they left a message), `unanswered` (it rang out) or `failed` (it failed before anyone answered). |
| `phone` | `string \| null` | The caller's number (E.164); null when it was withheld. |
| `dialled` | `string \| null` | The number they called (your line). |
| `started_at` | `string` | When the newest call started. |
| `first_at` | `string` | When the first call of the item started. |
| `count` | `integer` | Missed calls in the item. When missed calls are work items, every unhandled missed call of a number is one item; otherwise each call is its own item (1). |
| `calls` | `object[]` | The item's calls, newest first. |
| `waited_ms` | `integer \| null` | How long the caller waited (in the queue, else the call's length). |
| `queue_id` | `string \| null` | `q_…` ID. |
| `agent_id` | `string \| null` | `usr_…` ID. |
| `handled` | `object \| null` | How and when it was handled; null while it is open. |
| `handled.by` | `"call" \| "callback" \| "manual"` | `call`: a later call reached the caller; `callback`: their callback was completed; `manual`: marked done. |
| `handled.at` | `string` | An ISO-8601 timestamp in UTC. |
| `handled.call_id` | `string \| null` | `call_…` ID. |
| `handled.agent_id` | `string \| null` | `usr_…` ID. |
| `attempts` | `object[]` | Calls back to the number that did not reach the caller (the last 10, oldest first). Listed when missed calls are work items; otherwise empty. |
| `attempts_total` | `integer` | All such attempts. |

Example:

```json
{
  "agent_id": null,
  "attempts": [
    {
      "agent_id": "usr_4Gk2LmN9pQ4rS6tV8wX0yZ",
      "at": "2026-11-03T08:30:00.000Z",
      "call_id": "call_2bVnT8kLq4MxZp7RwC1dYe",
      "result": "no_answer",
      "via": "agent"
    }
  ],
  "attempts_total": 1,
  "calls": [
    {
      "id": "call_8tRPaZp5hLMbrGqdJ9AmNa",
      "kind": "abandoned",
      "started_at": "2026-11-03T09:14:22.000Z"
    },
    {
      "id": "call_5mQwLk2Rt8ZpXa3BvN6cYd",
      "kind": "unanswered",
      "started_at": "2026-11-03T08:02:10.000Z"
    }
  ],
  "count": 2,
  "dialled": "+97235550000",
  "first_at": "2026-11-03T08:02:10.000Z",
  "handled": null,
  "id": "call_8tRPaZp5hLMbrGqdJ9AmNa",
  "kind": "abandoned",
  "livemode": true,
  "object": "missed_call",
  "phone": "+972501234567",
  "queue_id": "q_3hRf8Kd2LmPq",
  "started_at": "2026-11-03T09:14:22.000Z",
  "waited_ms": 48000
}
```

### 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 missedCall = await mv.missedCalls.assign("call_7Hk2Lm9Qp", {
	agent_id: "usr_4Gk2LmN9pQ4rS6tV8wX0yZ",
});
console.log(missedCall);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

missed_call = client.missed_calls.assign("call_7Hk2Lm9Qp", {
    "agent_id": "usr_4Gk2LmN9pQ4rS6tV8wX0yZ",
})
print(missed_call)
```

**cURL**

```sh
curl -X POST https://api.morevoice.ai/v1/missed_calls/call_7Hk2Lm9Qp/assign \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "agent_id": "usr_4Gk2LmN9pQ4rS6tV8wX0yZ"
}'
```
