telnyx-import-vapi
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImport Vapi Assistants into Telnyx
将Vapi助手导入Telnyx
Migrate your Vapi voice assistants to Telnyx in minutes. The import API pulls assistant configurations directly from Vapi using your API key and recreates them as Telnyx AI Assistants.
Interaction model: Collect the user's Telnyx API key and Vapi API key, store the Vapi 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.
只需几分钟即可将您的Vapi语音助手迁移到Telnyx。该导入API使用您的API密钥直接从Vapi拉取助手配置,并将其重建为Telnyx AI助手。
交互模型:收集用户的Telnyx API密钥和Vapi API密钥,将Vapi密钥存储为Telnyx集成密钥,运行导入,然后验证。请勿跳过密钥创建步骤——导入接口需要密钥引用,而非明文密钥。
What Gets Imported
导入内容清单
| Component | Imported? | Notes |
|---|---|---|
| Instructions | Yes | Imported as-is |
| Greeting / first message | Yes | Maps to assistant |
| Voice configuration | Yes | Voice provider and voice ID 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 |
| 组件 | 是否导入? | 说明 |
|---|---|---|
| Instructions | 是 | 原样导入 |
| 问候语/首条消息 | 是 | 映射到助手 |
| 语音配置 | 是 | 保留语音服务商和语音ID |
| 动态变量 | 是 | 继承默认值 |
| 工具(挂断、转接、webhook) | 是 | 导入工具定义和配置 |
| MCP Server集成 | 是 | 导入服务端URL和工具映射 |
| 通话分析/洞察 | 是 | 映射到 |
| 数据留存偏好 | 是 | 映射到 |
| 知识库 | 否 | 导入完成后需手动添加 |
| 密钥(工具内的API密钥) | 部分 | 会创建占位符密钥——您需要在Telnyx门户中重新输入对应值 |
Prerequisites
前置条件
- Telnyx API key — get one at https://portal.telnyx.com/#/app/api-keys
- Vapi API key — from your Vapi dashboard
- Store the Vapi API key as a Telnyx integration secret at https://portal.telnyx.com/#/app/integration-secrets
- Telnyx API密钥 — 可在https://portal.telnyx.com/#/app/api-keys 获取
- Vapi API密钥 — 从您的Vapi控制台获取
- 在https://portal.telnyx.com/#/app/integration-secrets 中将Vapi API密钥存储为Telnyx集成密钥
Step 1: Store Your Vapi API Key as a Telnyx Secret
步骤1:将您的Vapi API密钥存储为Telnyx密钥
Before importing, store your Vapi API key as an integration secret in Telnyx. Note the secret reference name (e.g., ) — you'll use it in the import call.
vapi_api_keyYou can create integration secrets via the Telnyx Portal under Integration Secrets, or via the API.
导入前,请将您的Vapi API密钥存储为Telnyx中的集成密钥。记下密钥引用名称(例如)——您会在导入调用中使用它。
vapi_api_key您可以通过Telnyx门户的集成密钥板块创建集成密钥,也可以通过API创建。
Step 2: Import All Vapi Assistants
步骤2:导入所有Vapi助手
Import every assistant from your Vapi account:
导入您Vapi账户中的所有助手:
curl
curl
bash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "vapi",
"api_key_ref": "vapi_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": "vapi",
"api_key_ref": "vapi_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="vapi",
api_key_ref="vapi_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="vapi",
api_key_ref="vapi_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: 'vapi',
api_key_ref: 'vapi_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: 'vapi',
api_key_ref: 'vapi_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.AIAssistantImportsParamsProviderVapi,
APIKeyRef: "vapi_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.AIAssistantImportsParamsProviderVapi,
APIKeyRef: "vapi_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.VAPI)
.apiKeyRef("vapi_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.VAPI)
.apiKeyRef("vapi_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: :vapi,
api_key_ref: "vapi_api_key"
)
assistants.data.each do |a|
puts "Imported: #{a.name} (ID: #{a.id})"
endruby
assistants = client.ai.assistants.imports(
provider: :vapi,
api_key_ref: "vapi_api_key"
)
assistants.data.each do |a|
puts "Imported: #{a.name} (ID: #{a.id})"
endStep 2 (Alternative): Import Specific Assistants
步骤2(可选):导入指定助手
To import only certain assistants, pass their Vapi assistant IDs in :
import_ids如需仅导入特定助手,请在中传入对应的Vapi助手ID:
import_idscurl
curl
bash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "vapi",
"api_key_ref": "vapi_api_key",
"import_ids": ["vapi-assistant-id-1", "vapi-assistant-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": "vapi",
"api_key_ref": "vapi_api_key",
"import_ids": ["vapi-assistant-id-1", "vapi-assistant-id-2"]
}' \
"https://api.telnyx.com/v2/ai/assistants/import"Python
Python
python
assistants = client.ai.assistants.imports(
provider="vapi",
api_key_ref="vapi_api_key",
import_ids=["vapi-assistant-id-1", "vapi-assistant-id-2"],
)python
assistants = client.ai.assistants.imports(
provider="vapi",
api_key_ref="vapi_api_key",
import_ids=["vapi-assistant-id-1", "vapi-assistant-id-2"],
)JavaScript
JavaScript
javascript
const assistants = await client.ai.assistants.imports({
provider: 'vapi',
api_key_ref: 'vapi_api_key',
import_ids: ['vapi-assistant-id-1', 'vapi-assistant-id-2'],
});javascript
const assistants = await client.ai.assistants.imports({
provider: 'vapi',
api_key_ref: 'vapi_api_key',
import_ids: ['vapi-assistant-id-1', 'vapi-assistant-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 Vapi assistants will overwrite the existing Telnyx copies with the latest configuration from Vapi. This is useful for syncing changes during a gradual migration.
对同一个Vapi助手再次运行导入操作会覆盖现有的Telnyx助手,使用Vapi侧的最新配置。这适用于渐进式迁移过程中的配置同步。
API Reference
API参考
| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Must be |
| string | Yes | Name of the Telnyx integration secret containing your Vapi API key |
| array[string] | No | Specific Vapi assistant IDs to import. Omit to import all. |
Endpoint:
POST https://api.telnyx.com/v2/ai/assistants/import| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| 字符串 | 是 | 必须为 |
| 字符串 | 是 | 存储了Vapi API密钥的Telnyx集成密钥的名称 |
| 字符串数组 | 否 | 需要导入的特定Vapi助手ID。省略则导入所有助手。 |
接口:
POST https://api.telnyx.com/v2/ai/assistants/import