Use the Call API to make outbound calls, retrieve call details, and control live calls — record, play audio, speak text, send DTMF, transfer, or hang up. On completed calls, use
hangup_cause_name to determine the outcome.Call object is created when an outbound call is initiated or when an inbound call is received. Use the Call API to initiate outbound calls, retrieve call details, control ongoing calls, and build custom call flows.
The Call Object
Attributes
The billed duration of the call in seconds. May differ from
bill_duration depending on the billing interval.Reason the call was hung up. See hangup causes
Entity that triggered the hangup. Values:
Caller, Callee, Plivo, API Request, Answer XML, Error, Unknown.Legacy field retained for backward compatibility. Values:
ANSWER, EARLY MEDIA, DELAYED NEGOTIATION. Don’t use this field in your application logic — use hangup_cause_name to determine the call outcome.STIR/SHAKEN attestation info. Values:
Verified, Not Verified, Not Applicable. Read moreSTIR/SHAKEN attestation level assigned to the call. Values:
A, B, C. Read moreExample Call Object
Billing
Plivo bills for voice calls based on the answered call duration.When Billing Starts
Understanding CDR Fields
bill_duration: Actual call duration in secondsbilled_duration: Duration rounded to billing increment (typically 60 seconds)total_amount: Charge for the call based onbilled_duration×total_rate
Inbound calls to Plivo numbers are billed when answered. Outbound calls are billed when the destination answers. If a call is forwarded via
<Dial>, both legs (A-leg and B-leg) are billed separately once each is answered.Create a Call
Initiate an outbound call to a PSTN number or SIP endpoint. You can make simultaneous bulk calls by specifying multiple destinations.Arguments
Destination number(s) or SIP URI(s). Use
< to separate multiple destinations (max 1000).Custom SIP headers in
key=value format, separated by commas. Headers are prefixed with X-PH- on the outbound INVITE by default. When the originating leg uses SIP authentication, headers are forwarded bare (without the X-PH- prefix). Headers with reserved prefixes (PH-, Plivo, FS-, SipAuth, ZT-, Twilio) and the name ClientRegion are silently dropped. See SIP Authentication for details.SIP digest authentication username. Used when calling a SIP URI that requires authentication (the remote provider responds with 401/407 challenge). Only accepted when
to is a SIP URI. Must be provided together with sip_auth_password. See SIP Authentication.SIP digest authentication password. 8-128 characters, must include uppercase, lowercase, and digit. Required when
sip_auth_username is provided. Credentials are never logged, never included in CDR data, and never sent to your callback URLs.Type of call. Values:
voice, whatsapp_voice. Default: voice. When set to whatsapp_voice, the call is placed as a WhatsApp voice call. See WhatsApp Calling for details.Advanced Machine Detection Parameters
These parameters provide fine-grained control over answering machine detection behavior. They work in conjunction with themachine_detection parameter above.
Maximum duration of speech in milliseconds to analyze before making a determination. Range:
1000–6000.Duration of initial silence in milliseconds before the call is classified. Range:
2000–10000.Duration of silence in milliseconds after speech that indicates end of greeting. Range:
500–5000.Callbacks
ring_url parameters
ring_url parameters
answer_url / fallback_url parameters
answer_url / fallback_url parameters
hangup_url parameters
hangup_url parameters
Response
India Compliance Errors
Calls from India numbers require thefrom number to be rented on your account and to have a compliance application in accepted status. Requests that don’t meet these conditions return 400 bad request:
See India Number KYC for how to resolve each application status.
Retrieve a Call
Get the call detail record (CDR) of a specific call.Arguments
No arguments required.Response
The billed duration of the call in seconds. May differ from
bill_duration depending on the billing interval.Legacy field retained for backward compatibility. Values:
ANSWER, EARLY MEDIA, DELAYED NEGOTIATION. Don’t use this field in your application logic — use hangup_cause_name to determine the call outcome.Reason the call was hung up. See hangup causes
Entity that triggered the hangup. Values:
Caller, Callee, Plivo, API Request, Answer XML, Error, Unknown.List All Calls
Retrieve details of all completed calls. Maximum 20 results per request.Arguments
Filter by billed duration. Supports variants:
bill_duration__gt, bill_duration__gte, bill_duration__lt, bill_duration__lte.Filter by end time. Format:
YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Supports variants: end_time__gt, end_time__gte, end_time__lt, end_time__lte.Only calls from the last 90 days can be retrieved. If no
end_time filter is specified, Plivo searches the last 7 days. The maximum search range is 30 days.Response
Pagination metadata:
limit (results per page), offset (items skipped), total_count (total matching calls).Array of call objects — see The Call Object.
Retrieve a Live Call
Get details of a specific ongoing call.Response
List All Live Calls
Retrieve IDs of all ongoing calls.Response
List All Queued Calls
Retrieve IDs of all queued calls. Maximum 20 results per request.Response
Hang Up a Call
Hang up an ongoing call or cancel a queued outbound call.If
call_uuid is not specified, all ongoing calls in the account will be disconnected.Response
Transfer a Call
Transfer an in-progress call to fetch and execute XML from a different URL. This enables you to change call behavior asynchronously—for example, to play music while a call is on hold, queue calls, or transfer calls.Arguments
Response
Record a Call
- Start Recording
- Stop Recording
Play Audio
- Start Playing
- Stop Playing
Speak Text
- Start Speaking
- Stop Speaking
Send DTMF
Send DTMF digits on an active call. Use this to programmatically navigate external IVR systems or interact with automated phone menus.Common Use Cases
- Navigate external IVRs: When your call connects to a bank, support line, or other automated system that prompts “Press 1 for sales, 2 for support…”
- Enter PINs or account numbers: Automatically input credentials when connecting to voicemail or secure systems
- Automated testing: Test your own IVR flows programmatically
Arguments
Call leg to send DTMF. Values:
aleg, bleg. Default: aleg.- aleg: The first party (caller). Use when sending digits to an outbound call you initiated.
- bleg: The second party (callee). Use when sending digits to a call connected via
<Dial>.