LemuAIDocs

Calls · 2 min read

Trigger an Outbound Call

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

Open in ChatGPTOpen in ClaudeMarkdown

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.

POST/api/v1/public/agent/{uuid}

Headers#

NameRequiredDescription
X-API-KeyYesAn API key from the same organization as the agent. This endpoint only accepts the key in this header.
Content-TypeYesapplication/json

Path parameters#

NameTypeRequiredDescription
uuidstringYesThe trigger id of the agent's API Trigger node (the last part of the endpoint URL shown in the node).

Request body#

FieldTypeRequiredDescription
phone_numberstringYesThe number to call, in international format with the country code, for example +919876543210.
initial_contextobjectNoData 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
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:

Text
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.

JSON
{
  "status": "initiated",
  "workflow_run_id": 18234,
  "workflow_run_name": "WR-API-4821"
}
FieldTypeDescription
statusstringAlways initiated on success. The call is dialing; it has not been answered yet.
workflow_run_idintegerThe id of this call. It appears in List calls, in the dashboard, and in your Webhook node payload.
workflow_run_namestringA 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#

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

Was this page helpful?