# Trigger an Outbound Call

> Place an outbound phone call with a voice agent through its API Trigger

URL: https://docs.lemuai.com/api-reference/calls/trigger

Starts an outbound call to one phone number using a voice agent. This is the endpoint to call from your CRM, n8n, Zapier, or your own backend.

The `uuid` in the path identifies an **[API Trigger](https://docs.lemuai.com/voice-agent/api-trigger) node** in your agent, not the agent itself. Add an API Trigger node to the agent in the editor, save it, and copy the endpoint URL shown in the node's settings. The trigger must be active and still present in the agent's workflow.

**Note:** Your organization's telephony provider must be set up before calls can connect. See [Telephony](https://docs.lemuai.com/integrations/telephony/overview).

**Endpoint:** `POST /api/v1/public/agent/{uuid}`

## Headers

| Name | Required | Description |
|---|---|---|
| `X-API-Key` | Yes | An API key from the same organization as the agent. This endpoint only accepts the key in this header. |
| `Content-Type` | Yes | `application/json` |

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `uuid` | string | Yes | The trigger id of the agent's API Trigger node (the last part of the endpoint URL shown in the node). |

## Request body

| Field | Type | Required | Description |
|---|---|---|---|
| `phone_number` | string | Yes | The number to call, in international format with the country code, for example `+919876543210`. |
| `initial_context` | object | No | Data for this call, such as the customer's name or order id. Each key becomes a template variable the agent can use in its prompts (see below). |

**Example request:**

**cURL**

```bash
curl -X POST https://app.lemuai.com/api/v1/public/agent/4f1c2b7e-9a3d-4e21-b6a0-2d5f8c9e1a77 \
  -H "X-API-Key: lemu_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+919876543210",
    "initial_context": {
      "customer_name": "Priya",
      "order_id": "ORD-1042",
      "delivery_date": "28 October"
    }
  }'
```

**JavaScript**

```js
const res = await fetch("https://app.lemuai.com/api/v1/public/agent/4f1c2b7e-9a3d-4e21-b6a0-2d5f8c9e1a77", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.LEMU_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "phone_number": "+919876543210",
    "initial_context": {
      "customer_name": "Priya",
      "order_id": "ORD-1042",
      "delivery_date": "28 October"
    }
  }),
});
if (!res.ok) throw new Error(`LemuAI API ${res.status}: ${await res.text()}`);
const data = await res.json();
console.log(data);
```

**Python**

```python
import os

import requests

response = requests.post(
    "https://app.lemuai.com/api/v1/public/agent/4f1c2b7e-9a3d-4e21-b6a0-2d5f8c9e1a77",
    headers={
        "X-API-Key": os.environ["LEMU_API_KEY"],
    },
    json={
        "phone_number": "+919876543210",
        "initial_context": {
            "customer_name": "Priya",
            "order_id": "ORD-1042",
            "delivery_date": "28 October",
        },
    },
    timeout=30,
)
response.raise_for_status()
print(response.json())
```

## Using initial context

Values in `initial_context` are available to the agent as template variables. With the request above, a prompt like:
```
Hi {{customer_name}}, I'm calling about your order {{order_id}}, due on {{delivery_date}}.
```

is spoken as "Hi Priya, I'm calling about your order ORD-1042, due on 28 October." See [Template Variables](https://docs.lemuai.com/voice-agent/template-variables) for fallbacks and nested values.

## Response

**`200`**: the call was handed to your telephony provider.
```json
{
  "status": "initiated",
  "workflow_run_id": 18234,
  "workflow_run_name": "WR-API-4821"
}
```

| Field | Type | Description |
|---|---|---|
| `status` | string | Always `initiated` on success. The call is dialing; it has not been answered yet. |
| `workflow_run_id` | integer | The id of this call. It appears in [List calls](https://docs.lemuai.com/api-reference/agents/runs/list), in the dashboard, and in your Webhook node payload. |
| `workflow_run_name` | string | A short label for the call, shown in the dashboard. |

To receive the outcome when the call ends, add a [Webhook node](https://docs.lemuai.com/voice-agent/webhook) to the agent.

## Errors

| Status | When |
|---|---|
| `400` | Telephony isn't set up for your organization, or the provider refused the call (the reason is in `detail`) |
| `401` | The API key is missing or invalid |
| `402` | Your plan has no call minutes left |
| `403` | The API key belongs to a different organization than the agent |
| `404` | No trigger with this `uuid`, the trigger is turned off, or it was removed from the agent |
| `422` | `phone_number` is missing or the body isn't valid JSON |
