telnyx-import-elevenlabs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImport 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
导入内容说明
| Component | Imported? | Notes |
|---|---|---|
| Instructions | Yes | Imported as-is |
| Greeting / first message | Yes | Maps to assistant |
| Voice configuration | Yes | ElevenLabs voice ID and settings preserved |
| Dynamic variables | Yes | Default values carried over |
| Tools (hangup, transfer, webhook) | Yes | Tool definitions and configurations |
| MCP Server integrations | Yes | Server URLs and tool mappings |
| Call analysis / insights | Yes | Mapped to |
| Data retention preferences | Yes | Mapped to |
| Knowledge base | No | Must be manually added post-import |
| Secrets (API keys in tools) | Partial | Placeholder secrets created — you must re-enter values in the Telnyx portal |
| 组件 | 是否导入 | 备注 |
|---|---|---|
| 指令 | 是 | 原样导入 |
| 问候语/首条消息 | 是 | 映射到助手 |
| 语音配置 | 是 | 保留ElevenLabs语音ID和设置 |
| 动态变量 | 是 | 保留默认值 |
| 工具(挂断、转接、webhook) | 是 | 保留工具定义和配置 |
| MCP Server集成 | 是 | 保留服务端URL和工具映射 |
| 通话分析/洞察 | 是 | 映射到 |
| 数据保留偏好 | 是 | 映射到 |
| 知识库 | 否 | 导入完成后必须手动添加 |
| 密钥(工具中的API密钥) | 部分支持 | 会创建占位符密钥——你需要在Telnyx门户中重新输入对应值 |
Prerequisites
前置条件
- Telnyx API key — get one at https://portal.telnyx.com/#/app/api-keys
- ElevenLabs API key — from your ElevenLabs dashboard (Profile → API Keys)
- Store the ElevenLabs API key as a Telnyx integration secret at https://portal.telnyx.com/#/app/integration-secrets
- Telnyx API密钥——可在此获取:https://portal.telnyx.com/#/app/api-keys
- ElevenLabs API密钥——从你的ElevenLabs控制台获取(个人资料→API Keys)
- 在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., ) — you'll use it in the import call.
elevenlabs_api_keyYou 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})"
endruby
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})"
endStep 2 (Alternative): Import Specific Agents
步骤2(可选):导入指定Agent
To import only certain agents, pass their ElevenLabs agent IDs in :
import_ids如果只需导入部分Agent,在中传入对应的ElevenLabs Agent ID即可:
import_idscurl
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:
- 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.
- Add knowledge bases — Knowledge base content is not imported. Upload files or add URLs in the assistant's Knowledge Base settings.
- Assign a phone number — Connect a Telnyx phone number to your imported assistant to start receiving calls.
- Test the assistant — Use the Telnyx assistant testing API or make a test call to verify behavior.
导入完成后,请完成以下手动步骤:
- 重新输入密钥——工具引用的所有API密钥都会作为占位符导入,请访问https://portal.telnyx.com/#/app/integration-secrets 填入实际值。
- 添加知识库——知识库内容不会被导入,请在助手的知识库设置中上传文件或添加URL。
- 分配电话号码——给导入的助手绑定一个Telnyx电话号码,即可开始接听来电。
- 测试助手——使用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参考
| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Must be |
| string | Yes | Name of the Telnyx integration secret containing your ElevenLabs API key |
| array[string] | No | Specific ElevenLabs agent IDs to import. Omit to import all. |
Endpoint:
POST https://api.telnyx.com/v2/ai/assistants/import| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| string | 是 | 必须为 |
| string | 是 | 存储ElevenLabs API密钥的Telnyx集成密钥名称 |
| array[string] | 否 | 要导入的指定ElevenLabs Agent ID,省略则导入全部 |
接口地址:
POST https://api.telnyx.com/v2/ai/assistants/import