telnyx-iot-curl

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- 由Telnyx OpenAPI规范自动生成,请勿编辑。 -->

Telnyx Iot - curl

Telnyx IoT - curl

Installation

安装

text
undefined
text
undefined

curl is pre-installed on macOS, Linux, and Windows 10+

curl在macOS、Linux和Windows 10+系统上已预装

undefined
undefined

Setup

配置

bash
export TELNYX_API_KEY="YOUR_API_KEY_HERE"
All examples below use
$TELNYX_API_KEY
for authentication.
bash
export TELNYX_API_KEY="YOUR_API_KEY_HERE"
以下所有示例均使用
$TELNYX_API_KEY
进行身份验证。

Error Handling

错误处理

All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
bash
undefined
所有API调用都可能因网络错误、速率限制(429)、校验错误(422)或身份验证错误(401)而失败,在生产代码中请务必处理错误:
bash
undefined

Check HTTP status code in response

检查响应中的HTTP状态码

response=$(curl -s -w "\n%{http_code}"
-X POST "https://api.telnyx.com/v2/messages"
-H "Authorization: Bearer $TELNYX_API_KEY"
-H "Content-Type: application/json"
-d '{"to": "+13125550001", "from": "+13125550002", "text": "Hello"}')
http_code=$(echo "$response" | tail -1) body=$(echo "$response" | sed '$d')
case $http_code in 2*) echo "Success: $body" ;; 422) echo "Validation error — check required fields and formats" ;; 429) echo "Rate limited — retry after delay"; sleep 1 ;; 401) echo "Authentication failed — check TELNYX_API_KEY" ;; *) echo "Error $http_code: $body" ;; esac

Common error codes: `401` invalid API key, `403` insufficient permissions,
`404` resource not found, `422` validation error (check field formats),
`429` rate limited (retry with exponential backoff).
response=$(curl -s -w "\n%{http_code}"
-X POST "https://api.telnyx.com/v2/messages"
-H "Authorization: Bearer $TELNYX_API_KEY"
-H "Content-Type: application/json"
-d '{"to": "+13125550001", "from": "+13125550002", "text": "Hello"}')
http_code=$(echo "$response" | tail -1) body=$(echo "$response" | sed '$d')
case $http_code in 2*) echo "Success: $body" ;; 422) echo "Validation error — check required fields and formats" ;; 429) echo "Rate limited — retry after delay"; sleep 1 ;; 401) echo "Authentication failed — check TELNYX_API_KEY" ;; *) echo "Error $http_code: $body" ;; esac

常见错误码:`401` 无效API密钥,`403` 权限不足,`404` 资源未找到,`422` 校验错误(检查字段格式),`429` 速率受限(使用指数退避重试)。

Important Notes

重要提示

  • Pagination: List endpoints return paginated results. Use
    page[number]
    and
    page[size]
    query parameters to navigate pages. Check
    meta.total_pages
    in the response.
  • 分页: 列表类接口返回分页结果,使用
    page[number]
    page[size]
    查询参数进行翻页,可查看响应中的
    meta.total_pages
    获取总页数。

Purchase eSIMs

购买eSIM

Purchases and registers the specified amount of eSIMs to the current user's account.
If
sim_card_group_id
is provided, the eSIMs will be associated with that group. Otherwise, the default group for the current user will be used.
POST /actions/purchase/esims
— Required:
amount
Optional:
product
(string),
sim_card_group_id
(uuid),
status
(enum: enabled, disabled, standby),
tags
(array[string]),
whitelabel_name
(string)
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 10
}' \
  "https://api.telnyx.com/v2/actions/purchase/esims"
Returns:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
msisdn
(string),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)
购买指定数量的eSIM并注册到当前用户账户。
如果提供了
sim_card_group_id
,则eSIM将关联到该分组,否则将使用当前用户的默认分组。
POST /actions/purchase/esims
— 必填参数:
amount
可选参数:
product
(string),
sim_card_group_id
(uuid),
status
(enum: enabled, disabled, standby),
tags
(array[string]),
whitelabel_name
(string)
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 10
}' \
  "https://api.telnyx.com/v2/actions/purchase/esims"
返回参数:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
msisdn
(string),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)

Register SIM cards

注册SIM卡

Register the SIM cards associated with the provided registration codes to the current user's account.
If
sim_card_group_id
is provided, the SIM cards will be associated with that group. Otherwise, the default group for the current user will be used.
POST /actions/register/sim_cards
— Required:
registration_codes
Optional:
sim_card_group_id
(uuid),
status
(enum: enabled, disabled, standby),
tags
(array[string])
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "registration_codes": [
    "0000000001",
    "0000000002",
    "0000000003"
  ]
}' \
  "https://api.telnyx.com/v2/actions/register/sim_cards"
Returns:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
msisdn
(string),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)
将提供的注册码对应的SIM卡注册到当前用户账户。
如果提供了
sim_card_group_id
,则SIM卡将关联到该分组,否则将使用当前用户的默认分组。
POST /actions/register/sim_cards
— 必填参数:
registration_codes
可选参数:
sim_card_group_id
(uuid),
status
(enum: enabled, disabled, standby),
tags
(array[string])
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "registration_codes": [
    "0000000001",
    "0000000002",
    "0000000003"
  ]
}' \
  "https://api.telnyx.com/v2/actions/register/sim_cards"
返回参数:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
msisdn
(string),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)

List bulk SIM card actions

列出SIM卡批量操作记录

This API lists a paginated collection of bulk SIM card actions. A bulk SIM card action contains details about a collection of individual SIM card actions.
GET /bulk_sim_card_actions
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bulk_sim_card_actions?filter[action_type]=bulk_set_public_ips"
Returns:
action_type
(enum: bulk_disable_voice, bulk_enable_voice, bulk_set_public_ips),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_actions_summary
(array[object]),
updated_at
(string)
该API返回分页的SIM卡批量操作记录集合,每条批量操作记录包含一组单个SIM卡操作的详情。
GET /bulk_sim_card_actions
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bulk_sim_card_actions?filter[action_type]=bulk_set_public_ips"
返回参数:
action_type
(enum: bulk_disable_voice, bulk_enable_voice, bulk_set_public_ips),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_actions_summary
(array[object]),
updated_at
(string)

Get bulk SIM card action details

获取SIM卡批量操作详情

This API fetches information about a bulk SIM card action. A bulk SIM card action contains details about a collection of individual SIM card actions.
GET /bulk_sim_card_actions/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bulk_sim_card_actions/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
action_type
(enum: bulk_disable_voice, bulk_enable_voice, bulk_set_public_ips),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_actions_summary
(array[object]),
updated_at
(string)
该API获取单条SIM卡批量操作的信息,每条批量操作记录包含一组单个SIM卡操作的详情。
GET /bulk_sim_card_actions/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bulk_sim_card_actions/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
action_type
(enum: bulk_disable_voice, bulk_enable_voice, bulk_set_public_ips),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_actions_summary
(array[object]),
updated_at
(string)

List OTA updates

列出OTA更新记录

GET /ota_updates
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/ota_updates"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: sim_card_network_preferences),
updated_at
(string)
GET /ota_updates
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/ota_updates"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: sim_card_network_preferences),
updated_at
(string)

