Calls API
Initiate one call
List calls
Get call statistics
Get call details
Cancel an eligible call
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.