# Create an outbound call

`POST https://api.morevoice.ai/v1/calls`

Places an outbound call with an assistant, or with a published voice flow and its assistant. `purpose` is required: it drives the outbound compliance checks (do-not-call list for every call; recorded consent and the national registry for marketing). The Idempotency-Key header is required, so a retried request never calls anyone twice. Test-mode keys place simulated calls that never reach a phone network.

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

Operation ID: `calls_create`.

## Parameters

### 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`. An outbound call to place.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `to` | `string` | yes | The number to call, E.164. |
| `purpose` | `"service" \| "marketing" \| "survey"` | yes | service, marketing or survey. Marketing calls need recorded consent and pass the national do-not-call registry (§30A). |
| `amd` | `object` | no | Answering-machine detection (default: the assistant's setting). |
| `amd.enabled` | `boolean` | yes | Detect answering machines. |
| `amd.message` | `string` | no | Spoken after the beep with on_machine=leave_message (default: the assistant's message). |
| `amd.on_machine` | `"hangup" \| "leave_message"` | no | What to do on a machine (default hangup). |
| `assistant_id` | `string` | no | The assistant that handles the call. Pass this or flow_id (or a connect-mode `stream`). |
| `caller_id` | `string` | no | The number to present; it must be allowed on the connection: one of its numbers, or a caller ID you verified (POST /v1/caller_ids, when caller-ID verification is enabled for the organisation). |
| `connection_id` | `string` | no | The SIP connection to call out on (default: the organisation's default connection). |
| `first_message` | `string` | no | What the assistant says first on this call, instead of its own first message. At most 500 characters, at most 2,000 once rendered. `{{name}}` placeholders are filled from `variables`, and each one must be there (an empty string says nothing). The assistant speaks first; when the call needs an AI disclosure, it is still said before this text. Empty: the assistant's own first message. Not with `flow_id`, an assistant that runs a voice flow (the flow's Start node speaks first) or a connect-mode `stream`. |
| `flow_id` | `string` | no | A published voice flow; it runs on its linked assistant. Pass this or assistant_id. |
| `from_number_id` | `string` | no | The phone number to call from (`pn_…`, GET /v1/phone_numbers): it sets the connection and the caller ID. Or pass connection_id and caller_id. |
| `max_duration_s` | `integer` | no | End the call after this many seconds (default: the assistant's limit). |
| `metadata` | `MetadataInput` | no | Up to 50 key/value pairs (keys up to 40 characters, values up to 500) you attach to an object. Returned as sent. |
| `stream` | `CallStreamParamsInput` | no | A media stream on the new call, in the Twilio Media Streams format: `connect` hands the call to your bot (the AI disclosure plays first; your bot gets `start` and the caller's audio after it), `fork` copies its audio to your server. |
| `stream.url` | `string` | yes | Your bot's WebSocket URL (`wss://`). The upgrade is signed with your signing secret (`webhook-id`, `webhook-timestamp`, `webhook-signature` over the path and query). |
| `stream.mode` | `"connect" \| "fork"` | yes | `connect`: your bot runs the call instead of an assistant (omit `assistant_id` and `flow_id`): it hears the caller and what it sends is played. `fork`: a one-way copy of the call's audio while the assistant runs it (as POST /v1/calls/{id}/streams); it opens when the call is placed and carries audio once it is answered. |
| `stream.custom_parameters` | `Record<string, string>` | no | Up to 20 string key/values the receiver gets in `start.customParameters` (as Twilio's stream parameters). |
| `stream.fallback_assistant_id` | `string` | no | connect: the assistant that takes the call if your bot can't be reached or drops; without one, the caller hears a short apology and the call ends. |
| `stream.format` | `"mulaw_8000" \| "l16_16000" \| "l16_8000"` | no | `mulaw_8000` (the default): G.711 μ-law at 8 kHz, Twilio's; `l16_16000` / `l16_8000`: signed 16-bit PCM, little-endian. |
| `stream.language` | `"he" \| "en"` | no | The language of what the platform itself says on the call: the AI disclosure before your bot hears the caller, and the apology if your bot drops with no fallback (default: the fallback assistant's, else Hebrew). |
| `stream.tracks` | `"inbound" \| "outbound" \| "both"` | no | fork: `inbound` (the caller), `outbound` (what the caller hears) or `both` (the default). |
| `stream.transcribe` | `boolean` | no | Also transcribe the caller and your bot (default false: the call is recorded, with no transcript). |
| `variables` | `Record<string, string>` | no | Template variables for the prompt, first message and flow ({{customer_name}}); at most 50. |

Example:

```json
{
  "assistant_id": "asst_4Gk2LmN9pQ4rS6tV8wX0yZ",
  "from_number_id": "pn_4Gk2LmN9pQ4rS6tV8wX0yZ",
  "metadata": {
    "crm_contact_id": "0031x00000AbCdE"
  },
  "purpose": "service",
  "to": "+972501234567",
  "variables": {
    "customer_name": "Dana"
  }
}
```

## Responses

### 201 Created

Created Returns `Call`.

| Field | Type | Description |
| --- | --- | --- |
| `id` | `string` | A call ID (prefix `call_`). |
| `object` | `"call"` | — |
| `type` | `CallType` | Who handles the call: an AI assistant, a human agent, an IVR flow, a conference room, or a voicemail box. One of `"ai"`, `"human"`, `"ivr"`, `"conference"`, `"voicemail"`. |
| `direction` | `CallDirection \| null` | One of `"inbound"`, `"outbound"`, `"browser"`. |
| `transport` | `"sip" \| "webrtc"` | `sip` for phone calls, `webrtc` for browser calls, conference rooms and WhatsApp calls. |
| `channel` | `"phone" \| "web" \| "whatsapp"` | How the call came in or went out: `phone` (a phone number or SIP trunk), `web` (a browser call, a conference room, the web widget) or `whatsapp` (a WhatsApp call: its media is WebRTC, so `transport` is `webrtc`). New channels may be added: treat an unknown value as other. |
| `status` | `CallStatus` | `queued` (placed, not ringing yet), `ringing`, `in_progress` (answered, or an inbound call being handled) or `ended`. One of `"queued"`, `"ringing"`, `"in_progress"`, `"ended"`. |
| `from` | `string \| null` | The calling number (E.164 when it is a phone number) or name. |
| `to` | `string \| null` | The called number (E.164 when it is a phone number) or destination. |
| `assistant_id` | `string \| null` | `asst_…` ID. |
| `flow_id` | `string \| null` | `flow_…` ID. |
| `flow_version` | `integer \| null` | The flow version that ran (0: an unpublished draft). |
| `queue_id` | `string \| null` | `q_…` ID. |
| `agent_id` | `string \| null` | The human agent who handled the call (`usr_…`). |
| `campaign_id` | `string \| null` | `cmp_…` ID. |
| `contact_id` | `string \| null` | `ctc_…` ID. |
| `connection_id` | `string \| null` | `conn_…` ID. |
| `api_key_id` | `string \| null` | The API key that created the call (`key_…`). |
| `purpose` | `CallPurpose \| null` | One of `"service"`, `"marketing"`, `"survey"`. |
| `started_at` | `string` | When the call started: dialled out, or rang in. |
| `answered_at` | `string \| null` | — |
| `ended_at` | `string \| null` | — |
| `duration_ms` | `integer \| null` | — |
| `end_reason` | `string \| null` | Why the call ended, e.g. `customer-ended-call`, `assistant-ended-call`, `customer-busy`, `customer-did-not-answer`. |
| `answered_by` | `CallAnsweredBy \| null` | One of `"human"`, `"machine"`, `"unknown"`. |
| `disposition` | `string \| null` | The business outcome recorded on the call (set_outcome tool, or the summary). |
| `has_recording` | `boolean` | — |
| `ai_generated` | `boolean` | Machine-readable marking (EU AI Act Art. 50(2)): true when the call contains speech generated by AI — an AI voice agent, or synthetic-voice IVR prompts. Recordings of such calls carry the same tag in their file metadata. |
| `ai_segments` | `CallAiSegment[]` | When AI-generated speech was played, in ms from the start of the call (empty when `ai_generated` is false). |
| `recording_announced` | `boolean` | The caller heard, in full, that the call is recorded: the recording notice of a call with agents, or an AI disclosure that includes it. `false` when no such notice played (or played only in part). Calls made before these facts were recorded say `false`. |
| `recording_announced_at` | `string \| null` | When the recording notice finished playing; null when `recording_announced` is false. |
| `ai_disclosure_played` | `boolean` | The caller heard, in full, that they are speaking with an AI (the AI disclosure). `false` when none played, or the caller left before it ended. Calls made before these facts were recorded say `false`. |
| `ai_disclosure_played_at` | `string \| null` | When the AI disclosure finished playing; null when `ai_disclosure_played` is false. |
| `consent_basis` | `CallConsentBasis \| null` | PROVISIONAL (values pending legal review): the basis on record for recording the call and processing what was said; null when there is none on record. Gate recording-based processing (for example AI analysis of the transcript) on a basis you accept. One of `"notice"`. |
| `summary` | `CallSummary \| null` | — |
| `summary.object` | `"call_summary"` | — |
| `summary.call_id` | `string` | A call ID (prefix `call_`). |
| `summary.text` | `string` | A two-to-four sentence summary, in the language of the call. |
| `summary.intent` | `string` | What the caller wanted. |
| `summary.outcome` | `string` | How the call ended, or what was agreed. |
| `summary.sentiment` | `"positive" \| "neutral" \| "negative" \| "mixed"` | — |
| `summary.key_points` | `string[]` | — |
| `summary.action_items` | `string[]` | Follow-ups for your business; empty when there are none. |
| `summary.generated_at` | `string \| null` | — |
| `cost` | `CallCost \| null` | Set once the call has ended (never null then); null while it is in progress. |
| `cost.amount` | `integer` | The amount in the currency's minor unit (cents, agorot), rounded. |
| `cost.amount_decimal` | `string` | The exact amount in minor units, as a decimal string (sub-cent precision). |
| `cost.currency` | `string` | ISO 4217 currency code. |
| `cost.estimate` | `boolean` | true: an estimate from provider usage, not a billed amount. |
| `variables` | `Record<string, string>` | The variables the call was created with. |
| `metadata` | `Metadata` | Up to 50 key/value pairs (keys up to 40 characters, values up to 500) you attach to an object. Returned as sent. |
| `whatsapp` | `CallWhatsApp \| null` | A WhatsApp call's ids (`channel` whatsapp); null for every other call. Its `metadata` carries the labels the messaging platform relayed with the call. |
| `whatsapp.wacid` | `string \| null` | WhatsApp's id of the call; null on a call placed with POST /v1/whatsapp_calls until WhatsApp names it. |
| `whatsapp.whatsapp_number_id` | `string` | The WhatsApp number the call is on (`wan_…`, GET /v1/whatsapp_numbers/{id}). |
| `whatsapp.whatsapp_phone_number_id` | `string` | WhatsApp's ID of that business phone number (digits). |
| `whatsapp.whatsapp_user_id` | `string \| null` | The caller's WhatsApp user ID when WhatsApp sent one (callers who hide their number have only this); on a call placed to a `recipient`, that user ID; null otherwise. The caller's number, when visible, is `from`. |
| `whatsapp.whatsapp_user_name` | `string \| null` | A call the WhatsApp user placed: the caller's WhatsApp profile name, as WhatsApp sent it with the call (control characters removed, at most 256 characters); null when WhatsApp sent none, or no contact of the event was the caller, and on a call placed with POST /v1/whatsapp_calls. A display name the user chose, not a verified identity: show it, never decide on it. It is the caller's personal data, erased with the call's other personal data. |
| `whatsapp.biz_opaque_callback_data` | `string \| null` | On a call placed with POST /v1/whatsapp_calls: the `biz_opaque_callback_data` it was placed with, as sent to WhatsApp; null otherwise. |
| `whatsapp.cta_payload` | `string \| null` | A call the WhatsApp user placed from a call button: the button's payload, as WhatsApp sent it with the call (trimmed, control characters removed, at most 512 characters); null otherwise. Display data: it tells which button started the call. |
| `whatsapp.deeplink_payload` | `string \| null` | A call the WhatsApp user placed from a call link: the link's payload, as WhatsApp sent it with the call (control characters removed, at most 512 characters); null otherwise. Display data: it tells which link started the call. |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `assistant` | `CallAssistant` | The assistant of the call (expand[]=assistant). |
| `assistant.id` | `string` | A assistant ID (prefix `asst_`). |
| `assistant.object` | `"assistant"` | — |
| `assistant.name` | `string` | — |
| `assistant_version` | `string \| null` | The version of the assistant's settings the call ran with (everything but its name and metadata). Opaque (16 hex characters): equal values mean the same settings, a new value means they changed. With turn tracing on; null for a call no assistant or flow ran. |
| `prompt_version` | `string \| null` | The version of what the assistant was told to say: its system prompt, first, idle and end-of-call messages, and the flow and flow version. Opaque (16 hex characters): equal values mean the same settings, a new value means they changed. With turn tracing on; null for a call no assistant or flow ran. |

Example:

```json
{
  "agent_id": null,
  "ai_disclosure_played": true,
  "ai_disclosure_played_at": "2026-11-03T09:14:35.020Z",
  "ai_generated": true,
  "ai_segments": [
    {
      "end_ms": 99710,
      "source": "assistant",
      "start_ms": 0
    }
  ],
  "answered_at": "2026-11-03T09:14:29.410Z",
  "answered_by": "human",
  "api_key_id": "key_9i2E2pKO6g3z4nXl57Qb4g",
  "assistant_id": "asst_4Gk2LmN9pQ4rS6tV8wX0yZ",
  "campaign_id": null,
  "channel": "phone",
  "connection_id": "conn_2bF8kQ1nR7sT3vW5xY9zA0",
  "consent_basis": "notice",
  "contact_id": null,
  "cost": {
    "amount": 4,
    "amount_decimal": "4.2310",
    "currency": "USD",
    "estimate": true
  },
  "direction": "outbound",
  "disposition": null,
  "duration_ms": 99710,
  "end_reason": "customer-ended-call",
  "ended_at": "2026-11-03T09:16:02.120Z",
  "flow_id": null,
  "flow_version": null,
  "from": "+97237654321",
  "has_recording": true,
  "id": "call_8tRPaZp5hLMbrGqdJ9AmNa",
  "livemode": true,
  "metadata": {
    "crm_contact_id": "0031x00000AbCdE"
  },
  "object": "call",
  "purpose": "service",
  "queue_id": null,
  "recording_announced": true,
  "recording_announced_at": "2026-11-03T09:14:35.020Z",
  "started_at": "2026-11-03T09:14:22.000Z",
  "status": "ended",
  "summary": null,
  "to": "+972501234567",
  "transport": "sip",
  "type": "ai",
  "variables": {
    "customer_name": "Dana"
  },
  "whatsapp": null
}
```

### 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 call = await mv.calls.create({
	assistant_id: "asst_4Gk2LmN9pQ4rS6tV8wX0yZ",
	from_number_id: "pn_4Gk2LmN9pQ4rS6tV8wX0yZ",
	metadata: {
		crm_contact_id: "0031x00000AbCdE",
	},
	purpose: "service",
	to: "+972501234567",
	variables: {
		customer_name: "Dana",
	},
});
console.log(call);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

call = client.calls.create({
    "assistant_id": "asst_4Gk2LmN9pQ4rS6tV8wX0yZ",
    "from_number_id": "pn_4Gk2LmN9pQ4rS6tV8wX0yZ",
    "metadata": {
        "crm_contact_id": "0031x00000AbCdE",
    },
    "purpose": "service",
    "to": "+972501234567",
    "variables": {
        "customer_name": "Dana",
    },
})
print(call)
```

**cURL**

```sh
curl -X POST https://api.morevoice.ai/v1/calls \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "assistant_id": "asst_4Gk2LmN9pQ4rS6tV8wX0yZ",
  "from_number_id": "pn_4Gk2LmN9pQ4rS6tV8wX0yZ",
  "metadata": {
    "crm_contact_id": "0031x00000AbCdE"
  },
  "purpose": "service",
  "to": "+972501234567",
  "variables": {
    "customer_name": "Dana"
  }
}'
```