Get OTA update

获取OTA更新详情

This API returns the details of an Over the Air (OTA) update.
GET /ota_updates/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/ota_updates/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: sim_card_network_preferences),
updated_at
(string)
该API返回空中下载(OTA)更新的详细信息。
GET /ota_updates/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/ota_updates/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: sim_card_network_preferences),
updated_at
(string)

List SIM card actions

列出SIM卡操作记录

This API lists a paginated collection of SIM card actions. It enables exploring a collection of existing asynchronous operations using specific filters.
GET /sim_card_actions
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_actions"
Returns:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)
该API返回分页的SIM卡操作记录集合,支持使用特定筛选条件查询已有的异步操作。
GET /sim_card_actions
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_actions"
返回参数:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)

Get SIM card action details

获取SIM卡操作详情

This API fetches detailed information about a SIM card action to follow-up on an existing asynchronous operation.
GET /sim_card_actions/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_actions/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)
该API获取单条SIM卡操作的详细信息,用于跟踪已有的异步操作进度。
GET /sim_card_actions/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_actions/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)

List SIM card data usage notifications

列出SIM卡流量使用通知

Lists a paginated collection of SIM card data usage notifications. It enables exploring the collection using specific filters.
GET /sim_card_data_usage_notifications
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_data_usage_notifications?filter[sim_card_id]=47a1c2b0-cc7b-4ab1-bb98-b33fb0fc61b9"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
threshold
(object),
updated_at
(string)
返回分页的SIM卡流量使用通知集合,支持使用特定筛选条件查询。
GET /sim_card_data_usage_notifications
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_data_usage_notifications?filter[sim_card_id]=47a1c2b0-cc7b-4ab1-bb98-b33fb0fc61b9"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
threshold
(object),
updated_at
(string)

Create a new SIM card data usage notification

创建SIM卡流量使用通知

Creates a new SIM card data usage notification.
POST /sim_card_data_usage_notifications
— Required:
sim_card_id
,
threshold
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sim_card_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  "threshold": {}
}' \
  "https://api.telnyx.com/v2/sim_card_data_usage_notifications"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
threshold
(object),
updated_at
(string)
创建新的SIM卡流量使用通知规则。
POST /sim_card_data_usage_notifications
— 必填参数:
sim_card_id
,
threshold
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sim_card_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  "threshold": {}
}' \
  "https://api.telnyx.com/v2/sim_card_data_usage_notifications"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
threshold
(object),
updated_at
(string)

Get a single SIM card data usage notification

获取单条SIM卡流量使用通知

Get a single SIM Card Data Usage Notification.
GET /sim_card_data_usage_notifications/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_data_usage_notifications/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
threshold
(object),
updated_at
(string)
获取单条SIM卡流量使用通知的详情。
GET /sim_card_data_usage_notifications/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_data_usage_notifications/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
threshold
(object),
updated_at
(string)

Updates information for a SIM Card Data Usage Notification

更新SIM卡流量使用通知

Updates information for a SIM Card Data Usage Notification.
PATCH /sim_card_data_usage_notifications/{id}
Optional:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
threshold
(object),
updated_at
(string)
bash
curl \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_card_data_usage_notifications/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
threshold
(object),
updated_at
(string)
更新SIM卡流量使用通知的信息。
PATCH /sim_card_data_usage_notifications/{id}
可选参数:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
threshold
(object),
updated_at
(string)
bash
curl \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_card_data_usage_notifications/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
threshold
(object),
updated_at
(string)

Delete SIM card data usage notifications

删除SIM卡流量使用通知

Delete the SIM Card Data Usage Notification.
DELETE /sim_card_data_usage_notifications/{id}
bash
curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/sim_card_data_usage_notifications/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
threshold
(object),
updated_at
(string)
删除指定的SIM卡流量使用通知规则。
DELETE /sim_card_data_usage_notifications/{id}
bash
curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/sim_card_data_usage_notifications/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
sim_card_id
(uuid),
threshold
(object),
updated_at
(string)

List SIM card group actions

列出SIM卡分组操作记录

This API allows listing a paginated collection a SIM card group actions. It allows to explore a collection of existing asynchronous operation using specific filters.
GET /sim_card_group_actions
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_group_actions?filter[sim_card_group_id]=47a1c2b0-cc7b-4ab1-bb98-b33fb0fc61b9&filter[status]=in-progress&filter[type]=set_private_wireless_gateway"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_group_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: set_private_wireless_gateway, remove_private_wireless_gateway, set_wireless_blocklist, remove_wireless_blocklist),
updated_at
(string)
该API返回分页的SIM卡分组操作记录集合,支持使用特定筛选条件查询已有的异步操作。
GET /sim_card_group_actions
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_group_actions?filter[sim_card_group_id]=47a1c2b0-cc7b-4ab1-bb98-b33fb0fc61b9&filter[status]=in-progress&filter[type]=set_private_wireless_gateway"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_group_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: set_private_wireless_gateway, remove_private_wireless_gateway, set_wireless_blocklist, remove_wireless_blocklist),
updated_at
(string)

Get SIM card group action details

获取SIM卡分组操作详情

This API allows fetching detailed information about a SIM card group action resource to make follow-ups in an existing asynchronous operation.
GET /sim_card_group_actions/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_group_actions/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_group_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: set_private_wireless_gateway, remove_private_wireless_gateway, set_wireless_blocklist, remove_wireless_blocklist),
updated_at
(string)
该API获取单条SIM卡分组操作的详细信息,用于跟踪已有的异步操作进度。
GET /sim_card_group_actions/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_group_actions/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_group_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: set_private_wireless_gateway, remove_private_wireless_gateway, set_wireless_blocklist, remove_wireless_blocklist),
updated_at
(string)

Get all SIM card groups

获取所有SIM卡分组

Get all SIM card groups belonging to the user that match the given filters.
GET /sim_card_groups
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_groups?filter[name]=My Test Group&filter[private_wireless_gateway_id]=7606c6d3-ff7c-49c1-943d-68879e9d584d&filter[wireless_blocklist_id]=0f3f490e-c4d3-4cf5-838a-9970f10ee259"
Returns:
consumed_data
(object),
created_at
(string),
data_limit
(object),
default
(boolean),
id
(uuid),
name
(string),
private_wireless_gateway_id
(uuid),
record_type
(string),
sim_card_count
(integer),
updated_at
(string),
wireless_blocklist_id
(uuid)
获取当前用户名下符合筛选条件的所有SIM卡分组。
GET /sim_card_groups
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_groups?filter[name]=My Test Group&filter[private_wireless_gateway_id]=7606c6d3-ff7c-49c1-943d-68879e9d584d&filter[wireless_blocklist_id]=0f3f490e-c4d3-4cf5-838a-9970f10ee259"
返回参数:
consumed_data
(object),
created_at
(string),
data_limit
(object),
default
(boolean),
id
(uuid),
name
(string),
private_wireless_gateway_id
(uuid),
record_type
(string),
sim_card_count
(integer),
updated_at
(string),
wireless_blocklist_id
(uuid)

Create a SIM card group

创建SIM卡分组

