Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

call_control_id
string
required

Unique identifier and token for controlling the call

Body

application/json

AI Assistant add messages request

client_state
string

Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.

Example:

"aGF2ZSBhIG5pY2UgZGF5ID1d"

command_id
string

Use this field to avoid duplicate commands. Telnyx will ignore any command with the same command_id for the same call_control_id.

Example:

"891510ac-f3e4-11e8-af5b-de00688a4901"

messages
(User message. · object | Assistant Message · object | Tool Message · object | System Message · object | Developer Message · object)[]

The messages to add to the conversation.

Messages sent by an end user

Example:
trigger_response
boolean
default:false

When true, the injected messages immediately trigger an assistant response/turn instead of waiting for the next natural turn or idle timeout. This may interrupt a user who is still speaking. How the turn starts depends on the last message in messages: if it is a user message, the assistant responds to that message as if the caller had said it, whether or not trigger_response is set. Any other last role (system, developer, assistant, tool) starts a turn with no new user input, as after a long silence. When trigger_response is not set, a payload that does not end in a user message is context only and does not start a turn. GPT Live models (openai/gpt-live-*) do not support a forced mid-session turn: injected system, developer, and assistant content is appended to the Live session's instructions and the model brings it into its next turn on its own; an injected tool record is not forwarded to the Live session, so it stays context only and never reaches the Live model. Any of user, system, developer, or assistant is the supported way to get content into the Live session.

Response

Successful response upon making a call control command.

data
Call Control Command Result · object
Example: