Calls · 2 min read
Trigger an Outbound Call
Place an outbound phone call with a voice agent through its API 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 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.
Your organization's telephony provider must be set up before calls can connect. See Telephony.
/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 -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"
}
}'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 for fallbacks and nested values.
Response#
200: the call was handed to your telephony provider.
{
"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, 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 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 |
Was this page helpful?
Docs