Creates a new SIM card group object
POST /sim_card_groups
— Required:
name
Optional:
data_limit
(object)
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "My Test Group"
}' \
  "https://api.telnyx.com/v2/sim_card_groups"
Returns:
consumed_data
(object),
created_at
(string),
data_limit
(object),
default
(boolean),
id
(uuid),
name
(string),
private_wireless_gateway_id
(uuid),
record_type
(string),
updated_at
(string),
wireless_blocklist_id
(uuid)
创建新的SIM卡分组对象。
POST /sim_card_groups
— 必填参数:
name
可选参数:
data_limit
(object)
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "My Test Group"
}' \
  "https://api.telnyx.com/v2/sim_card_groups"
返回参数:
consumed_data
(object),
created_at
(string),
data_limit
(object),
default
(boolean),
id
(uuid),
name
(string),
private_wireless_gateway_id
(uuid),
record_type
(string),
updated_at
(string),
wireless_blocklist_id
(uuid)

Get SIM card group

获取SIM卡分组详情

Returns the details regarding a specific SIM card group
GET /sim_card_groups/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58?include_iccids=True"
Returns:
consumed_data
(object),
created_at
(string),
data_limit
(object),
default
(boolean),
id
(uuid),
name
(string),
private_wireless_gateway_id
(uuid),
record_type
(string),
updated_at
(string),
wireless_blocklist_id
(uuid)
返回指定SIM卡分组的详细信息。
GET /sim_card_groups/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58?include_iccids=True"
返回参数:
consumed_data
(object),
created_at
(string),
data_limit
(object),
default
(boolean),
id
(uuid),
name
(string),
private_wireless_gateway_id
(uuid),
record_type
(string),
updated_at
(string),
wireless_blocklist_id
(uuid)

Update a SIM card group

更新SIM卡分组

Updates a SIM card group
PATCH /sim_card_groups/{id}
Optional:
data_limit
(object),
name
(string)
bash
curl \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
consumed_data
(object),
created_at
(string),
data_limit
(object),
default
(boolean),
id
(uuid),
name
(string),
private_wireless_gateway_id
(uuid),
record_type
(string),
updated_at
(string),
wireless_blocklist_id
(uuid)
更新指定SIM卡分组的信息。
PATCH /sim_card_groups/{id}
可选参数:
data_limit
(object),
name
(string)
bash
curl \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
consumed_data
(object),
created_at
(string),
data_limit
(object),
default
(boolean),
id
(uuid),
name
(string),
private_wireless_gateway_id
(uuid),
record_type
(string),
updated_at
(string),
wireless_blocklist_id
(uuid)

Delete a SIM card group

删除SIM卡分组

Permanently deletes a SIM card group
DELETE /sim_card_groups/{id}
bash
curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
consumed_data
(object),
created_at
(string),
data_limit
(object),
default
(boolean),
id
(uuid),
name
(string),
private_wireless_gateway_id
(uuid),
record_type
(string),
updated_at
(string),
wireless_blocklist_id
(uuid)
永久删除指定SIM卡分组。
DELETE /sim_card_groups/{id}
bash
curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
consumed_data
(object),
created_at
(string),
data_limit
(object),
default
(boolean),
id
(uuid),
name
(string),
private_wireless_gateway_id
(uuid),
record_type
(string),
updated_at
(string),
wireless_blocklist_id
(uuid)

Request Private Wireless Gateway removal from SIM card group

移除SIM卡分组的私有无线网关

This action will asynchronously remove an existing Private Wireless Gateway definition from a SIM card group. Completing this operation defines that all SIM cards in the SIM card group will get their traffic handled by Telnyx's default mobile network configuration.
POST /sim_card_groups/{id}/actions/remove_private_wireless_gateway
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/remove_private_wireless_gateway"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_group_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: set_private_wireless_gateway, remove_private_wireless_gateway, set_wireless_blocklist, remove_wireless_blocklist),
updated_at
(string)
该操作将异步移除SIM卡分组已关联的私有无线网关配置,操作完成后,分组内所有SIM卡的流量将由Telnyx默认移动网络配置处理。
POST /sim_card_groups/{id}/actions/remove_private_wireless_gateway
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/remove_private_wireless_gateway"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_group_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: set_private_wireless_gateway, remove_private_wireless_gateway, set_wireless_blocklist, remove_wireless_blocklist),
updated_at
(string)

Request Wireless Blocklist removal from SIM card group

移除SIM卡分组的无线访问黑名单

This action will asynchronously remove an existing Wireless Blocklist to all the SIMs in the SIM card group.
POST /sim_card_groups/{id}/actions/remove_wireless_blocklist
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/remove_wireless_blocklist"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_group_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: set_private_wireless_gateway, remove_private_wireless_gateway, set_wireless_blocklist, remove_wireless_blocklist),
updated_at
(string)
该操作将异步移除SIM卡分组内所有SIM卡关联的无线访问黑名单。
POST /sim_card_groups/{id}/actions/remove_wireless_blocklist
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/remove_wireless_blocklist"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_group_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: set_private_wireless_gateway, remove_private_wireless_gateway, set_wireless_blocklist, remove_wireless_blocklist),
updated_at
(string)

Request Private Wireless Gateway assignment for SIM card group

为SIM卡分组分配私有无线网关

This action will asynchronously assign a provisioned Private Wireless Gateway to the SIM card group. Completing this operation defines that all SIM cards in the SIM card group will get their traffic controlled by the associated Private Wireless Gateway. This operation will also imply that new SIM cards assigned to a group will inherit its network definitions.
POST /sim_card_groups/{id}/actions/set_private_wireless_gateway
— Required:
private_wireless_gateway_id
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "private_wireless_gateway_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58"
}' \
  "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/set_private_wireless_gateway"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_group_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: set_private_wireless_gateway, remove_private_wireless_gateway, set_wireless_blocklist, remove_wireless_blocklist),
updated_at
(string)
该操作将异步为SIM卡分组分配已部署的私有无线网关,操作完成后,分组内所有SIM卡的流量将由关联的私有无线网关管控,新加入分组的SIM卡也将自动继承该网络配置。
POST /sim_card_groups/{id}/actions/set_private_wireless_gateway
— 必填参数:
private_wireless_gateway_id
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "private_wireless_gateway_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58"
}' \
  "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/set_private_wireless_gateway"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_group_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: set_private_wireless_gateway, remove_private_wireless_gateway, set_wireless_blocklist, remove_wireless_blocklist),
updated_at
(string)

Request Wireless Blocklist assignment for SIM card group

为SIM卡分组分配无线访问黑名单

This action will asynchronously assign a Wireless Blocklist to all the SIMs in the SIM card group.
POST /sim_card_groups/{id}/actions/set_wireless_blocklist
— Required:
wireless_blocklist_id
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "wireless_blocklist_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58"
}' \
  "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/set_wireless_blocklist"
Returns:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_group_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: set_private_wireless_gateway, remove_private_wireless_gateway, set_wireless_blocklist, remove_wireless_blocklist),
updated_at
(string)
该操作将异步为SIM卡分组内所有SIM卡分配无线访问黑名单。
POST /sim_card_groups/{id}/actions/set_wireless_blocklist
— 必填参数:
wireless_blocklist_id
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "wireless_blocklist_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58"
}' \
  "https://api.telnyx.com/v2/sim_card_groups/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/set_wireless_blocklist"
