Skip to main content

Make Your First Call

Connect two phone numbers with Exotel in under 5 minutes. This guide walks you through making a click-to-call API request that calls one phone first, then connects it to another.

How It Works​

  1. You make a POST request to Exotel's API
  2. Exotel calls the From number first (e.g., your agent)
  3. When they pick up, Exotel dials the To number (e.g., the customer)
  4. Both parties are connected through your ExoPhone (virtual number)
Why click-to-call?

This pattern is ideal for: sales teams calling leads, delivery agents calling customers, and support callbacks. The customer sees your ExoPhone number — not the agent's personal number.

Prerequisites​

Step 1: Set Up Your Credentials​

Store your credentials as environment variables:

export EXOTEL_API_KEY="your_api_key"
export EXOTEL_API_TOKEN="your_api_token"
export EXOTEL_ACCOUNT_SID="your_account_sid"
export EXOTEL_SUBDOMAIN="api.exotel.com"
Which subdomain?

Use api.exotel.com (Singapore) for most accounts, or api.in.exotel.com (Mumbai) for India-based accounts.

Step 2: Make Your First Call​

curl -X POST "https://$EXOTEL_API_KEY:$EXOTEL_API_TOKEN@$EXOTEL_SUBDOMAIN/v1/Accounts/$EXOTEL_ACCOUNT_SID/Calls/connect" \
-d "From=+919876543210" \
-d "To=+919123456789" \
-d "CallerId=YOUR_EXOPHONE" \
-d "Record=true" \
-d "StatusCallback=https://your-server.com/call-status" \
-d "StatusCallbackContentType=application/json"

Step 3: Check the Response​

A successful request returns:

{
"Call": {
"Sid": "c5797dcbaaeed7678c4062a4a3ed2f8a",
"DateCreated": "2026-02-25 10:48:33",
"AccountSid": "your_sid",
"To": "+919123456789",
"From": "+919876543210",
"PhoneNumberSid": "YOUR_EXOPHONE",
"Status": "in-progress",
"Direction": "outbound-api",
"RecordingUrl": null
}
}
FieldWhat it means
SidYour unique Call ID — save this to check status later
Statusin-progress means the call is being dialed
RecordingUrlPopulated after the call ends (if Record=true)
Call lifecycle

The call goes through these states: queued → in-progress → completed (or failed / busy / no-answer). Use Call Details or StatusCallback for the final status.

Step 4: Check Call Details (Optional)​

After the call ends, retrieve the final status and recording:

curl "https://$EXOTEL_API_KEY:$EXOTEL_API_TOKEN@$EXOTEL_SUBDOMAIN/v1/Accounts/$EXOTEL_ACCOUNT_SID/Calls/YOUR_CALL_SID.json"

Step 5: Handle Status Callbacks (Optional)​

If you set a StatusCallback URL, Exotel sends a webhook when the call completes:

{
"CallSid": "c5797dcbaaeed7678c4062a4a3ed2f8a",
"Status": "completed",
"From": "+919876543210",
"To": "+919123456789",
"Direction": "outbound-api",
"Duration": "45",
"RecordingUrl": "https://s3-ap-southeast-1.amazonaws.com/...",
"StartTime": "2026-02-25 10:48:33",
"EndTime": "2026-02-25 10:49:18"
}

See Voice Webhooks for the full payload reference.

Enable Call Recording​

  • Set Record=true in your request
  • Recording URL appears in the response and webhook as RecordingUrl
  • Use RecordingChannels=dual for separate agent/customer audio tracks
  • Formats available: mp3 (default) or mp3-hq for higher quality

What's Next?​