telnyx-import-elevenlabs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Import ElevenLabs Agents into Telnyx

将ElevenLabs Agent导入Telnyx

Migrate your ElevenLabs conversational AI agents to Telnyx in minutes. The import API pulls agent configurations directly from ElevenLabs using your API key and recreates them as Telnyx AI Assistants.
Interaction model: Collect the user's Telnyx API key and ElevenLabs API key, store the ElevenLabs key as a Telnyx integration secret, run the import, then verify. Do NOT skip the secret-creation step — the import endpoint requires a secret reference, not a raw key.
你只需几分钟即可将ElevenLabs对话式AI Agent迁移到Telnyx。导入API会使用你的API密钥直接从ElevenLabs拉取Agent配置,并将其重建为Telnyx AI助手。
交互流程:收集用户的Telnyx API密钥和ElevenLabs API密钥,将ElevenLabs密钥存储为Telnyx集成密钥,运行导入,然后验证。请勿跳过密钥创建步骤——导入接口需要传入密钥引用,而非原始密钥。

What Gets Imported

导入内容说明

ComponentImported?Notes
InstructionsYesImported as-is
Greeting / first messageYesMaps to assistant
greeting
Voice configurationYesElevenLabs voice ID and settings preserved
Dynamic variablesYesDefault values carried over
Tools (hangup, transfer, webhook)YesTool definitions and configurations
MCP Server integrationsYesServer URLs and tool mappings
Call analysis / insightsYesMapped to
insight_settings
Data retention preferencesYesMapped to
privacy_settings
Knowledge baseNoMust be manually added post-import
Secrets (API keys in tools)PartialPlaceholder secrets created — you must re-enter values in the Telnyx portal
组件是否导入备注
指令原样导入
问候语/首条消息映射到助手
greeting
字段
语音配置保留ElevenLabs语音ID和设置
动态变量保留默认值
工具(挂断、转接、webhook)保留工具定义和配置
MCP Server集成保留服务端URL和工具映射
通话分析/洞察映射到
insight_settings
数据保留偏好映射到
privacy_settings
知识库导入完成后必须手动添加
密钥(工具中的API密钥)部分支持会创建占位符密钥——你需要在Telnyx门户中重新输入对应值

Prerequisites

前置条件

  1. Telnyx API key — get one at https://portal.telnyx.com/#/app/api-keys
  2. ElevenLabs API key — from your ElevenLabs dashboard (Profile → API Keys)
  3. Store the ElevenLabs API key as a Telnyx integration secret at https://portal.telnyx.com/#/app/integration-secrets
  1. Telnyx API密钥——可在此获取:https://portal.telnyx.com/#/app/api-keys
  2. ElevenLabs API密钥——从你的ElevenLabs控制台获取(个人资料→API Keys)
  3. https://portal.telnyx.com/#/app/integration-secrets 将ElevenLabs API密钥存储为Telnyx集成密钥

Step 1: Store Your ElevenLabs API Key as a Telnyx Secret

步骤1:将你的ElevenLabs API密钥存储为Telnyx密钥

Before importing, store your ElevenLabs API key as an integration secret in Telnyx. Note the secret reference name (e.g.,
elevenlabs_api_key
) — you'll use it in the import call.
You can create integration secrets via the Telnyx Portal under Integration Secrets, or via the API.
导入操作开始前,请先将你的ElevenLabs API密钥存储为Telnyx中的集成密钥。记下密钥引用名(例如
elevenlabs_api_key
)——你会在导入调用中用到它。
你可以通过Telnyx门户的集成密钥模块创建集成密钥,也可以通过API创建。

Step 2: Import All ElevenLabs Agents

步骤2:导入所有ElevenLabs Agent

Import every conversational AI agent from your ElevenLabs account:
导入你ElevenLabs账号下的所有对话式AI Agent:

curl

curl

bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "elevenlabs",
  "api_key_ref": "elevenlabs_api_key"
}' \
  "https://api.telnyx.com/v2/ai/assistants/import"
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "elevenlabs",
  "api_key_ref": "elevenlabs_api_key"
}' \
  "https://api.telnyx.com/v2/ai/assistants/import"

Python

Python

python
import os
from telnyx import Telnyx

client = Telnyx(api_key=os.environ.get("TELNYX_API_KEY"))

assistants = client.ai.assistants.imports(
    provider="elevenlabs",
    api_key_ref="elevenlabs_api_key",
)