返回参数:
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
sim_card_group_id
(uuid),
status
(enum: in-progress, completed, failed),
type
(enum: set_private_wireless_gateway, remove_private_wireless_gateway, set_wireless_blocklist, remove_wireless_blocklist),
updated_at
(string)

Preview SIM card orders

预览SIM卡订单

Preview SIM card order purchases.
POST /sim_card_order_preview
— Required:
quantity
,
address_id
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "quantity": 21,
  "address_id": "1293384261075731499"
}' \
  "https://api.telnyx.com/v2/sim_card_order_preview"
Returns:
quantity
(integer),
record_type
(string),
shipping_cost
(object),
sim_cards_cost
(object),
total_cost
(object)
预览SIM卡购买订单的费用信息。
POST /sim_card_order_preview
— 必填参数:
quantity
,
address_id
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "quantity": 21,
  "address_id": "1293384261075731499"
}' \
  "https://api.telnyx.com/v2/sim_card_order_preview"
返回参数:
quantity
(integer),
record_type
(string),
shipping_cost
(object),
sim_cards_cost
(object),
total_cost
(object)

Get all SIM card orders

获取所有SIM卡订单

Get all SIM card orders according to filters.
GET /sim_card_orders
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_orders"
Returns:
cost
(object),
created_at
(string),
id
(uuid),
order_address
(object),
quantity
(integer),
record_type
(string),
status
(enum: pending, processing, ready_to_ship, shipped, delivered, canceled),
tracking_url
(uri),
updated_at
(string)
根据筛选条件获取所有SIM卡订单。
GET /sim_card_orders
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_orders"
返回参数:
cost
(object),
created_at
(string),
id
(uuid),
order_address
(object),
quantity
(integer),
record_type
(string),
status
(enum: pending, processing, ready_to_ship, shipped, delivered, canceled),
tracking_url
(uri),
updated_at
(string)

Create a SIM card order

创建SIM卡订单

Creates a new order for SIM cards.
POST /sim_card_orders
— Required:
address_id
,
quantity
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "address_id": "1293384261075731499",
      "quantity": 23,
      "sim_card_group_id": "550e8400-e29b-41d4-a716-446655440000"
  }' \
  "https://api.telnyx.com/v2/sim_card_orders"
Returns:
cost
(object),
created_at
(string),
id
(uuid),
order_address
(object),
quantity
(integer),
record_type
(string),
status
(enum: pending, processing, ready_to_ship, shipped, delivered, canceled),
tracking_url
(uri),
updated_at
(string)
创建新的SIM卡购买订单。
POST /sim_card_orders
— 必填参数:
address_id
,
quantity
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "address_id": "1293384261075731499",
      "quantity": 23,
      "sim_card_group_id": "550e8400-e29b-41d4-a716-446655440000"
  }' \
  "https://api.telnyx.com/v2/sim_card_orders"
返回参数:
cost
(object),
created_at
(string),
id
(uuid),
order_address
(object),
quantity
(integer),
record_type
(string),
status
(enum: pending, processing, ready_to_ship, shipped, delivered, canceled),
tracking_url
(uri),
updated_at
(string)

Get a single SIM card order

获取单条SIM卡订单

Get a single SIM card order by its ID.
GET /sim_card_orders/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_orders/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
cost
(object),
created_at
(string),
id
(uuid),
order_address
(object),
quantity
(integer),
record_type
(string),
status
(enum: pending, processing, ready_to_ship, shipped, delivered, canceled),
tracking_url
(uri),
updated_at
(string)
根据ID获取单条SIM卡订单的详情。
GET /sim_card_orders/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_card_orders/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
cost
(object),
created_at
(string),
id
(uuid),
order_address
(object),
quantity
(integer),
record_type
(string),
status
(enum: pending, processing, ready_to_ship, shipped, delivered, canceled),
tracking_url
(uri),
updated_at
(string)

Get all SIM cards

获取所有SIM卡

Get all SIM cards belonging to the user that match the given filters.
GET /sim_cards
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_cards?include_sim_card_group=True&filter[sim_card_group_id]=47a1c2b0-cc7b-4ab1-bb98-b33fb0fc61b9&sort=-current_billing_period_consumed_data.amount"
Returns:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
msisdn
(string),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)
获取当前用户名下符合筛选条件的所有SIM卡。
GET /sim_cards
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_cards?include_sim_card_group=True&filter[sim_card_group_id]=47a1c2b0-cc7b-4ab1-bb98-b33fb0fc61b9&sort=-current_billing_period_consumed_data.amount"
返回参数:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
msisdn
(string),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)

Request bulk disabling voice on SIM cards.

批量禁用SIM卡语音功能

This API triggers an asynchronous operation to disable voice on SIM cards belonging to a specified SIM Card Group. For each SIM Card a SIM Card Action will be generated.
POST /sim_cards/actions/bulk_disable_voice
— Required:
sim_card_group_id
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sim_card_group_id": "6b14e151-8493-4fa1-8664-1cc4e6d14158"
}' \
  "https://api.telnyx.com/v2/sim_cards/actions/bulk_disable_voice"
Returns:
action_type
(enum: bulk_disable_voice, bulk_enable_voice, bulk_set_public_ips),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
updated_at
(string)
该API触发异步操作,批量禁用指定SIM卡分组内所有SIM卡的语音功能,每张SIM卡都会生成对应的单卡操作记录。
POST /sim_cards/actions/bulk_disable_voice
— 必填参数:
sim_card_group_id
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sim_card_group_id": "6b14e151-8493-4fa1-8664-1cc4e6d14158"
}' \
  "https://api.telnyx.com/v2/sim_cards/actions/bulk_disable_voice"
返回参数:
action_type
(enum: bulk_disable_voice, bulk_enable_voice, bulk_set_public_ips),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
updated_at
(string)

Request bulk enabling voice on SIM cards.

批量启用SIM卡语音功能

This API triggers an asynchronous operation to enable voice on SIM cards belonging to a specified SIM Card Group. For each SIM Card a SIM Card Action will be generated.
POST /sim_cards/actions/bulk_enable_voice
— Required:
sim_card_group_id
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sim_card_group_id": "6b14e151-8493-4fa1-8664-1cc4e6d14158"
}' \
  "https://api.telnyx.com/v2/sim_cards/actions/bulk_enable_voice"
Returns:
action_type
(enum: bulk_disable_voice, bulk_enable_voice, bulk_set_public_ips),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
updated_at
(string)
该API触发异步操作,批量启用指定SIM卡分组内所有SIM卡的语音功能,每张SIM卡都会生成对应的单卡操作记录。
POST /sim_cards/actions/bulk_enable_voice
— 必填参数:
sim_card_group_id
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sim_card_group_id": "6b14e151-8493-4fa1-8664-1cc4e6d14158"
}' \
  "https://api.telnyx.com/v2/sim_cards/actions/bulk_enable_voice"
返回参数:
action_type
(enum: bulk_disable_voice, bulk_enable_voice, bulk_set_public_ips),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
updated_at
(string)

Request bulk setting SIM card public IPs.

