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

# Make Call

> Tenant-scoped voice call operation for starting outbound AI calls or coordinating Twilio call setup.

Tenant-scoped voice call operation for starting outbound AI calls or coordinating Twilio call setup.

### Request body

`MakeCallRequest`

<ParamField body="agent_key" type="string,null">
  Optional stable agent key to resolve the currently published version
</ParamField>

<ParamField body="agent_name" type="string,null">
  Optional agent name override
</ParamField>

<ParamField body="agent_version_id" type="string,null">
  Optional explicit agent version id
</ParamField>

<ParamField body="config" type="object">
  Transient inline agent config for THIS call only (same shape and
  validation as `POST /voice/agents` `config`, including custom `tools`).
  Mutually exclusive with `agent_version_id`.
</ParamField>

<ParamField body="from" type="string,null">
  Source phone number (defaults to tenant's Twilio number)
</ParamField>

<ParamField body="greeting" type="string,null">
  Optional custom greeting message for the AI agent
</ParamField>

<ParamField body="machine_detection" type="string,null">
  Answering-machine detection: `off`, `enable`, or `detect_message_end`.
  Defaults to `off`.
</ParamField>

<ParamField body="max_attempts" type="integer,null (int32)">
  Max call attempts including the initial try (1..=5). Defaults to 1.
</ParamField>

<ParamField body="metadata" type="object">
  Opaque caller-supplied metadata (e.g. campaign ids). A JSON object of at
  most 4 KB; persisted on the outbound attempt row and inherited by retry
  children.
</ParamField>

<ParamField body="org_id" type="string,null">
  Optional organization ID for multi-org support
</ParamField>

<ParamField body="retry_backoff_seconds" type="integer,null (int32)">
  Backoff before the next retry, in seconds (max 3600). 0 = immediate.
</ParamField>

<ParamField body="retry_on" type="array,null">
  Terminal outcomes that should trigger a retry: `no_answer`, `busy`,
  `failed`, or `voicemail` (snake\_case). Ignored when `max_attempts == 1`.
</ParamField>

<ParamField body="to" type="string" required>
  Destination phone number (E.164 format recommended)
</ParamField>

### Response

`MakeCallResponse`

<ResponseField name="call_sid" type="string,null">
  Twilio call SID for tracking
</ResponseField>

<ResponseField name="error" type="string,null">
  Error message (if failed)
</ResponseField>

<ResponseField name="from" type="string,null">
  Source phone number
</ResponseField>

<ResponseField name="ok" type="boolean" required>
  Whether the call was initiated successfully
</ResponseField>

<ResponseField name="status" type="string,null">
  Current call status
</ResponseField>

<ResponseField name="to" type="string,null">
  Destination phone number
</ResponseField>

### Status codes

| Code  | Meaning                                  |
| ----- | ---------------------------------------- |
| `200` | Outbound call initiated                  |
| `400` | Bad request                              |
| `409` | Same Idempotency-Key currently in flight |
| `500` | Internal server error                    |
| `503` | Twilio not configured                    |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.voice.stateset.com/api/v1/make-call' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "agent_key": "support_primary",
    "from": "+15555551234",
    "greeting": "Hi, this is Acme Dental calling about your appointment.",
    "org_id": "org-456",
    "to": "+15555555678"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "call_sid": "CA1234567890abcdef1234567890abcdef",
    "from": "+15555551234",
    "ok": true,
    "status": "queued",
    "to": "+15555555678"
  }
  ```
</ResponseExample>
