{ "opencollection": "1.0.0", "info": { "name": "Telnyx Access Tokens Call Commands API", "version": "2.0.0" }, "request": { "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "items": [ { "info": { "name": "Call Commands", "type": "folder" }, "items": [ { "info": { "name": "Dial", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls", "body": { "type": "json", "data": "{}" } }, "docs": "Dial a number or SIP URI from a given connection. A successful response will include a `call_leg_id` which can be used to correlate the command with subsequent webhooks.\n\n**Expected Webhooks:**\n\n- `call.initiated`\n- `call.answered` or `call.hangup`\n- `call.hold` and `call.unhold` if the call is held/unheld\n- `call.machine.detection.ended` if `answering_machine_detection` was requested\n- `call.machine.greeting.ended` if `answering_machine_detection` was requested to detect the end of machine gree" }, { "info": { "name": "Add messages to AI Assistant", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/ai_assistant_add_messages", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Add messages to the conversation started by an AI assistant on the call." }, { "info": { "name": "Join AI Assistant Conversation", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/ai_assistant_join", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Add a participant to an existing AI assistant conversation. Use this command to bring an additional call leg into a running AI conversation." }, { "info": { "name": "Start AI Assistant", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/ai_assistant_start", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Start an AI assistant on the call.\n\n**Expected Webhooks:**\n\n- `call.conversation.ended`\n- `call.conversation_insights.generated`\n" }, { "info": { "name": "Stop AI Assistant", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/ai_assistant_stop", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Stop an AI assistant on the call." }, { "info": { "name": "Answer call", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/answer", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Answer an incoming call. You must issue this command before executing subsequent commands on an incoming call.\n\n**Expected Webhooks:**\n\n- `call.answered`\n- `call.hold` and `call.unhold` if the call is held/unheld\n- `call.deepfake_detection.result` if `deepfake_detection` was enabled\n- `call.deepfake_detection.error` if `deepfake_detection` was enabled and an error occurred\n- `streaming.started`, `streaming.stopped` or `streaming.failed` if `stream_url` was set\n\nWhen the `record` parameter is set" }, { "info": { "name": "Bridge calls", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/bridge", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Bridge two call control calls.\n\n**Expected Webhooks:**\n\n- `call.bridged` for Leg A\n- `call.bridged` for Leg B\n" }, { "info": { "name": "Update client state", "type": "http" }, "http": { "method": "PUT", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/client_state_update", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Updates client state" }, { "info": { "name": "Enqueue call", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/enqueue", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Put the call in a queue." }, { "info": { "name": "Forking start", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/fork_start", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Call forking allows you to stream the media from a call to a specific target in realtime. \nThis stream can be used to enable realtime audio analysis to support a \nvariety of use cases, including fraud detection, or the creation of AI-generated audio responses. \nRequests must specify either the `target` attribute or the `rx` and `tx` attributes.\n\n**Expected Webhooks:**\n\n- `call.fork.started`\n- `call.fork.stopped`\n\n" }, { "info": { "name": "Forking stop", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/fork_stop", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Stop forking a call.\n\n**Expected Webhooks:**\n\n- `call.fork.stopped`\n" }, { "info": { "name": "Gather", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/gather", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Gather DTMF signals to build interactive menus.\n\nYou can pass a list of valid digits. The `Answer` command must be issued before the `gather` command.\n\n**Expected Webhooks:**\n\n- `call.dtmf.received` (you may receive many of these webhooks)\n- `call.gather.ended`\n" }, { "info": { "name": "Gather stop", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/gather_stop", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Stop current gather.\n\n**Expected Webhooks:**\n\n- `call.gather.ended`\n" }, { "info": { "name": "Gather using AI", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/gather_using_ai", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Gather parameters defined in the request payload using a voice assistant.\n\n You can pass parameters described as a JSON Schema object and the voice assistant will attempt to gather these informations. \n\n**Expected Webhooks:**\n\n- `call.ai_gather.ended`\n- `call.conversation.ended`\n- `call.ai_gather.partial_results` (if `send_partial_results` is set to `true`)\n- `call.ai_gather.message_history_updated` (if `send_message_history_updates` is set to `true`)\n" }, { "info": { "name": "Gather using audio", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/gather_using_audio", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Play an audio file on the call until the required DTMF signals are gathered to build interactive menus.\n\nYou can pass a list of valid digits along with an 'invalid_audio_url', which will be played back at the beginning of each prompt. Playback will be interrupted when a DTMF signal is received. The `Answer command must be issued before the `gather_using_audio` command.\n\n**Expected Webhooks:**\n\n- `call.playback.started`\n- `call.playback.ended`\n- `call.dtmf.received` (you may receive many of these" }, { "info": { "name": "Gather using speak", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/gather_using_speak", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Convert text to speech and play it on the call until the required DTMF signals are gathered to build interactive menus.\n\nYou can pass a list of valid digits along with an 'invalid_payload', which will be played back at the beginning of each prompt. Speech will be interrupted when a DTMF signal is received. The `Answer` command must be issued before the `gather_using_speak` command.\n\n**Expected Webhooks:**\n\n- `call.dtmf.received` (you may receive many of these webhooks)\n- `call.gather.ended`\n" }, { "info": { "name": "Hangup call", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/hangup", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Hang up the call.\n\n**Expected Webhooks:**\n\n- `call.hangup`\n- `call.recording.saved`\n" }, { "info": { "name": "Remove call from a queue", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/leave_queue", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Removes the call from a queue." }, { "info": { "name": "Play audio URL", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/playback_start", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Play an audio file on the call. If multiple play audio commands are issued consecutively,\nthe audio files will be placed in a queue awaiting playback.\n\n*Notes:*\n\n- When `overlay` is enabled, `target_legs` is limited to `self`.\n- A customer cannot Play Audio with `overlay=true` unless there is a Play Audio with `overlay=false` actively playing.\n\n**Expected Webhooks:**\n\n- `call.playback.started`\n- `call.playback.ended`\n" }, { "info": { "name": "Stop audio playback", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/playback_stop", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Stop audio being played on the call.\n\n**Expected Webhooks:**\n\n- `call.playback.ended` or `call.speak.ended`\n" }, { "info": { "name": "Record pause", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/record_pause", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Pause recording the call. Recording can be resumed via Resume recording command.\n\n**Expected Webhooks:**\n\nThere are no webhooks associated with this command.\n" }, { "info": { "name": "Record resume", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/record_resume", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Resume recording the call.\n\n**Expected Webhooks:**\n\nThere are no webhooks associated with this command.\n" }, { "info": { "name": "Recording start", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/record_start", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Start recording the call. Recording will stop on call hang-up, or can be initiated via the Stop Recording command.\n\n**Expected Webhooks:**\n\n- `call.recording.saved`\n- `call.recording.transcription.saved`\n- `call.recording.error`\n" }, { "info": { "name": "Recording stop", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/record_stop", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Stop recording the call.\n\n**Expected Webhooks:**\n\n- `call.recording.saved`\n" }, { "info": { "name": "SIP Refer a call", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/refer", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Initiate a SIP Refer on a Call Control call. You can initiate a SIP Refer at any point in the duration of a call.\n\n**Expected Webhooks:**\n\n- `call.refer.started`\n- `call.refer.completed`\n- `call.refer.failed`\n" }, { "info": { "name": "Reject a call", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/reject", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Reject an incoming call.\n\n**Expected Webhooks:**\n\n- `call.hangup`\n" }, { "info": { "name": "Send DTMF", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/send_dtmf", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Sends DTMF tones from this leg. DTMF tones will be heard by the other end of the call.\n\n**Expected Webhooks:**\n\nThere are no webhooks associated with this command.\n" }, { "info": { "name": "Send SIP info", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/send_sip_info", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Sends SIP info from this leg.\n\n**Expected Webhooks:**\n\n- `call.sip_info.received` (to be received on the target call leg)\n" }, { "info": { "name": "SIPREC start", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/siprec_start", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Start siprec session to configured in SIPREC connector SRS. \n\n**Expected Webhooks:**\n\n- `siprec.started`\n- `siprec.stopped`\n- `siprec.failed`\n" }, { "info": { "name": "SIPREC stop", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/siprec_stop", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Stop SIPREC session.\n\n**Expected Webhooks:**\n\n- `siprec.stopped`\n" }, { "info": { "name": "Speak text", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/speak", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Convert text to speech and play it back on the call. If multiple speak text commands are issued consecutively, the audio files will be placed in a queue awaiting playback.\n\n**Expected Webhooks:**\n\n- `call.speak.started`\n- `call.speak.ended`\n" }, { "info": { "name": "Streaming start", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/streaming_start", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Start streaming the media from a call to a specific WebSocket address or Dialogflow connection in near-realtime. Audio will be delivered as base64-encoded RTP payload (raw audio), wrapped in JSON payloads.\n\nPlease find more details about media streaming messages specification under the [link](https://developers.telnyx.com/docs/voice/programmable-voice/media-streaming)." }, { "info": { "name": "Streaming stop", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/streaming_stop", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Stop streaming a call to a WebSocket.\n\n**Expected Webhooks:**\n\n- `streaming.stopped`\n" }, { "info": { "name": "Noise Suppression Start (BETA)", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/suppression_start", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Noise Suppression Start (BETA)" }, { "info": { "name": "Noise Suppression Stop (BETA)", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/suppression_stop", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Noise Suppression Stop (BETA)" }, { "info": { "name": "Switch supervisor role", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/switch_supervisor_role", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Switch the supervisor role for a bridged call. This allows switching between different supervisor modes during an active call" }, { "info": { "name": "Transcription start", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/transcription_start", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Start real-time transcription. Transcription will stop on call hang-up, or can be initiated via the Transcription stop command.\n\n**Expected Webhooks:**\n\n- `call.transcription`\n" }, { "info": { "name": "Transcription stop", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/transcription_stop", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Stop real-time transcription." }, { "info": { "name": "Transfer call", "type": "http" }, "http": { "method": "POST", "url": "https://api.telnyx.com/v2/calls/:call_control_id/actions/transfer", "params": [ { "name": "call_control_id", "value": "", "type": "path", "description": "Unique identifier and token for controlling the call" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Transfer a call to a new destination. If the transfer is unsuccessful, a `call.hangup` webhook for the other call (Leg B) will be sent indicating that the transfer could not be completed. The original call will remain active and may be issued additional commands, potentially transfering the call to an alternate destination.\n\n**Expected Webhooks:**\n\n- `call.initiated`\n- `call.bridged` to Leg B\n- `call.answered` or `call.hangup`\n- `call.machine.detection.ended` if `answering_machine_detection` was" } ] } ], "bundled": true }