Making Your First Call
The simplest way to make a call is with atask:
Simple vs Advanced Configuration
Simple Mode (Task)
For straightforward calls:Advanced Mode (Instructions)
For complex conversations with full control:Required Parameters
| Parameter | Type | Description |
|---|---|---|
phone_number | string | Destination number (E.164 format: +14155551234) |
task OR instructions | string | What the AI should do (one is required) |
Optional Parameters
Voice & Mode
GET /v1/voices/builtin and available models via GET /v1/models.
Realtime Mode provides the lowest latency (~200-500ms) and most natural conversations. Legacy Mode gives you full control over voice selection and language/dialect settings. Check model and voice availability via the API.
Call Control
Context & Personalization
lead_context values fill {{variable}} placeholders in your instructions and first sentence. Pass lead_id instead and the gateway builds the context from the stored lead record. campaign_id gives the agent the campaign’s attached knowledge base.
Webhooks
webhook_call_status_filter with the statuses you care about (for example ["completed", "failed"]); leave it out to receive every outcome. For account-wide or disposition-filtered delivery, use webhook subscriptions.
Custom Call Summaries
Every finished call includes an AI-written summary in the webhook payload and call record. Passsummary_prompt to control what it covers:
More Options
POST /v1/calls also accepts max_duration (minutes, up to 60), background_audio and background_audio_gain, bot_protection_enabled, analysis_schema for structured extraction, STT and TTS tuning knobs for legacy mode, and an Idempotency-Key header for safe retries. See the API reference for every field.
Complete Example: Appointment Reminder
Response
Checking Call Status
Use thecall_id to check status:
Call Statuses
| Status | Description |
|---|---|
pending | Call created, not yet queued |
queued | Call waiting to be dispatched |
in_progress | Call is active |
completed | Call finished successfully |
failed | Call failed (busy, no answer, error) |
cancelled | Call was cancelled |
Call Ending Behavior
The AI agent can end calls gracefully when the conversation is complete. This happens automatically when:- The user says goodbye or thanks you
- All questions have been answered
- The user explicitly asks to end the call
- The conversation naturally concludes
Common Patterns
Pattern 1: Simple Reminder
Pattern 2: Multi-Language Call
Error Handling
Invalid Phone Number
Insufficient Quota
Best Practices
Do This
- Validate phone numbers: Use E.164 format (
+14155551234) - Set first_sentence: Control how the call starts
- Use lead_context: Personalize with variables
- Configure webhooks: Get notified when calls complete
- Test first: Try with your own number before production
Avoid This
- Invalid formats: Always use E.164 format
- Missing instructions: Provide clear task or instructions
- Too long: Keep instructions focused (200-500 words)
- Ignore errors: Handle API errors gracefully
Next Steps
Function Calling
Give your AI tools to interact with your systems.
Webhooks
Receive real-time notifications when calls complete.