Initiate an outbound AI call
Initiate an outbound AI call with warm-up support. Validates parameters, builds an internal TeXML with an AI Assistant configuration, encodes instructions into client state, and calls the dial API. The Twiml, Texml, and Url parameters are not allowed and will result in a 422 error.
Expected callback events:
Status callbacks: initiated, ringing, answered, one terminal status (completed, no-answer, busy, canceled, or failed), then analyzed after post-call processing completes.
Conversation callbacks: conversation_created and conversation_ended.
Recording, AMD, transcription, and deepfake detection callbacks are only sent when those features are enabled.
Documentation Index
Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the TeXML connection to use for the call.
Body
Initiate AI Call request object
The phone number of the party initiating the call. Phone numbers are formatted with a + and country code.
"+16175551212"
The phone number of the called party. Phone numbers are formatted with a + and country code.
"+16175551212"
The ID of the AI assistant to use for the call.
The version of the AI assistant to use.
Key-value map of dynamic variables to pass to the AI assistant.
{
"customer_name": "John Doe",
"account_id": "12345"
}To be used as the caller id name (SIP From Display Name) presented to the destination (To number). The string should have a maximum of 128 characters, containing only letters, numbers, spaces, and -_~!.+ special characters. If omitted, the display name will be the same as the number in the From field.
"Info"
URL destination for Telnyx to send status callback events for this AI call. When provided, this per-call value overrides the status callback URL configured on the TeXML application/connection.
"https://www.example.com/callback"
The status callback events for which Telnyx should send a webhook for this AI call. Multiple events can be defined when separated by a space. Valid values: initiated, ringing, answered, completed, no-answer, busy, canceled, failed, analyzed. When provided, this per-call value overrides the status callback events configured on the TeXML application/connection.
"initiated answered"
HTTP request type used for StatusCallback and StatusCallbacks for this AI call. When provided, this per-call value overrides the status callback method configured on the TeXML application/connection.
GET, POST "GET"
Array of URL destinations for Telnyx to send status callback events for this AI call. When provided, these per-call values override the status callback URL configured on the TeXML application/connection.
[
"https://www.example.com/callback1",
"https://www.example.com/callback2"
]Custom HTTP headers to be sent with the call. Each header should be an object with 'name' and 'value' properties.
[
{
"name": "X-Custom-Header",
"value": "custom-value"
}
]URL destination for Telnyx to send AI conversation callback events for this call. Events include conversation_created and conversation_ended.
"https://www.example.com/conversation-callback"
HTTP request type used for ConversationCallback and ConversationCallbacks.
GET, POST "GET"
Array of URL destinations for AI conversation callback events for this call. Events include conversation_created and conversation_ended.
[
"https://www.example.com/conversation-callback1",
"https://www.example.com/conversation-callback2"
]Enables Answering Machine Detection.
Enable, Disable, DetectMessageEnd "Enable"
Allows you to choose between Regular, Premium, and PremiumCallScreening detections. See https://developers.telnyx.com/docs/voice/programmable-voice/answering-machine-detection
Premium, Regular, PremiumCallScreening "Premium"
Select whether to perform answering machine detection in the background. By default execution is blocked until Answering Machine Detection is completed.
true
URL destination for Telnyx to send AMD callback events to for the call.
"https://www.example.com/callback"
HTTP request type used for AsyncAmdStatusCallback.
GET, POST "GET"
Maximum timeout threshold in milliseconds for overall detection.
500 <= x <= 600005000
Silence duration threshold after a call screening prompt before ending prompt detection, in milliseconds. Used when DetectionMode is PremiumCallScreening.
1000 <= x <= 1200005000
Maximum threshold of a human greeting. If greeting longer than this value, considered machine. Ignored when premium detection is used.
2000
Silence duration threshold after a greeting message or voice for it be considered human. Ignored when premium detection is used.
2000
If initial silence duration is greater than this value, consider it a machine. Ignored when premium detection is used.
2000
A string of passport identifiers to associate with the call.
The maximum duration of the call in seconds. The minimum value is 30 and the maximum value is 14400 (4 hours). Default is 14400 seconds.
30 <= x <= 144003600
The number of seconds to wait for the called party to answer the call before the call is canceled. The minimum value is 5 and the maximum value is 120. Default is 30 seconds.
5 <= x <= 12060
Whether to record the entire participant's call leg. Defaults to false.
false
The number of channels in the final recording. Defaults to mono.
mono, dual "dual"
The URL the recording callbacks will be sent to.
"https://example.com/recording_status_callback"
HTTP request type used for RecordingStatusCallback. Defaults to POST.
GET, POST "GET"
The changes to the recording's state that should generate a call to RecordingStatusCallback. Can be: in-progress, completed and absent. Separate multiple values with a space. Defaults to completed.
"in-progress completed absent"
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. The minimum value is 0. The default value is 0 (infinite).
5
The audio track to record for the call. The default is both.
inbound, outbound, both "inbound"
Whether to trim any leading and trailing silence from the recording. Defaults to trim-silence.
trim-silence, do-not-trim "trim-silence"
Whether to send RecordingUrl in webhooks.
false
The list of comma-separated codecs to be offered on a call.
"PCMA,PCMU"
The username to use for SIP authentication.
"user"
The password to use for SIP authentication.
"1234"
Defines the SIP region to be used for the call.
US, Europe, Canada, Australia, Middle East "Canada"