批量设置SIM卡公网IP

This API triggers an asynchronous operation to set a public IP for each of the specified SIM cards. For each SIM Card a SIM Card Action will be generated. The status of the SIM Card Action can be followed through the List SIM Card Action API.
POST /sim_cards/actions/bulk_set_public_ips
— Required:
sim_card_ids
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sim_card_ids": [
    "6b14e151-8493-4fa1-8664-1cc4e6d14158"
  ]
}' \
  "https://api.telnyx.com/v2/sim_cards/actions/bulk_set_public_ips"
Returns:
action_type
(enum: bulk_disable_voice, bulk_enable_voice, bulk_set_public_ips),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
updated_at
(string)
该API触发异步操作,为指定的每张SIM卡分配公网IP,每张SIM卡都会生成对应的单卡操作记录,可通过列出SIM卡操作记录接口跟踪操作进度。
POST /sim_cards/actions/bulk_set_public_ips
— 必填参数:
sim_card_ids
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sim_card_ids": [
    "6b14e151-8493-4fa1-8664-1cc4e6d14158"
  ]
}' \
  "https://api.telnyx.com/v2/sim_cards/actions/bulk_set_public_ips"
返回参数:
action_type
(enum: bulk_disable_voice, bulk_enable_voice, bulk_set_public_ips),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object),
updated_at
(string)

Validate SIM cards registration codes

校验SIM卡注册码

It validates whether SIM card registration codes are valid or not.
POST /sim_cards/actions/validate_registration_codes
Optional:
registration_codes
(array[string])
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/actions/validate_registration_codes"
Returns:
invalid_detail
(string | null),
record_type
(string),
registration_code
(string),
valid
(boolean)
校验SIM卡注册码是否有效。
POST /sim_cards/actions/validate_registration_codes
可选参数:
registration_codes
(array[string])
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/actions/validate_registration_codes"
返回参数:
invalid_detail
(string | null),
record_type
(string),
registration_code
(string),
valid
(boolean)

Get SIM card

获取SIM卡详情

Returns the details regarding a specific SIM card.
GET /sim_cards/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58?include_sim_card_group=True"
Returns:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
current_device_location
(object),
current_imei
(string),
current_mcc
(string),
current_mnc
(string),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
ipv4
(string),
ipv6
(string),
live_data_session
(enum: connected, disconnected, unknown),
msisdn
(string),
pin_puk_codes
(object),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)
返回指定SIM卡的详细信息。
GET /sim_cards/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58?include_sim_card_group=True"
返回参数:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
current_device_location
(object),
current_imei
(string),
current_mcc
(string),
current_mnc
(string),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
ipv4
(string),
ipv6
(string),
live_data_session
(enum: connected, disconnected, unknown),
msisdn
(string),
pin_puk_codes
(object),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)

Update a SIM card

更新SIM卡信息

Updates SIM card data
PATCH /sim_cards/{id}
Optional:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
current_device_location
(object),
current_imei
(string),
current_mcc
(string),
current_mnc
(string),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
ipv4
(string),
ipv6
(string),
live_data_session
(enum: connected, disconnected, unknown),
msisdn
(string),
pin_puk_codes
(object),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)
bash
curl \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
current_device_location
(object),
current_imei
(string),
current_mcc
(string),
current_mnc
(string),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
ipv4
(string),
ipv6
(string),
live_data_session
(enum: connected, disconnected, unknown),
msisdn
(string),
pin_puk_codes
(object),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)
更新SIM卡的相关数据。
PATCH /sim_cards/{id}
可选参数:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
current_device_location
(object),
current_imei
(string),
current_mcc
(string),
current_mnc
(string),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
ipv4
(string),
ipv6
(string),
live_data_session
(enum: connected, disconnected, unknown),
msisdn
(string),
pin_puk_codes
(object),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)
bash
curl \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
current_device_location
(object),
current_imei
(string),
current_mcc
(string),
current_mnc
(string),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
ipv4
(string),
ipv6
(string),
live_data_session
(enum: connected, disconnected, unknown),
msisdn
(string),
pin_puk_codes
(object),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)

Deletes a SIM card

删除SIM卡

The SIM card will be decommissioned, removed from your account and you will stop being charged. The SIM card won't be able to connect to the network after the deletion is completed, thus making it impossible to consume data. Transitioning to the disabled state may take a period of time.
DELETE /sim_cards/{id}
bash
curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
current_device_location
(object),
current_imei
(string),
current_mcc
(string),
current_mnc
(string),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
ipv4
(string),
ipv6
(string),
live_data_session
(enum: connected, disconnected, unknown),
msisdn
(string),
pin_puk_codes
(object),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)
SIM卡将被注销并从你的账户中移除,后续不再产生费用。删除完成后SIM卡将无法连接网络,也无法使用流量服务,切换到已禁用状态可能需要一定时间。
DELETE /sim_cards/{id}
bash
curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
actions_in_progress
(boolean),
authorized_imeis
(array | null),
created_at
(string),
current_billing_period_consumed_data
(object),
current_device_location
(object),
current_imei
(string),
current_mcc
(string),
current_mnc
(string),
data_limit
(object),
eid
(string | null),
esim_installation_status
(enum: released, disabled),
iccid
(string),
id
(uuid),
imsi
(string),
ipv4
(string),
ipv6
(string),
live_data_session
(enum: connected, disconnected, unknown),
msisdn
(string),
pin_puk_codes
(object),
record_type
(string),
resources_with_in_progress_actions
(array[object]),
sim_card_group_id
(uuid),
status
(object),
tags
(array[string]),
type
(enum: physical, esim),
updated_at
(string),
version
(string),
voice_enabled
(boolean)

Request a SIM card disable

禁用SIM卡

This API disables a SIM card, disconnecting it from the network and making it impossible to consume data. The API will trigger an asynchronous operation called a SIM Card Action. Transitioning to the disabled state may take a period of time.
POST /sim_cards/{id}/actions/disable
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/disable"
Returns:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)
该API将禁用SIM卡,断开其网络连接并禁止使用流量服务。API会触发名为SIM卡操作的异步任务,切换到已禁用状态可能需要一定时间。
POST /sim_cards/{id}/actions/disable
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/disable"
返回参数:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)

Request a SIM card enable

启用SIM卡

This API enables a SIM card, connecting it to the network and making it possible to consume data. To enable a SIM card, it must be associated with a SIM card group. The API will trigger an asynchronous operation called a SIM Card Action. Transitioning to the enabled state may take a period of time.
POST /sim_cards/{id}/actions/enable
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/enable"
Returns:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)
该API将启用SIM卡,连接网络并允许使用流量服务。启用SIM卡前,必须先将其关联到某个SIM卡分组。API会触发名为SIM卡操作的异步任务,切换到已启用状态可能需要一定时间。
POST /sim_cards/{id}/actions/enable
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/enable"
返回参数:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)

Request removing a SIM card public IP

移除SIM卡公网IP

