POST /calls/outbound endpoint lets you trigger an AI-powered outbound call from any external system. Use it to fire calls directly from your CRM when a lead is created, from an automation platform like Zapier or Make when a form is submitted, or from your own application when a specific event occurs. You can customize the agent’s greeting, inject customer-specific context, and pass dynamic variables — all without permanently changing the agent’s configuration.
Endpoint
Request headers
Your VoiceInfra API key. Generate one from Settings → API Keys in your dashboard.
Must be
application/json.Request body
The ID of the AI agent to use for this call. Find the agent ID in the API tab inside your agent’s settings in the VoiceInfra dashboard.
The caller ID displayed to the person you are calling. Must be in E.164 format (for example,
+18005551234). The number must be configured in your VoiceInfra account under Phone Numbers.The phone number to call. Must be in E.164 format (for example,
+14155550100).Override the agent’s default opening line for this specific call. Use this to personalise the greeting with the contact’s name or call-specific details without editing the agent permanently.
Additional context injected into the agent’s system prompt for this call only. Pass details such as the customer’s account tier, their last purchase, or any other information that should shape the agent’s behaviour during the conversation.
Key-value pairs injected as dynamic variables in the agent’s prompts. For example,
{"name": "Sarah", "company": "Acme"}. Reference variables in your agent’s prompt template using the variable names you define here.Full example request
cURL
Response
A successful request returns200 OK with a JSON body confirming the call has been queued.
Unique identifier for the initiated call. Use this to match the webhook event sent when the call completes.
Always
queued on a successful response — the call has been accepted and will connect shortly.The agent ID used for this call, echoed from your request.
The destination phone number, echoed from your request.
The caller ID used, echoed from your request.
ISO 8601 timestamp recording when the call was queued.
200 OK
Tracking call outcomes
After a call completes, VoiceInfra sends acall.completed webhook event to your configured endpoint. The webhook payload includes the call_id from this response, along with the transcript, recording URL, call outcome, and any data extracted by the agent.
Store the call_id immediately after initiating a call so you can reliably match it to the incoming webhook event.
Webhooks Reference
Full payload schema, signature verification, and delivery behaviour.
Webhooks Setup Guide
Configure your webhook endpoint and monitor delivery logs.
Dynamic per-call configuration
Thecontext and variables fields let you tailor agent behaviour for every individual call without touching the agent’s permanent configuration. This means one agent can handle thousands of personalised conversations — each shaped by the data you pass at call time.
Common use cases:
- Inject CRM data — pass the contact’s name, company, deal stage, or account notes so the agent speaks to them specifically
- Personalise the greeting — use
first_messageto open with the caller’s name and the purpose of the call - Set call-specific context — pass an appointment ID, order number, or policy reference so the agent can reference it naturally during the conversation
Variables you pass in the
variables object are available in your agent’s prompt template. Define the variable names in your agent configuration first, then populate them dynamically via the API.Code examples
Node.js
Python
Error handling
| Status | Code | Cause | Fix |
|---|---|---|---|
422 | invalid_phone | to_number or from_number is not in E.164 format | Reformat the number, e.g. +14155550100 |
404 | not_found | The agent_id does not exist or is inactive | Verify the agent ID in the API tab of your agent settings |
401 | unauthorized | API key is missing, invalid, or revoked | Check the X-API-Key header and regenerate the key if needed |