Learn how to initiate outbound phone calls with Agentic AI’s CLI and API.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/IstiqlalBhat/aiagent/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before making calls, ensure you have:- Configured your Twilio credentials in
.env - Set up a public webhook URL (ngrok or Cloudflare tunnel)
- Started the Agentic AI server
Quick Start
The fastest way to make a call is using thetrigger command:
The server must be running before triggering a call. Start it with
agenticai server.Making Calls via CLI
Using the call Command
The call command initiates an outbound call and waits for it to complete:
--to,-t(required): Phone number in E.164 format (e.g., +15551234567)--prompt,-p(required): Instructions for the AI agent--webhook-url,-w(required): Public webhook base URL--config,-c(optional): Path to custom config.yaml
Using the trigger Command
The trigger command is a simplified version that uses the running server’s API:
--to,-t(required): Phone number to call--prompt,-p(optional): Custom prompt (uses default from config if not set)--webhook-url,-w(optional): Webhook URL (usesNGROK_URLenv var if not set)--server-url,-s(optional): Server URL (default: http://localhost:8080)
Making Calls via API
You can initiate calls programmatically using the REST API.API Endpoint
POST/api/call
Request Body:
cURL Example
Python Example
Call Lifecycle
Understanding the call flow:Customizing Call Behavior
Custom Prompts
The prompt defines the AI’s personality and objectives:Using Metadata
Add metadata to track calls in your system:Monitoring Active Calls
List Active Calls
Check Server Status
Troubleshooting
Call not connecting
Call not connecting
Symptoms: Call initiated but never connectsSolutions:
-
Verify Twilio credentials:
-
Check webhook URL is publicly accessible:
-
Ensure server is running:
-
Check server logs:
AI not responding during call
AI not responding during call
Symptoms: Call connects but AI is silentSolutions:
- Verify OpenAI API key has Realtime API access
- Check WebSocket connection in server logs
- Confirm audio codec compatibility (Twilio uses μ-law)
- Test with a different voice:
src/agenticai/cli.py:65-100Error: Missing webhook URL
Error: Missing webhook URL
Symptoms:
Error: --webhook-url required or set NGROK_URL environment variableSolutions:-
Set the environment variable:
-
Or provide it in the command:
src/agenticai/cli.py:479-484Next Steps
Receiving Calls
Set up incoming call handling
Scheduling Calls
Automate calls with schedules
Telegram Integration
Get live call transcripts
Service Management
Run as a background service