telnyx-import-vapi

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Import 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

导入内容清单

ComponentImported?Notes
InstructionsYesImported as-is
Greeting / first messageYesMaps to assistant
greeting
Voice configurationYesVoice provider and voice ID 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
组件是否导入?说明
Instructions原样导入
问候语/首条消息映射到助手
greeting
字段
语音配置保留语音服务商和语音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. Vapi API key — from your Vapi dashboard
  3. Store the Vapi 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. Vapi API密钥 — 从您的Vapi控制台获取
  3. 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.,
vapi_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.
导入前,请将您的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})"
end
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})"
end

Step 2 (Alternative): Import Specific Assistants

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

To import only certain assistants, pass their Vapi assistant IDs in
import_ids
:
如需仅导入特定助手,请在
import_ids
中传入对应的Vapi助手ID:

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",
  "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:
  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 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参考

FieldTypeRequiredDescription
provider
stringYesMust be
"vapi"
api_key_ref
stringYesName of the Telnyx integration secret containing your Vapi API key
import_ids
array[string]NoSpecific Vapi assistant IDs to import. Omit to import all.
Endpoint:
POST https://api.telnyx.com/v2/ai/assistants/import
字段类型必填说明
provider
字符串必须为
"vapi"
api_key_ref
字符串存储了Vapi API密钥的Telnyx集成密钥的名称
import_ids
字符串数组需要导入的特定Vapi助手ID。省略则导入所有助手。
接口:
POST https://api.telnyx.com/v2/ai/assistants/import