Import assistants from external provider
Import assistants from external providers. Any assistant that has already been imported will be overwritten with its latest version from the importing provider.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const assistantsList = await client.ai.assistants.imports({
api_key_ref: 'api_key_ref',
provider: 'elevenlabs',
});
console.log(assistantsList.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
assistants_list = client.ai.assistants.imports(
api_key_ref="api_key_ref",
provider="elevenlabs",
)
print(assistants_list.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
assistantsList, err := client.AI.Assistants.Imports(context.TODO(), telnyx.AIAssistantImportsParams{
APIKeyRef: "api_key_ref",
Provider: telnyx.AIAssistantImportsParamsProviderElevenlabs,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistantsList.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.assistants.AssistantImportsParams;
import com.telnyx.sdk.models.ai.assistants.AssistantsList;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AssistantImportsParams params = AssistantImportsParams.builder()
.apiKeyRef("api_key_ref")
.provider(AssistantImportsParams.Provider.ELEVENLABS)
.build();
AssistantsList assistantsList = client.ai().assistants().imports(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
assistants_list = telnyx.ai.assistants.imports(api_key_ref: "api_key_ref", provider: :elevenlabs)
puts(assistants_list)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$assistantsList = $client->ai->assistants->imports(
apiKeyRef: 'api_key_ref', provider: 'elevenlabs', importIDs: ['string']
);
var_dump($assistantsList);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants imports \
--api-key 'My API Key' \
--api-key-ref api_key_ref \
--provider elevenlabscurl --request POST \
--url https://api.telnyx.com/v2/ai/assistants/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "elevenlabs",
"api_key_ref": "string",
"import_ids": [
"string"
]
}
'{
"data": [
{
"id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"model": "<string>",
"instructions": "<string>",
"version_id": "<string>",
"version_created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"tools": [
{
"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"
},
"preset_body_fields": {
"account_id": "{{customer_id}}",
"source": "telnyx-assistant"
},
"preset_query_params": {
"caller": "{{telnyx_end_user_target}}",
"channel": "voice"
},
"async": false,
"async_timeout_ms": 7500,
"timeout_ms": 5250,
"store_fields_as_variables": [
{
"name": "<string>",
"value_path": "<string>"
}
],
"messages": [
{
"type": "request_start",
"content": "Let me look that up for you."
},
{
"type": "request_response_delayed",
"content": "Still working on that.",
"timing_ms": 5000
}
]
}
}
],
"mcp_servers": [],
"greeting": "<string>",
"llm_api_key_ref": "<string>",
"external_llm": {
"model": "<string>",
"base_url": "<string>",
"llm_api_key_ref": "<string>",
"authentication_method": "token",
"certificate_ref": "<string>",
"token_retrieval_url": "<string>",
"forward_metadata": false
},
"fallback_config": {
"model": "<string>",
"llm_api_key_ref": "<string>",
"external_llm": {
"model": "<string>",
"base_url": "<string>",
"llm_api_key_ref": "<string>",
"authentication_method": "token",
"certificate_ref": "<string>",
"token_retrieval_url": "<string>",
"forward_metadata": false
}
},
"voice_settings": {
"voice": "<string>",
"voice_speed": 1,
"api_key_ref": "<string>",
"temperature": 0.5,
"similarity_boost": 0.75,
"use_speaker_boost": true,
"style": 0,
"speed": 1,
"language_boost": null,
"expressive_mode": false,
"background_audio": {
"type": "predefined_media",
"value": "silence",
"volume": 1
}
},
"transcription": {
"model": "deepgram/flux",
"language": "<string>",
"api_key_ref": "<string>",
"region": "<string>",
"settings": {
"smart_format": true,
"numerals": true,
"eot_threshold": 0.8,
"eot_timeout_ms": 5000,
"eager_eot_threshold": 0.8,
"keyterm": "<string>",
"end_of_turn_confidence_threshold": 0.4,
"min_turn_silence": 400,
"max_turn_silence": 1280,
"interim_results": false,
"enable_endpoint_detection": false,
"max_endpoint_delay_ms": 1750,
"context": "<string>",
"language_hints": [
"<string>"
]
}
},
"telephony_settings": {
"default_texml_app_id": "<string>",
"supports_unauthenticated_web_calls": true,
"noise_suppression": "krisp",
"noise_suppression_config": {
"attenuation_limit": 100,
"mode": "advanced"
},
"time_limit_secs": 1800,
"user_idle_timeout_secs": 7205,
"user_idle_reply_secs": 10,
"send_message_history_updates": true,
"voicemail_detection": {
"on_voicemail_detected": {
"action": "stop_assistant",
"voicemail_message": {
"type": "prompt",
"prompt": "<string>",
"message": "<string>"
}
}
},
"disable_dtmf": false,
"recording_settings": {
"enabled": true,
"channels": "dual",
"format": "mp3",
"stop_on_conversation_end": false
}
},
"messaging_settings": {
"default_messaging_profile_id": "<string>",
"delivery_status_webhook_url": "<string>",
"conversation_inactivity_minutes": 5000000
},
"enabled_features": [
"telephony"
],
"insight_settings": {
"insight_group_id": "<string>"
},
"privacy_settings": {
"data_retention": true
},
"dynamic_variables_webhook_url": "<string>",
"dynamic_variables_webhook_timeout_ms": 1500,
"dynamic_variables": {},
"import_metadata": {
"import_provider": "elevenlabs",
"import_id": "<string>"
},
"widget_settings": {
"theme": "light",
"audio_visualizer_config": {
"color": "verdant",
"preset": "<string>"
},
"start_call_text": "<string>",
"default_state": "expanded",
"position": "fixed",
"view_history_url": "<string>",
"report_issue_url": "<string>",
"give_feedback_url": "<string>",
"agent_thinking_text": "<string>",
"speak_to_interrupt_text": "<string>",
"logo_icon_url": "<string>"
},
"interruption_settings": {
"enable": true,
"disable_greeting_interruption": true,
"start_speaking_plan": {
"wait_seconds": 0.4,
"transcription_endpointing_plan": {
"on_punctuation_seconds": 0.1,
"on_no_punctuation_seconds": 1.5,
"on_number_seconds": 0.5
}
}
},
"integrations": [],
"observability_settings": {
"status": "disabled",
"secret_key_ref": "<string>",
"public_key_ref": "<string>",
"host": "<string>",
"prompt_name": "<string>",
"prompt_version": 2,
"prompt_label": "<string>",
"prompt_sync": "disabled"
},
"version_name": "New assistant",
"related_mission_ids": [],
"tags": [],
"post_conversation_settings": {
"enabled": false
},
"conversation_flow": {
"edges": [
{
"condition": {
"prompt": "The caller is asking about a bill or charge.",
"type": "llm"
},
"id": "e_intake_to_billing",
"start_node_id": "n_intake",
"target": {
"node_id": "n_billing",
"type": "node"
}
},
{
"condition": {
"prompt": "The caller has explicitly asked for a human.",
"type": "llm"
},
"id": "e_intake_to_escalation_assistant",
"start_node_id": "n_intake",
"target": {
"assistant_id": "assistant-human-handoff",
"position": {
"x": 600,
"y": 80
},
"type": "assistant",
"voice_mode": "distinct"
}
}
],
"nodes": [
{
"type": "prompt",
"id": "n_intake",
"instructions": "Greet the caller and ask what they're calling about.",
"name": "Intake",
"position": {
"x": 120,
"y": 80
},
"shared_tool_ids": [
"tool-faq-kb"
]
},
{
"type": "prompt",
"id": "n_billing",
"instructions": "Focus on billing questions. Look up the caller's latest invoice with the billing tool before answering.",
"instructions_mode": "append",
"model": "moonshotai/Kimi-K2.6",
"name": "Billing",
"position": {
"x": 420,
"y": 80
},
"shared_tool_ids": [
"tool-billing-lookup"
],
"tools_mode": "append"
}
],
"start_node_id": "n_intake"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"code": "10036",
"title": "Resource is being processed",
"detail": "A request with this Idempotency-Key is already being processed.",
"source": {
"pointer": "/header/Idempotency-Key"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"errors": [
{
"code": "10007",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional opaque, unquoted key for safely retrying the same logical request. Keys must contain 1 to 255 letters, numbers, hyphens, or underscores. Generate a unique UUID v4 for each operation and reuse it only when retrying that operation with the same request. Invalid headers—including duplicate, empty, malformed, or overlong values—return 400 with error code 10015. A request already in progress with the same key returns 409; reusing the key with a different request returns 422. Only successful responses are replayed, for up to 24 hours. Do not include sensitive data in the key.
1 - 255^[A-Za-z0-9_-]{1,255}$Body
The external provider to import assistants from.
elevenlabs, vapi, retell Integration secret pointer that refers to the API key for the external provider. This should be an identifier for an integration secret created via /v2/integration_secrets.
Optional list of assistant IDs to import from the external provider. If not provided, all assistants will be imported.
Response
Successful Response
Show child attributes
Show child attributes
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const assistantsList = await client.ai.assistants.imports({
api_key_ref: 'api_key_ref',
provider: 'elevenlabs',
});
console.log(assistantsList.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
assistants_list = client.ai.assistants.imports(
api_key_ref="api_key_ref",
provider="elevenlabs",
)
print(assistants_list.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
assistantsList, err := client.AI.Assistants.Imports(context.TODO(), telnyx.AIAssistantImportsParams{
APIKeyRef: "api_key_ref",
Provider: telnyx.AIAssistantImportsParamsProviderElevenlabs,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistantsList.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.assistants.AssistantImportsParams;
import com.telnyx.sdk.models.ai.assistants.AssistantsList;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AssistantImportsParams params = AssistantImportsParams.builder()
.apiKeyRef("api_key_ref")
.provider(AssistantImportsParams.Provider.ELEVENLABS)
.build();
AssistantsList assistantsList = client.ai().assistants().imports(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
assistants_list = telnyx.ai.assistants.imports(api_key_ref: "api_key_ref", provider: :elevenlabs)
puts(assistants_list)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$assistantsList = $client->ai->assistants->imports(
apiKeyRef: 'api_key_ref', provider: 'elevenlabs', importIDs: ['string']
);
var_dump($assistantsList);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants imports \
--api-key 'My API Key' \
--api-key-ref api_key_ref \
--provider elevenlabscurl --request POST \
--url https://api.telnyx.com/v2/ai/assistants/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "elevenlabs",
"api_key_ref": "string",
"import_ids": [
"string"
]
}
'{
"data": [
{
"id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"model": "<string>",
"instructions": "<string>",
"version_id": "<string>",
"version_created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"tools": [
{
"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"
},
"preset_body_fields": {
"account_id": "{{customer_id}}",
"source": "telnyx-assistant"
},
"preset_query_params": {
"caller": "{{telnyx_end_user_target}}",
"channel": "voice"
},
"async": false,
"async_timeout_ms": 7500,
"timeout_ms": 5250,
"store_fields_as_variables": [
{
"name": "<string>",
"value_path": "<string>"
}
],
"messages": [
{
"type": "request_start",
"content": "Let me look that up for you."
},
{
"type": "request_response_delayed",
"content": "Still working on that.",
"timing_ms": 5000
}
]
}
}
],
"mcp_servers": [],
"greeting": "<string>",
"llm_api_key_ref": "<string>",
"external_llm": {
"model": "<string>",
"base_url": "<string>",
"llm_api_key_ref": "<string>",
"authentication_method": "token",
"certificate_ref": "<string>",
"token_retrieval_url": "<string>",
"forward_metadata": false
},
"fallback_config": {
"model": "<string>",
"llm_api_key_ref": "<string>",
"external_llm": {
"model": "<string>",
"base_url": "<string>",
"llm_api_key_ref": "<string>",
"authentication_method": "token",
"certificate_ref": "<string>",
"token_retrieval_url": "<string>",
"forward_metadata": false
}
},
"voice_settings": {
"voice": "<string>",
"voice_speed": 1,
"api_key_ref": "<string>",
"temperature": 0.5,
"similarity_boost": 0.75,
"use_speaker_boost": true,
"style": 0,
"speed": 1,
"language_boost": null,
"expressive_mode": false,
"background_audio": {
"type": "predefined_media",
"value": "silence",
"volume": 1
}
},
"transcription": {
"model": "deepgram/flux",
"language": "<string>",
"api_key_ref": "<string>",
"region": "<string>",
"settings": {
"smart_format": true,
"numerals": true,
"eot_threshold": 0.8,
"eot_timeout_ms": 5000,
"eager_eot_threshold": 0.8,
"keyterm": "<string>",
"end_of_turn_confidence_threshold": 0.4,
"min_turn_silence": 400,
"max_turn_silence": 1280,
"interim_results": false,
"enable_endpoint_detection": false,
"max_endpoint_delay_ms": 1750,
"context": "<string>",
"language_hints": [
"<string>"
]
}
},
"telephony_settings": {
"default_texml_app_id": "<string>",
"supports_unauthenticated_web_calls": true,
"noise_suppression": "krisp",
"noise_suppression_config": {
"attenuation_limit": 100,
"mode": "advanced"
},
"time_limit_secs": 1800,
"user_idle_timeout_secs": 7205,
"user_idle_reply_secs": 10,
"send_message_history_updates": true,
"voicemail_detection": {
"on_voicemail_detected": {
"action": "stop_assistant",
"voicemail_message": {
"type": "prompt",
"prompt": "<string>",
"message": "<string>"
}
}
},
"disable_dtmf": false,
"recording_settings": {
"enabled": true,
"channels": "dual",
"format": "mp3",
"stop_on_conversation_end": false
}
},
"messaging_settings": {
"default_messaging_profile_id": "<string>",
"delivery_status_webhook_url": "<string>",
"conversation_inactivity_minutes": 5000000
},
"enabled_features": [
"telephony"
],
"insight_settings": {
"insight_group_id": "<string>"
},
"privacy_settings": {
"data_retention": true
},
"dynamic_variables_webhook_url": "<string>",
"dynamic_variables_webhook_timeout_ms": 1500,
"dynamic_variables": {},
"import_metadata": {
"import_provider": "elevenlabs",
"import_id": "<string>"
},
"widget_settings": {
"theme": "light",
"audio_visualizer_config": {
"color": "verdant",
"preset": "<string>"
},
"start_call_text": "<string>",
"default_state": "expanded",
"position": "fixed",
"view_history_url": "<string>",
"report_issue_url": "<string>",
"give_feedback_url": "<string>",
"agent_thinking_text": "<string>",
"speak_to_interrupt_text": "<string>",
"logo_icon_url": "<string>"
},
"interruption_settings": {
"enable": true,
"disable_greeting_interruption": true,
"start_speaking_plan": {
"wait_seconds": 0.4,
"transcription_endpointing_plan": {
"on_punctuation_seconds": 0.1,
"on_no_punctuation_seconds": 1.5,
"on_number_seconds": 0.5
}
}
},
"integrations": [],
"observability_settings": {
"status": "disabled",
"secret_key_ref": "<string>",
"public_key_ref": "<string>",
"host": "<string>",
"prompt_name": "<string>",
"prompt_version": 2,
"prompt_label": "<string>",
"prompt_sync": "disabled"
},
"version_name": "New assistant",
"related_mission_ids": [],
"tags": [],
"post_conversation_settings": {
"enabled": false
},
"conversation_flow": {
"edges": [
{
"condition": {
"prompt": "The caller is asking about a bill or charge.",
"type": "llm"
},
"id": "e_intake_to_billing",
"start_node_id": "n_intake",
"target": {
"node_id": "n_billing",
"type": "node"
}
},
{
"condition": {
"prompt": "The caller has explicitly asked for a human.",
"type": "llm"
},
"id": "e_intake_to_escalation_assistant",
"start_node_id": "n_intake",
"target": {
"assistant_id": "assistant-human-handoff",
"position": {
"x": 600,
"y": 80
},
"type": "assistant",
"voice_mode": "distinct"
}
}
],
"nodes": [
{
"type": "prompt",
"id": "n_intake",
"instructions": "Greet the caller and ask what they're calling about.",
"name": "Intake",
"position": {
"x": 120,
"y": 80
},
"shared_tool_ids": [
"tool-faq-kb"
]
},
{
"type": "prompt",
"id": "n_billing",
"instructions": "Focus on billing questions. Look up the caller's latest invoice with the billing tool before answering.",
"instructions_mode": "append",
"model": "moonshotai/Kimi-K2.6",
"name": "Billing",
"position": {
"x": 420,
"y": 80
},
"shared_tool_ids": [
"tool-billing-lookup"
],
"tools_mode": "append"
}
],
"start_node_id": "n_intake"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"code": "10036",
"title": "Resource is being processed",
"detail": "A request with this Idempotency-Key is already being processed.",
"source": {
"pointer": "/header/Idempotency-Key"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"errors": [
{
"code": "10007",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}