Initiate an outbound call
POST/texml/calls/:application_id
Initiate an outbound TeXML call. Telnyx will request TeXML from the XML Request URL configured for the connection in the Mission Control Portal.
Request
Path Parameters
The ID of the TeXML application used for the call.
- application/json
Body
required
Iniatiate Call request object
The phone number of the called party. Phone numbers are formatted with a +
and country code.
The phone number of the party that initiated the call. Phone numbers are formatted with a +
and country code.
The URL from which Telnyx will retrieve the TeXML call instructions.
Possible values: [GET
, POST
]
Default value: POST
HTTP request type used for Url
. The default value is inherited from TeXML Application setting.
A failover URL for which Telnyx will retrieve the TeXML call instructions if the Url
is not responding.
URL destination for Telnyx to send status callback events to for the call.
Possible values: [GET
, POST
]
Default value: POST
HTTP request type used for StatusCallback
.
Possible values: [initiated
, ringing
, answered
, completed
]
Default value: completed
The call events for which Telnyx should send a webhook. Multiple events can be defined when separated by a space.
Possible values: [Enable
, Disable
, DetectMessageEnd
]
Default value: Disable
Enables Answering Machine Detection.
Possible values: [Premium
, Regular
]
Default value: Regular
Allows you to chose between Premium and Standard detections.
Select whether to perform answering machine detection in the background. By default execution is blocked until Answering Machine Detection is completed.
URL destination for Telnyx to send AMD callback events to for the call.
Possible values: [GET
, POST
]
Default value: POST
HTTP request type used for AsyncAmdStatusCallback
. The default value is inherited from TeXML Application setting.
Possible values: >= 500
and <= 60000
Default value: 30000
Maximum timeout threshold in milliseconds for overall detection.
Default value: 3500
Maximum threshold of a human greeting. If greeting longer than this value, considered machine. Ignored when premium
detection is used.
Default value: 800
Silence duration threshold after a greeting message or voice for it be considered human. Ignored when premium
detection is used.
Default value: 3500
If initial silence duration is greater than this value, consider it a machine. Ignored when premium
detection is used.
Default value: true
Whether to cancel ongoing playback on machine
detection. Defaults to true
.
Default value: true
Whether to cancel ongoing playback on greeting ended
detection. Defaults to true
.
The list of comma-separated codecs to be offered on a call.
Whether to record the entire participant's call leg. Defaults to false
.
Possible values: [mono
, dual
]
The number of channels in the final recording. Defaults to mono
.
The URL the recording callbacks will be sent to.
Possible values: [GET
, POST
]
HTTP request type used for RecordingStatusCallback
. Defaults to POST
.
The changes to the recording's state that should generate a call to RecoridngStatusCallback
. Can be: in-progress
, completed
and absent
. Separate multiple values with a space. Defaults to completed
.
Default value: 0
The number of seconds that Telnyx will wait for the recording to be stopped if silence is detected. The timer only starts when the speech is detected. Please note that the transcription is used to detect silence and the related charge will be applied. The minimum value is 0. The default value is 0 (infinite)
Possible values: [inbound
, outbound
, both
]
The audio track to record for the call. The default is both
.
The password to use for SIP authentication.
The username to use for SIP authentication.
Possible values: [trim-silence
, do-not-trim
]
Whether to trim any leading and trailing silence from the recording. Defaults to trim-silence
.
Responses
200: Successful response upon initiating a TeXML call.
- application/json
Request samples
curl -L 'https://api.telnyx.com/v2/texml/calls/:application_id' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"To": "+13121230000",
"From": "+13120001234",
"Url": "https://www.example.com/texml.xml",
"StatusCallback": "https://www.example.com/statuscallback-listener"
}'
Response samples
{
"data": {
"from": "+13120001234",
"to": "+13121230000",
"status": "queued"
}
}