---
title: "Add messages to AI Assistant"
method: POST
path: "/calls/{call_control_id}/actions/ai_assistant_add_messages"
tags: ["Call Commands"]
---

# Add messages to AI Assistant

`POST /calls/{call_control_id}/actions/ai_assistant_add_messages`

## Request

- Base URL: `https://api.telnyx.com/v2`
- URL: `https://api.telnyx.com/v2/calls/{call_control_id}/actions/ai_assistant_add_messages`
- Auth: HTTP bearer

Add messages to the conversation started by an AI assistant on the call.

## Path parameters

- `call_control_id` string, required

## Request body

- AIAssistantAddMessagesRequest
  - `client_state` string: Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
  - `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`.
  - `messages` union[]: The messages to add to the conversation.
    - union
      - UserMessage: Messages sent by an end user
        - `role` 'user', required: The role of the messages author, in this case `user`.
        - `content` string, required: The contents of the user message.
        - `metadata` MessageMetadata: Metadata to add to the message
      - AssistantMessage: Messages sent by the model in response to user messages.
        - `role` 'assistant', required: The role of the messages author, in this case `assistant`.
        - `content` string: The contents of the assistant message. Required unless `tool_calls`
        - `tool_calls` ToolCall[]: The tool calls generated by the model, such as function calls.
          - `id` string, required: The ID of the tool call.
          - `type` 'function', required: The type of the tool. Currently, only `function` is supported.
          - `function` object, required: The function that the model called.
            - `name` string, required: The name of the function to call.
        - `metadata` MessageMetadata: Metadata to add to the message
      - ToolMessage
        - `role` 'tool', required: The role of the messages author, in this case `tool`.
        - `content` string, required: The contents of the tool message.
        - `tool_call_id` string, required: Tool call that this message is responding to.
        - `metadata` MessageMetadata: Metadata to add to the message
      - SystemMessage: Developer-provided instructions that the model should follow, regardless of messages sent by the user.
        - `role` 'system', required: The role of the messages author, in this case `system`.
        - `content` string, required: The contents of the system message.
        - `metadata` MessageMetadata: Metadata to add to the message
      - DeveloperMessage: Developer-provided instructions that the model should follow, regardless of messages sent by the user.
        - `role` 'developer', required: The role of the messages author, in this case developer.
        - `content` string, required: The contents of the developer message.
        - `metadata` MessageMetadata: Metadata to add to the message
  - `trigger_response` boolean: 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.

## Response `200`

Successful response upon making a call control command.

- object
  - `data` CallControlCommandResult
    - `result` string

## Other responses

- `422`: Unprocessable entity. The request was well-formed but could not be processed due to semantic errors. This includes validation errors, invalid parameter values, call state errors, conference errors, queue errors, recording/transcription errors, and business logic violations.
- `default`: Unexpected error

## Changes

- **2026-10-15** `a72569d69430`: 1 info
  - added the new optional request property `trigger_response`

[Operation history](https://skmtc.dev/team-telnyx/apis/telnyx-api/changes/calls/:call_control_id/actions/ai_assistant_add_messages/post.md)

---

[API](https://skmtc.dev/team-telnyx/apis/telnyx-api.md) - [All operations](https://skmtc.dev/team-telnyx/apis/telnyx-api/llms.txt) - [OpenAPI document](https://skmtc.dev/team-telnyx/apis/telnyx-api/revisions/a73101b68823?raw)