This API removes an existing public IP from a SIM card.
The API will trigger an asynchronous operation called a SIM Card Action. The status of the SIM Card Action can be followed through the List SIM Card Action API.
POST /sim_cards/{id}/actions/remove_public_ip
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/remove_public_ip"
Returns:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)
该API将移除SIM卡已分配的公网IP,API会触发名为SIM卡操作的异步任务,可通过列出SIM卡操作记录接口跟踪操作进度。
POST /sim_cards/{id}/actions/remove_public_ip
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/remove_public_ip"
返回参数:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)

Request setting a SIM card public IP

为SIM卡分配公网IP

This API makes a SIM card reachable on the public internet by mapping a random public IP to the SIM card.
The API will trigger an asynchronous operation called a SIM Card Action.
POST /sim_cards/{id}/actions/set_public_ip
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/set_public_ip"
Returns:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)
该API将为SIM卡分配随机公网IP,使其可以通过公网访问,API会触发名为SIM卡操作的异步任务。
POST /sim_cards/{id}/actions/set_public_ip
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/set_public_ip"
返回参数:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)

Request setting a SIM card to standby

将SIM卡设置为待机状态

The SIM card will be able to connect to the network once the process to set it to standby has been completed, thus making it possible to consume data. To set a SIM card to standby, it must be associated with SIM card group. The API will trigger an asynchronous operation called a SIM Card Action. Transitioning to the standby state may take a period of time.
POST /sim_cards/{id}/actions/set_standby
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/set_standby"
Returns:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)
设置完成后,SIM卡可以连接网络并使用流量服务。设置SIM卡为待机状态前,必须先将其关联到某个SIM卡分组。API会触发名为SIM卡操作的异步任务,切换到待机状态可能需要一定时间。
POST /sim_cards/{id}/actions/set_standby
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/set_standby"
返回参数:
action_type
(enum: enable, enable_standby_sim_card, disable, set_standby),
created_at
(string),
id
(uuid),
record_type
(string),
settings
(object | null),
sim_card_id
(uuid),
status
(object),
updated_at
(string)

Get activation code for an eSIM

获取eSIM激活码

It returns the activation code for an eSIM.
This API is only available for eSIMs. If the given SIM is a physical SIM card, or has already been installed, an error will be returned.
GET /sim_cards/{id}/activation_code
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/activation_code"
Returns:
activation_code
(string),
record_type
(string)
返回eSIM的激活码,该API仅适用于eSIM。如果指定的是物理SIM卡,或者eSIM已经完成安装,将返回错误。
GET /sim_cards/{id}/activation_code
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/activation_code"
返回参数:
activation_code
(string),
record_type
(string)

Get SIM card device details

获取SIM卡设备详情

It returns the device details where a SIM card is currently being used.
GET /sim_cards/{id}/device_details
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/device_details"
Returns:
brand_name
(string),
device_type
(string),
imei
(string),
model_name
(string),
operating_system
(string),
record_type
(string)
返回当前使用该SIM卡的设备的详细信息。
GET /sim_cards/{id}/device_details
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/device_details"
返回参数:
brand_name
(string),
device_type
(string),
imei
(string),
model_name
(string),
operating_system
(string),
record_type
(string)

Get SIM card public IP definition

获取SIM卡公网IP配置

It returns the public IP requested for a SIM card.
GET /sim_cards/{id}/public_ip
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/public_ip"
Returns:
created_at
(string),
ip
(string),
record_type
(string),
region_code
(string),
sim_card_id
(uuid),
type
(enum: ipv4),
updated_at
(string)
返回SIM卡已申请的公网IP信息。
GET /sim_cards/{id}/public_ip
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/public_ip"
返回参数:
created_at
(string),
ip
(string),
record_type
(string),
region_code
(string),
sim_card_id
(uuid),
type
(enum: ipv4),
updated_at
(string)

List wireless connectivity logs

列出无线连接日志

This API allows listing a paginated collection of Wireless Connectivity Logs associated with a SIM Card, for troubleshooting purposes.
GET /sim_cards/{id}/wireless_connectivity_logs
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/wireless_connectivity_logs"
Returns:
apn
(string),
cell_id
(string),
created_at
(string),
id
(integer),
imei
(string),
imsi
(string),
ipv4
(string),
ipv6
(string),
last_seen
(string),
log_type
(enum: registration, data),
mobile_country_code
(string),
mobile_network_code
(string),
radio_access_technology
(string),
record_type
(string),
sim_card_id
(uuid),
start_time
(string),
state
(string),
stop_time
(string)
该API返回分页的SIM卡关联的无线连接日志集合,用于问题排查。
GET /sim_cards/{id}/wireless_connectivity_logs
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/wireless_connectivity_logs"
返回参数:
apn
(string),
cell_id
(string),
created_at
(string),
id
(integer),
imei
(string),
imsi
(string),
ipv4
(string),
ipv6
(string),
last_seen
(string),
log_type
(enum: registration, data),
mobile_country_code
(string),
mobile_network_code
(string),
radio_access_technology
(string),
record_type
(string),
sim_card_id
(uuid),
start_time
(string),
state
(string),
stop_time
(string),
updated_at
(string)

List Migration Source coverage

列出迁移源覆盖区域

GET /storage/migration_source_coverage
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/storage/migration_source_coverage"
Returns:
provider
(enum: aws),
source_region
(string)
GET /storage/migration_source_coverage
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/storage/migration_source_coverage"
返回参数:
provider
(enum: aws),
source_region
(string)

List all Migration Sources

列出所有迁移源

GET /storage/migration_sources
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/storage/migration_sources"
Returns:
bucket_name
(string),
id
(string),
provider
(enum: aws, telnyx),
provider_auth
(object),
source_region
(string)
GET /storage/migration_sources
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/storage/migration_sources"
返回参数:
bucket_name
(string),
id
(string),
provider
(enum: aws, telnyx),
provider_auth
(object),
source_region
(string)

Create a Migration Source

创建迁移源

Create a source from which data can be migrated from.
POST /storage/migration_sources
— Required:
provider
,
provider_auth
,
bucket_name
Optional:
id
(string),
source_region
(string)
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "aws",
  "provider_auth": {},
  "bucket_name": "my-bucket"
}' \
  "https://api.telnyx.com/v2/storage/migration_sources"
Returns:
bucket_name
(string),
id
(string),
provider
(enum: aws, telnyx),
provider_auth
(object),
source_region
(string)
创建数据迁移的源端配置。
POST /storage/migration_sources
— 必填参数:
provider
,
provider_auth
,
bucket_name
可选参数:
id
(string),
source_region
(string)
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "aws",
  "provider_auth": {},
  "bucket_name": "my-bucket"
}' \
  "https://api.telnyx.com/v2/storage/migration_sources"
返回参数:
bucket_name
(string),
id
(string),
provider
(enum: aws, telnyx),
provider_auth
(object),
source_region
(string)

Get a Migration Source

获取迁移源详情

GET /storage/migration_sources/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/storage/migration_sources/550e8400-e29b-41d4-a716-446655440000"
Returns:
bucket_name
(string),
id
(string),
provider
(enum: aws, telnyx),
provider_auth
(object),
source_region
(string)
GET /storage/migration_sources/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/storage/migration_sources/550e8400-e29b-41d4-a716-446655440000"
返回参数:
bucket_name
(string),
id
(string),
provider
(enum: aws, telnyx),
provider_auth
(object),
source_region
(string)

