Making Calls
The /Calls/ function serves several purposes. In this section, we will cover the creating new calls utilizing POST variables.

Section URI


Supported Operations

HTTP GET Returns a list representation of all Call resources for this Account, including the properties above.
HTTP POST Makes a new Call and returns a representation of the Call resource, including the properties above

Request Parameters

The phone number to use as the caller id.
To (Required)
The phone number to call.
Url (Required)
The fully qualified URL that should be executed when the call connects.
The HTTP method teleapi should use when making its request to the above Url. Defaults to POST.
The URL that teleapi will request if execution of Url fails for any reason.
The HTTP method that teleapi should use to request the FallbackUrl. Must be either GET or POST. Defaults to POST.
A comma separated list of events on which we are interested to get a callback on. Possible values are initiated, ringing, answered, completed. Defaults to none.
URL to receive the callback events at. Defaults to none.
Set to GET or POST. Defaults to POST.
The number of seconds that teleapi should allow the phone to ring before assuming there is no answer. Defaults to 60 seconds.
Set to yes in your teleapi call and "VoicemailDetector" will be added to the response post (beta).
When creating a Call using the Calls API, an outbound call is initiated. The call transitions from the initiated state to the ringing state when the phone starts ringing. It transitions to the answered state when the call is picked up, and finally to the completed state when the call is over. With StatusCallbackEvent, you can subscribe to receive webhooks for the different call progress events: initiated, ringing, answered, or completed for a given call.
The StatusCallbackEvent attribute allows you to specify which events teleapi should webhook on. To specify multiple events separate them with a comma as follows: initiated,ringing,answered,completed. If a StatusCallback is provided and no status callback events are specified, the completed event will be sent by default.
Outbound Dial call events diagram
The initiated event is fired when teleapi starts dialing the call.
The ringing event is fired when the call starts ringing.
The answered event is fired when the call is answered.
The completed event is fired when the call is completed, regardless of the termination status: busy, canceled, completed, failed, or no-answer. If no StatusCallbackEvent is specified, completed will be fired by default.
person_found or voicemail is sent if the original request had DetectVoicemail on it.
The StatusCallback attribute allows you to specify a URL for teleapi to send webhook requests to on each event specified in the StatusCallbackEvent attribute.
The StatusCallbackMethod attribute allows you to specify which HTTP method teleapi should use when requesting the URL in the StatusCallback attribute. The default is POST
Status Callback HTTP Parameters
The parameters teleapi passes to your application in an asynchronous request to the StatusCallback URL include all parameters passed in a synchronous request to retrieve RCML when teleapi receives a call to one of your teleapi numbers. The full list of parameters and descriptions of each are in the RCML Voice Request documentation.
When the call progress events are fired, the Status Callback request also passes these additional parameters:
A unique identifier for this call generated by teleapi. You can use CallSid to modify the child call by POSTing to Calls/{CallSid} with a new RCML URL.
A descriptive status for the call. The value is one of queued, initiated, ringing, in-progress, busy, failed, or no-answer. See CallStatus for more details.
The duration of the just-completed call, in seconds. Only present in the completed event.
The timestamp when the event was fired, given as UTC in RFC 2822 format.
A string that describes the source of the webhook. This is provided to help disambiguate why the webhook was made. On Status Callbacks, this value is always call-progress-events.
The order in which the events were fired, starting from 0. Although events are fired in order, they are made as separate HTTP requests and there is no guarantee they will arrive in the same order.
To redirect or terminate a live call, you make an HTTP POST request to an in¬-progress Call instance resource URI:
Copy link
Section URI