Update an assistant
POST/ai/assistants/:assistant_id
Update an AI Assistant's attributes.
Request
Path Parameters
- application/json
Body
required
distil-whisper/distil-large-v2
is lower latency but English-only.openai/whisper-large-v3-turbo
is multi-lingual with automatic language detection but slightly higher latency.
ID of the model to use. You can use the Get models API to see all of your available models,
System instructions for the assistant. These may be templated with dynamic variables
tools
object[]
Text that the assistant will use to start the conversation. This may be templated with dynamic variables
This is only needed when using third-party inference providers. The identifier
for an integration secret /v2/integration_secrets that refers to your LLM provider's API key. Warning: Free plans are unlikely to work with this integration.
voice_settings
object
The voice to be used by the voice assistant. Check the full list of available voices via our voices API.
To use ElevenLabs, you must reference your ElevenLabs API key as an integration secret under the api_key_ref
field. See integration secrets documentation for details. For Telnyx voices, use Telnyx.<model_id>.<voice_id>
(e.g. Telnyx.KokoroTTS.af_heart)
The identifier
for an integration secret /v2/integration_secrets that refers to your ElevenLabs API key. Warning: Free plans are unlikely to work with this integration.
transcription
object
The speech to text model to be used by the voice assistant.
telephony_settings
object
Default Texml App used for voice calls with your assistant. This will be created automatically on assistant creation.
messaging_settings
object
Default Messaging Profile used for messaging exchanges with your assistant. This will be created automatically on assistant creation.
The URL where webhooks related to delivery statused for assistant messages will be sent.
Possible values: [telephony
, messaging
]
insight_settings
object
Reference to an Insight Group. Insights in this group will be run automatically for all the assistant's conversations.
If the dynamic_variables_webhook_url is set for the assistant, we will send a request at the start of the conversation. See our guide for more information.
Map of dynamic variables and their default values
Responses
200: Successful Response
- application/json
422: Validation Error
- application/json
Request samples
curl -L 'https://api.telnyx.com/v2/ai/assistants/:assistant_id' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"name": "string",
"model": "string",
"instructions": "string",
"tools": [
{
"type": "book_appointment",
"book_appointment": {
"event_type_id": 0,
"api_key_ref": "my_calcom_api_key",
"attendee_name": "string",
"attendee_timezone": "string"
}
},
{
"type": "check_availability",
"check_availability": {
"event_type_id": 0,
"api_key_ref": "my_calcom_api_key"
}
},
{
"type": "webhook",
"webhook": {
"name": "string",
"description": "string",
"url": "https://example.com/api/v1/function",
"method": "POST",
"headers": [
{
"name": "string",
"value": "string"
}
],
"body_parameters": {
"properties": {
"age": {
"description": "The age of the customer.",
"type": "integer"
},
"location": {
"description": "The location of the customer.",
"type": "string"
}
},
"required": [
"age",
"location"
],
"type": "object"
},
"path_parameters": {
"properties": {
"id": {
"description": "The id of the customer.",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"query_parameters": {
"properties": {
"page": {
"description": "The page number.",
"type": "integer"
}
},
"required": [
"page"
],
"type": "object"
}
}
},
{
"type": "hangup",
"hangup": {
"description": "This tool is used to hang up the call."
}
},
{
"type": "transfer",
"transfer": {
"targets": [
{
"name": "Support",
"to": "+13129457420"
}
],
"from": "+35319605860"
}
},
{
"type": "retrieval",
"retrieval": {
"bucket_ids": [
"string"
],
"max_num_results": 0
}
}
],
"description": "string",
"greeting": "string",
"llm_api_key_ref": "string",
"voice_settings": {
"voice": "string",
"api_key_ref": "string"
},
"transcription": {
"model": "string"
},
"telephony_settings": {
"default_texml_app_id": "string"
},
"messaging_settings": {
"default_messaging_profile_id": "string",
"delivery_status_webhook_url": "string"
},
"enabled_features": [
"telephony"
],
"insight_settings": {
"insight_group_id": "string"
},
"dynamic_variables_webhook_url": "string",
"dynamic_variables": {}
}'
Response samples
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}