Delete a Migration Source

删除迁移源

DELETE /storage/migration_sources/{id}
bash
curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/storage/migration_sources/550e8400-e29b-41d4-a716-446655440000"
Returns:
bucket_name
(string),
id
(string),
provider
(enum: aws, telnyx),
provider_auth
(object),
source_region
(string)
DELETE /storage/migration_sources/{id}
bash
curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/storage/migration_sources/550e8400-e29b-41d4-a716-446655440000"
返回参数:
bucket_name
(string),
id
(string),
provider
(enum: aws, telnyx),
provider_auth
(object),
source_region
(string)

List all Migrations

列出所有迁移任务

GET /storage/migrations
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/storage/migrations"
Returns:
bytes_migrated
(integer),
bytes_to_migrate
(integer),
created_at
(date-time),
eta
(date-time),
id
(string),
last_copy
(date-time),
refresh
(boolean),
source_id
(string),
speed
(integer),
status
(enum: pending, checking, migrating, complete, error, stopped),
target_bucket_name
(string),
target_region
(string)
GET /storage/migrations
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/storage/migrations"
返回参数:
bytes_migrated
(integer),
bytes_to_migrate
(integer),
created_at
(date-time),
eta
(date-time),
id
(string),
last_copy
(date-time),
refresh
(boolean),
source_id
(string),
speed
(integer),
status
(enum: pending, checking, migrating, complete, error, stopped),
target_bucket_name
(string),
target_region
(string)

Create a Migration

创建迁移任务

Initiate a migration of data from an external provider into Telnyx Cloud Storage. Currently, only S3 is supported.
POST /storage/migrations
— Required:
source_id
,
target_bucket_name
,
target_region
Optional:
bytes_migrated
(integer),
bytes_to_migrate
(integer),
created_at
(date-time),
eta
(date-time),
id
(string),
last_copy
(date-time),
refresh
(boolean),
speed
(integer),
status
(enum: pending, checking, migrating, complete, error, stopped)
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "source_id": "550e8400-e29b-41d4-a716-446655440000",
  "target_bucket_name": "my-target-bucket",
  "target_region": "us-central-1"
}' \
  "https://api.telnyx.com/v2/storage/migrations"
Returns:
bytes_migrated
(integer),
bytes_to_migrate
(integer),
created_at
(date-time),
eta
(date-time),
id
(string),
last_copy
(date-time),
refresh
(boolean),
source_id
(string),
speed
(integer),
status
(enum: pending, checking, migrating, complete, error, stopped),
target_bucket_name
(string),
target_region
(string)
发起从外部服务商到Telnyx云存储的数据迁移任务,目前仅支持S3存储源。
POST /storage/migrations
— 必填参数:
source_id
,
target_bucket_name
,
target_region
可选参数:
bytes_migrated
(integer),
bytes_to_migrate
(integer),
created_at
(date-time),
eta
(date-time),
id
(string),
last_copy
(date-time),
refresh
(boolean),
speed
(integer),
status
(enum: pending, checking, migrating, complete, error, stopped)
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "source_id": "550e8400-e29b-41d4-a716-446655440000",
  "target_bucket_name": "my-target-bucket",
  "target_region": "us-central-1"
}' \
  "https://api.telnyx.com/v2/storage/migrations"
返回参数:
bytes_migrated
(integer),
bytes_to_migrate
(integer),
created_at
(date-time),
eta
(date-time),
id
(string),
last_copy
(date-time),
refresh
(boolean),
source_id
(string),
speed
(integer),
status
(enum: pending, checking, migrating, complete, error, stopped),
target_bucket_name
(string),
target_region
(string)

Get a Migration

获取迁移任务详情

GET /storage/migrations/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/storage/migrations/550e8400-e29b-41d4-a716-446655440000"
Returns:
bytes_migrated
(integer),
bytes_to_migrate
(integer),
created_at
(date-time),
eta
(date-time),
id
(string),
last_copy
(date-time),
refresh
(boolean),
source_id
(string),
speed
(integer),
status
(enum: pending, checking, migrating, complete, error, stopped),
target_bucket_name
(string),
target_region
(string)
GET /storage/migrations/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/storage/migrations/550e8400-e29b-41d4-a716-446655440000"
返回参数:
bytes_migrated
(integer),
bytes_to_migrate
(integer),
created_at
(date-time),
eta
(date-time),
id
(string),
last_copy
(date-time),
refresh
(boolean),
source_id
(string),
speed
(integer),
status
(enum: pending, checking, migrating, complete, error, stopped),
target_bucket_name
(string),
target_region
(string)

Stop a Migration

停止迁移任务

POST /storage/migrations/{id}/actions/stop
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/storage/migrations/550e8400-e29b-41d4-a716-446655440000/actions/stop"
Returns:
bytes_migrated
(integer),
bytes_to_migrate
(integer),
created_at
(date-time),
eta
(date-time),
id
(string),
last_copy
(date-time),
refresh
(boolean),
source_id
(string),
speed
(integer),
status
(enum: pending, checking, migrating, complete, error, stopped),
target_bucket_name
(string),
target_region
(string)
POST /storage/migrations/{id}/actions/stop
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/storage/migrations/550e8400-e29b-41d4-a716-446655440000/actions/stop"
返回参数:
bytes_migrated
(integer),
bytes_to_migrate
(integer),
created_at
(date-time),
eta
(date-time),
id
(string),
last_copy
(date-time),
refresh
(boolean),
source_id
(string),
speed
(integer),
status
(enum: pending, checking, migrating, complete, error, stopped),
target_bucket_name
(string),
target_region
(string)

List Mobile Voice Connections

列出移动语音连接

GET /v2/mobile_voice_connections
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/v2/mobile_voice_connections"
Returns:
active
(boolean),
connection_name
(string),
created_at
(date-time),
id
(string),
inbound
(object),
outbound
(object),
record_type
(enum: mobile_voice_connection),
tags
(array[string]),
updated_at
(date-time),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer | null)
GET /v2/mobile_voice_connections
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/v2/mobile_voice_connections"
返回参数:
active
(boolean),
connection_name
(string),
created_at
(date-time),
id
(string),
inbound
(object),
outbound
(object),
record_type
(enum: mobile_voice_connection),
tags
(array[string]),
updated_at
(date-time),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer | null)

Create a Mobile Voice Connection

创建移动语音连接

POST /v2/mobile_voice_connections
Optional:
active
(boolean),
connection_name
(string),
inbound
(object),
outbound
(object),
tags
(array[string]),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer | null)
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/v2/mobile_voice_connections"
Returns:
active
(boolean),
connection_name
(string),
created_at
(date-time),
id
(string),
inbound
(object),
outbound
(object),
record_type
(enum: mobile_voice_connection),
tags
(array[string]),
updated_at
(date-time),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer | null)
POST /v2/mobile_voice_connections
可选参数:
active
(boolean),
connection_name
(string),
inbound
(object),
outbound
(object),
tags
(array[string]),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer | null)
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/v2/mobile_voice_connections"
返回参数:
active
(boolean),
connection_name
(string),
created_at
(date-time),
id
(string),
inbound
(object),
outbound
(object),
record_type
(enum: mobile_voice_connection),
tags
(array[string]),
updated_at
(date-time),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer | null)

