Skip to main content

Initiate Outbound Call

Initiate an outbound call from a phone number linked to your SFVoPI app. The call is placed asynchronously — the API returns immediately with a request_uuid and queued status. You'll receive webhook callbacks as the call progresses through its lifecycle.

Asynchronous Operation

This endpoint returns immediately after queuing the call. Use the request_uuid to correlate webhook callbacks (ring_url, answer_url, hangup_url) that notify you of call state changes.

Authentication

Requires X-API-Key header. See Authentication for details.

Endpoint

POST /sfvopi/calls

Base URL: https://prod-api.superfone.co.in/superfone

Request Body

All fields are validated and phone numbers are automatically normalized to E.164 format.

FieldTypeRequiredDefaultDescriptionValidation
fromstringYes-Your phone number (must be linked to an active SFVoPI app)E.164 format (e.g., +918000000003)
tostringYes-Destination phone number to callE.164 format (e.g., +918000000001)
answer_urlstringYes-Webhook URL called when callee answersValid HTTPS/HTTP URL
answer_methodstringNoPOSTHTTP method for answer webhookPOST or GET
ring_urlstringNo-Webhook URL called when phone starts ringingValid HTTPS/HTTP URL
ring_methodstringNoPOSTHTTP method for ring webhookPOST or GET
hangup_urlstringNo-Webhook URL called when call endsValid HTTPS/HTTP URL
hangup_methodstringNoPOSTHTTP method for hangup webhookPOST or GET
call_time_limitnumberNo14400Maximum call duration in seconds (4 hours default)Min: 1, Max: 86400 (24 hours)
ring_timeoutnumberNo60Maximum ring duration in seconds before giving upMin: 1, Max: 600 (10 minutes)
From Number Must Be Linked

The from number MUST be linked to an active SFVoPI app in your organization. If not, you'll receive a 400 error. Use the Link Number endpoint to link numbers first.

Webhook URL Overrides

Webhooks specified in this request override the app's default webhook URLs for this specific call only. This allows per-call customization without modifying your app configuration.

Code Examples

curl -X POST https://prod-api.superfone.co.in/superfone/sfvopi/calls \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"from": "+918000000003",
"to": "+918000000001",
"answer_url": "https://example.com/webhook/answer",
"answer_method": "POST",
"ring_url": "https://example.com/webhook/ring",
"ring_method": "POST",
"hangup_url": "https://example.com/webhook/hangup",
"hangup_method": "POST",
"call_time_limit": 300,
"ring_timeout": 30
}'

Success Response

Status Code: 200 OK

{
"data": {
"request_uuid": "sfv_ob_req_a8k3m2x9p1z0",
"status": "queued"
},
"message": "success"
}

Response Fields

FieldTypeDescription
request_uuidstringUnique identifier for this call request (format: sfv_ob_req_xxxxxxxxxxxx)
statusstringCall status — always queued on successful initiation

Error Responses

Status CodeMessageWhen It Occurs
400VoIP number {from} is not linked to any SFVoPI app for this orgThe from number is not linked to an active SFVoPI app in your organization
400Invalid request bodyRequest body validation failed (invalid phone format, missing required fields, out-of-range values)
401UnAuthorized, Please Provide Valid API KeyMissing or invalid X-API-Key header
500Failed to initiate outbound callService temporarily unavailable. Retry after a few seconds or contact support.
500Failed to initiate outbound call: {error}Unexpected server error

Call Lifecycle

After initiating a call, it progresses through the following states:

State Descriptions

StateDescriptionWebhook Called
queuedCall request accepted, being placedNone
ringingPhone is ringingring_url (if provided)
answeredCallee answered the callanswer_url
in_progressAudio streaming activeNone
completedCall ended normallyhangup_url (if provided)
failedCall failed (network issue, unreachable)hangup_url (if provided)
no_answerCallee didn't answer within ring_timeouthangup_url (if provided)
busyCallee was busyhangup_url (if provided)
canceledCall canceled before being answeredhangup_url (if provided)

Call Flow Diagram

Notes

  • Asynchronous Operation: The API returns immediately with queued status. The actual call placement happens asynchronously. Monitor webhooks for real-time call state updates.

  • Request UUID: Use the request_uuid to correlate webhook callbacks with this specific call request. All webhooks for this call will include this identifier.

  • Phone Number Normalization: Input phone numbers are automatically normalized to E.164 format. You can provide numbers with or without country code, spaces, or dashes — they'll be validated and standardized.

  • Webhook Overrides: Webhooks specified in this request (ring_url, answer_url, hangup_url) override the app's default webhook URLs for this call only. If not provided, the app's defaults are used.

  • Call Time Limits: The call_time_limit enforces maximum call duration. Calls exceeding this limit are automatically terminated. The ring_timeout limits how long the phone rings before giving up.

  • Error Handling: In rare cases, the service may be temporarily unavailable and return a 500 error. Retry after a few seconds or contact support if it persists.

Next Steps