for assistant in assistants.data:
    print(f"Imported: {assistant.name} (ID: {assistant.id})")
python
import os
from telnyx import Telnyx

client = Telnyx(api_key=os.environ.get("TELNYX_API_KEY"))

assistants = client.ai.assistants.imports(
    provider="elevenlabs",
    api_key_ref="elevenlabs_api_key",
)

for assistant in assistants.data:
    print(f"Imported: {assistant.name} (ID: {assistant.id})")

JavaScript

JavaScript

javascript
import Telnyx from 'telnyx';

const client = new Telnyx();

const assistants = await client.ai.assistants.imports({
  provider: 'elevenlabs',
  api_key_ref: 'elevenlabs_api_key',
});

for (const assistant of assistants.data) {
  console.log(`Imported: ${assistant.name} (ID: ${assistant.id})`);
}
javascript
import Telnyx from 'telnyx';

const client = new Telnyx();

const assistants = await client.ai.assistants.imports({
  provider: 'elevenlabs',
  api_key_ref: 'elevenlabs_api_key',
});

for (const assistant of assistants.data) {
  console.log(`Imported: ${assistant.name} (ID: ${assistant.id})`);
}

Go

Go

go
assistants, err := client.AI.Assistants.Imports(context.TODO(), telnyx.AIAssistantImportsParams{
    Provider:  telnyx.AIAssistantImportsParamsProviderElevenlabs,
    APIKeyRef: "elevenlabs_api_key",
})
if err != nil {
    panic(err.Error())
}
for _, a := range assistants.Data {
    fmt.Printf("Imported: %s (ID: %s)\n", a.Name, a.ID)
}
go
assistants, err := client.AI.Assistants.Imports(context.TODO(), telnyx.AIAssistantImportsParams{
    Provider:  telnyx.AIAssistantImportsParamsProviderElevenlabs,
    APIKeyRef: "elevenlabs_api_key",
})
if err != nil {
    panic(err.Error())
}
for _, a := range assistants.Data {
    fmt.Printf("Imported: %s (ID: %s)\n", a.Name, a.ID)
}

Java

Java

java
import com.telnyx.sdk.models.ai.assistants.AssistantImportsParams;
import com.telnyx.sdk.models.ai.assistants.AssistantsList;

AssistantImportsParams params = AssistantImportsParams.builder()
    .provider(AssistantImportsParams.Provider.ELEVENLABS)
    .apiKeyRef("elevenlabs_api_key")
    .build();
AssistantsList assistants = client.ai().assistants().imports(params);
assistants.getData().forEach(a ->
    System.out.printf("Imported: %s (ID: %s)%n", a.getName(), a.getId()));
java
import com.telnyx.sdk.models.ai.assistants.AssistantImportsParams;
import com.telnyx.sdk.models.ai.assistants.AssistantsList;

AssistantImportsParams params = AssistantImportsParams.builder()
    .provider(AssistantImportsParams.Provider.ELEVENLABS)
    .apiKeyRef("elevenlabs_api_key")
    .build();
AssistantsList assistants = client.ai().assistants().imports(params);
assistants.getData().forEach(a ->
    System.out.printf("Imported: %s (ID: %s)%n", a.getName(), a.getId()));

Ruby

Ruby

ruby
assistants = client.ai.assistants.imports(
  provider: :elevenlabs,
  api_key_ref: "elevenlabs_api_key"
)

assistants.data.each do |a|
  puts "Imported: #{a.name} (ID: #{a.id})"
end
ruby
assistants = client.ai.assistants.imports(
  provider: :elevenlabs,
  api_key_ref: "elevenlabs_api_key"
)

assistants.data.each do |a|
  puts "Imported: #{a.name} (ID: #{a.id})"
end

Step 2 (Alternative): Import Specific Agents

步骤2(可选):导入指定Agent

To import only certain agents, pass their ElevenLabs agent IDs in
import_ids
:
如果只需导入部分Agent,在
import_ids
中传入对应的ElevenLabs Agent ID即可:

curl

curl

bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "elevenlabs",
  "api_key_ref": "elevenlabs_api_key",
  "import_ids": ["elevenlabs-agent-id-1", "elevenlabs-agent-id-2"]
}' \
  "https://api.telnyx.com/v2/ai/assistants/import"
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "elevenlabs",
  "api_key_ref": "elevenlabs_api_key",
  "import_ids": ["elevenlabs-agent-id-1", "elevenlabs-agent-id-2"]
}' \
  "https://api.telnyx.com/v2/ai/assistants/import"