Retrieve a Mobile Voice Connection

检索移动语音连接详情

GET /v2/mobile_voice_connections/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/v2/mobile_voice_connections/550e8400-e29b-41d4-a716-446655440000"
Returns:
active
(boolean),
connection_name
(string),
created_at
(date-time),
id
(string),
inbound
(object),
outbound
(object),
record_type
(enum: mobile_voice_connection),
tags
(array[string]),
updated_at
(date-time),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer | null)
GET /v2/mobile_voice_connections/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/v2/mobile_voice_connections/550e8400-e29b-41d4-a716-446655440000"
返回参数:
active
(boolean),
connection_name
(string),
created_at
(date-time),
id
(string),
inbound
(object),
outbound
(object),
record_type
(enum: mobile_voice_connection),
tags
(array[string]),
updated_at
(date-time),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer | null)

Update a Mobile Voice Connection

更新移动语音连接

PATCH /v2/mobile_voice_connections/{id}
Optional:
active
(boolean),
connection_name
(string),
inbound
(object),
outbound
(object),
tags
(array[string]),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer)
bash
curl \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/v2/mobile_voice_connections/550e8400-e29b-41d4-a716-446655440000"
Returns:
active
(boolean),
connection_name
(string),
created_at
(date-time),
id
(string),
inbound
(object),
outbound
(object),
record_type
(enum: mobile_voice_connection),
tags
(array[string]),
updated_at
(date-time),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer | null)
PATCH /v2/mobile_voice_connections/{id}
可选参数:
active
(boolean),
connection_name
(string),
inbound
(object),
outbound
(object),
tags
(array[string]),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer)
bash
curl \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/v2/mobile_voice_connections/550e8400-e29b-41d4-a716-446655440000"
返回参数:
active
(boolean),
connection_name
(string),
created_at
(date-time),
id
(string),
inbound
(object),
outbound
(object),
record_type
(enum: mobile_voice_connection),
tags
(array[string]),
updated_at
(date-time),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer | null)

Delete a Mobile Voice Connection

删除移动语音连接

DELETE /v2/mobile_voice_connections/{id}
bash
curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/v2/mobile_voice_connections/550e8400-e29b-41d4-a716-446655440000"
Returns:
active
(boolean),
connection_name
(string),
created_at
(date-time),
id
(string),
inbound
(object),
outbound
(object),
record_type
(enum: mobile_voice_connection),
tags
(array[string]),
updated_at
(date-time),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer | null)
DELETE /v2/mobile_voice_connections/{id}
bash
curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/v2/mobile_voice_connections/550e8400-e29b-41d4-a716-446655440000"
返回参数:
active
(boolean),
connection_name
(string),
created_at
(date-time),
id
(string),
inbound
(object),
outbound
(object),
record_type
(enum: mobile_voice_connection),
tags
(array[string]),
updated_at
(date-time),
webhook_api_version
(enum: 1, 2),
webhook_event_failover_url
(string | null),
webhook_event_url
(string | null),
webhook_timeout_secs
(integer | null)

Get all wireless regions

获取所有无线服务区域

Retrieve all wireless regions for the given product.
GET /wireless/regions
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/wireless/regions?product=public_ips"
Returns:
code
(string),
inserted_at
(date-time),
name
(string),
updated_at
(date-time)
获取指定产品支持的所有无线服务区域。
GET /wireless/regions
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/wireless/regions?product=public_ips"
返回参数:
code
(string),
inserted_at
(date-time),
name
(string),
updated_at
(date-time)

Get all possible wireless blocklist values

获取所有无线黑名单可选值

Retrieve all wireless blocklist values for a given blocklist type.
GET /wireless_blocklist_values
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/wireless_blocklist_values?type=country"
Returns:
data
(object),
meta
(object)
获取指定类型的无线黑名单所有可选值。
GET /wireless_blocklist_values
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/wireless_blocklist_values?type=country"
返回参数:
data
(object),
meta
(object)

Get all Wireless Blocklists

获取所有无线访问黑名单

Get all Wireless Blocklists belonging to the user.
GET /wireless_blocklists
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/wireless_blocklists?filter[name]=my private gateway&filter[type]=country&filter[values]=US,CA"
Returns:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
type
(enum: country, mcc, plmn),
updated_at
(string),
values
(array[object])
获取当前用户名下的所有无线访问黑名单。
GET /wireless_blocklists
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/wireless_blocklists?filter[name]=my private gateway&filter[type]=country&filter[values]=US,CA"
返回参数:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
type
(enum: country, mcc, plmn),
updated_at
(string),
values
(array[object])

Create a Wireless Blocklist

创建无线访问黑名单

Create a Wireless Blocklist to prevent SIMs from connecting to certain networks.
POST /wireless_blocklists
— Required:
name
,
type
,
values
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "My Wireless Blocklist",
  "type": "country",
  "values": [
    "CA",
    "US"
  ]
}' \
  "https://api.telnyx.com/v2/wireless_blocklists"
Returns:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
type
(enum: country, mcc, plmn),
updated_at
(string),
values
(array[object])
创建无线访问黑名单,用于阻止SIM卡连接特定网络。
POST /wireless_blocklists
— 必填参数:
name
,
type
,
values
bash
curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "My Wireless Blocklist",
  "type": "country",
  "values": [
    "CA",
    "US"
  ]
}' \
  "https://api.telnyx.com/v2/wireless_blocklists"
返回参数:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
type
(enum: country, mcc, plmn),
updated_at
(string),
values
(array[object])

Update a Wireless Blocklist

更新无线访问黑名单

Update a Wireless Blocklist.
PATCH /wireless_blocklists
Optional:
name
(string),
type
(enum: country, mcc, plmn),
values
(array[object])
bash
curl \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/wireless_blocklists"
Returns:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
type
(enum: country, mcc, plmn),
updated_at
(string),
values
(array[object])
更新指定的无线访问黑名单。
PATCH /wireless_blocklists
可选参数:
name
(string),
type
(enum: country, mcc, plmn),
values
(array[object])
bash
curl \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/wireless_blocklists"
返回参数:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
type
(enum: country, mcc, plmn),
updated_at
(string),
values
(array[object])

Get a Wireless Blocklist

获取无线访问黑名单详情

Retrieve information about a Wireless Blocklist.
GET /wireless_blocklists/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/wireless_blocklists/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
type
(enum: country, mcc, plmn),
updated_at
(string),
values
(array[object])
获取指定无线访问黑名单的信息。
GET /wireless_blocklists/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/wireless_blocklists/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
type
(enum: country, mcc, plmn),
updated_at
(string),
values
(array[object])

Delete a Wireless Blocklist

删除无线访问黑名单

Deletes the Wireless Blocklist.
DELETE /wireless_blocklists/{id}
bash
curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/wireless_blocklists/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Returns:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
type
(enum: country, mcc, plmn),
updated_at
(string),
values
(array[object])
删除指定的无线访问黑名单。
DELETE /wireless_blocklists/{id}
bash
curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/wireless_blocklists/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
返回参数:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
type
(enum: country, mcc, plmn),
updated_at
(string),
values
(array[object])