v52

OpenAPI 3.1.0raw.githubusercontent.com2026-07-311,1941,9384.1 MB
TeXML REST Commands

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.

post/texml/ai_calls/{connection_id}

Path parameters

connection_idstring required

The ID of the TeXML connection to use for the call.

Request body

AIAssistantDynamicVariablesobject

Key-value map of dynamic variables to pass to the AI assistant.

AIAssistantIdstring required

The ID of the AI assistant to use for the call.

AIAssistantVersionstring

The version of the AI assistant to use.

AsyncAmdboolean

Select whether to perform answering machine detection in the background. By default execution is blocked until Answering Machine Detection is completed.

AsyncAmdStatusCallbackstring

URL destination for Telnyx to send AMD callback events to for the call.

AsyncAmdStatusCallbackMethod'GET' | 'POST'

HTTP request type used for AsyncAmdStatusCallback.

CallerIdstring

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.

ConversationCallbackstring

URL destination for Telnyx to send AI conversation callback events for this call. Events include conversation_created and conversation_ended.

ConversationCallbackMethod'GET' | 'POST'

HTTP request type used for ConversationCallback and ConversationCallbacks.

ConversationCallbacksstring[]

Array of URL destinations for AI conversation callback events for this call. Events include conversation_created and conversation_ended.

DetectionMode'Premium' | 'Regular' | 'PremiumCallScreening'

Allows you to choose between Regular, Premium, and PremiumCallScreening detections. See https://developers.telnyx.com/docs/voice/programmable-voice/answering-machine-detection

Fromstring required

The phone number of the party initiating the call. Phone numbers are formatted with a + and country code.

MachineDetection'Enable' | 'Disable' | 'DetectMessageEnd'

Enables Answering Machine Detection.

MachineDetectionPromptEndTimeoutinteger

Silence duration threshold after a call screening prompt before ending prompt detection, in milliseconds. Used when DetectionMode is PremiumCallScreening.

MachineDetectionSilenceTimeoutinteger

If initial silence duration is greater than this value, consider it a machine. Ignored when premium detection is used.

MachineDetectionSpeechEndThresholdinteger

Silence duration threshold after a greeting message or voice for it be considered human. Ignored when premium detection is used.

MachineDetectionSpeechThresholdinteger

Maximum threshold of a human greeting. If greeting longer than this value, considered machine. Ignored when premium detection is used.

MachineDetectionTimeoutinteger

Maximum timeout threshold in milliseconds for overall detection.

Passportsstring

A string of passport identifiers to associate with the call.

PreferredCodecsstring

The list of comma-separated codecs to be offered on a call.

Recordboolean

Whether to record the entire participant's call leg. Defaults to false.

RecordingChannels'mono' | 'dual'

The number of channels in the final recording. Defaults to mono.

RecordingStatusCallbackstring

The URL the recording callbacks will be sent to.

RecordingStatusCallbackEventstring

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.

RecordingStatusCallbackMethod'GET' | 'POST'

HTTP request type used for RecordingStatusCallback. Defaults to POST.

RecordingTimeoutinteger

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).

RecordingTrack'inbound' | 'outbound' | 'both'

The audio track to record for the call. The default is both.

SendRecordingUrlboolean

Whether to send RecordingUrl in webhooks.

SipAuthPasswordstring

The password to use for SIP authentication.

SipAuthUsernamestring

The username to use for SIP authentication.

SipRegion'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East'

Defines the SIP region to be used for the call.

StatusCallbackstring

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.

StatusCallbackEventstring

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.

StatusCallbackMethod'GET' | 'POST'

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.

StatusCallbacksstring[]

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.

TimeLimitinteger

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.

Timeoutinteger

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.

Tostring required

The phone number of the called party. Phone numbers are formatted with a + and country code.

Trim'trim-silence' | 'do-not-trim'

Whether to trim any leading and trailing silence from the recording. Defaults to trim-silence.

Example request

{
  "AIAssistantId": "ai-assistant-id-123",
  "From": "+13120001234",
  "To": "+13121230000"
}

Response

Successful response upon initiating an AI call.

call_sidstring
fromstring
statusstring
tostring

Example response

{
  "call_sid": "v3:example-call-sid",
  "from": "+13120001234",
  "status": "queued",
  "to": "+13121230000"
}