Skip to main content
POST
/
calls
/
{call_control_id}
/
actions
/
ai_assistant_join
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const response = await client.calls.actions.joinAIAssistant('call_control_id', {
  conversation_id: 'v3:abc123',
  participant: { id: 'v3:abc123def456', role: 'user' },
});

console.log(response.data);
{
  "data": {
    "result": "ok",
    "conversation_id": "d7e9c1d4-8b2a-4b8f-b3a7-9a671c9e9b0a"
  }
}

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 Join request

conversation_id
string
required

The ID of the AI assistant conversation to join.

Example:

"v3:abc123"

participant
object
required
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"

Response

Successful response upon making a call control command that includes conversation_id.

data
Call Control Command Result With Conversation ID · object
Example:
{
"result": "ok",
"conversation_id": "d7e9c1d4-8b2a-4b8f-b3a7-9a671c9e9b0a"
}