Python

Python

python
assistants = client.ai.assistants.imports(
    provider="elevenlabs",
    api_key_ref="elevenlabs_api_key",
    import_ids=["elevenlabs-agent-id-1", "elevenlabs-agent-id-2"],
)
python
assistants = client.ai.assistants.imports(
    provider="elevenlabs",
    api_key_ref="elevenlabs_api_key",
    import_ids=["elevenlabs-agent-id-1", "elevenlabs-agent-id-2"],
)

JavaScript

JavaScript

javascript
const assistants = await client.ai.assistants.imports({
  provider: 'elevenlabs',
  api_key_ref: 'elevenlabs_api_key',
  import_ids: ['elevenlabs-agent-id-1', 'elevenlabs-agent-id-2'],
});
javascript
const assistants = await client.ai.assistants.imports({
  provider: 'elevenlabs',
  api_key_ref: 'elevenlabs_api_key',
  import_ids: ['elevenlabs-agent-id-1', 'elevenlabs-agent-id-2'],
});

Step 3: Verify the Import

步骤3:验证导入结果

List your Telnyx assistants to confirm the import succeeded:
列出你的Telnyx助手列表,确认导入成功:

curl

curl

bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/ai/assistants"
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/ai/assistants"

Python

Python

python
assistants = client.ai.assistants.list()
for a in assistants.data:
    print(f"{a.name}{a.id} — imported: {a.import_metadata}")
python
assistants = client.ai.assistants.list()
for a in assistants.data:
    print(f"{a.name}{a.id} — imported: {a.import_metadata}")

JavaScript

JavaScript

javascript
const assistants = await client.ai.assistants.list();
for (const a of assistants.data) {
  console.log(`${a.name}${a.id} — imported:`, a.import_metadata);
}
javascript
const assistants = await client.ai.assistants.list();
for (const a of assistants.data) {
  console.log(`${a.name}${a.id} — imported:`, a.import_metadata);
}

Step 4: Post-Import Checklist

步骤4:导入后检查清单

After importing, complete these manual steps:
  1. Re-enter secrets — Any API keys referenced by tools were imported as placeholders. Go to https://portal.telnyx.com/#/app/integration-secrets and supply the actual values.
  2. Add knowledge bases — Knowledge base content is not imported. Upload files or add URLs in the assistant's Knowledge Base settings.
  3. Assign a phone number — Connect a Telnyx phone number to your imported assistant to start receiving calls.
  4. Test the assistant — Use the Telnyx assistant testing API or make a test call to verify behavior.
导入完成后,请完成以下手动步骤:
  1. 重新输入密钥——工具引用的所有API密钥都会作为占位符导入,请访问https://portal.telnyx.com/#/app/integration-secrets 填入实际值。
  2. 添加知识库——知识库内容不会被导入,请在助手的知识库设置中上传文件或添加URL。
  3. 分配电话号码——给导入的助手绑定一个Telnyx电话号码,即可开始接听来电。
  4. 测试助手——使用Telnyx助手测试API或者拨打测试电话,验证功能运行是否正常。

Re-importing

重新导入

Running the import again for the same ElevenLabs agents will overwrite the existing Telnyx copies with the latest configuration from ElevenLabs. This is useful for syncing changes during a gradual migration.
对同一个ElevenLabs Agent再次运行导入操作会覆盖已有的Telnyx副本,使用ElevenLabs的最新配置替换旧配置,这在逐步迁移过程中同步变更非常有用。

API Reference

API参考

FieldTypeRequiredDescription
provider
stringYesMust be
"elevenlabs"
api_key_ref
stringYesName of the Telnyx integration secret containing your ElevenLabs API key
import_ids
array[string]NoSpecific ElevenLabs agent IDs to import. Omit to import all.
Endpoint:
POST https://api.telnyx.com/v2/ai/assistants/import
字段类型必填描述
provider
string必须为
"elevenlabs"
api_key_ref
string存储ElevenLabs API密钥的Telnyx集成密钥名称
import_ids
array[string]要导入的指定ElevenLabs Agent ID,省略则导入全部
接口地址:
POST https://api.telnyx.com/v2/ai/assistants/import