Skip to content

Calls API

POST /api/developer/v1/calls X-API-Key
Initiate one call
GET /api/developer/v1/calls X-API-Key
List calls
GET /api/developer/v1/calls/stats X-API-Key
Get call statistics
GET /api/developer/v1/calls/{call_id} X-API-Key
Get call details
POST /api/developer/v1/calls/{call_id}/cancel X-API-Key
Cancel an eligible call
POST /api/developer/v1/calls/bulk-initiate X-API-Key
Initiate a batch

agent_id and to_number are required for a single call. contact_name and custom_instruction are optional.

const response = await fetch(
"https://api.vaniagent.com/api/developer/v1/calls",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": process.env.VANIAGENT_API_KEY,
},
body: JSON.stringify({
agent_id: "agent_id_here",
to_number: "+919876543210",
contact_name: "Asha",
custom_instruction: "Ask which product category they enquired about.",
}),
},
);
const call = await response.json();

Treat initiation as asynchronous. Poll call detail or consume CRM webhooks for the terminal outcome. Cancellation only succeeds while the call remains cancellable.