api/go/telnyx-iot-go/SKILL.md
Manage IoT SIM cards, eSIMs, data plans, and wireless connectivity. Use when building IoT/M2M solutions. This skill provides Go SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-iot-goInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
go get github.com/team-telnyx/telnyx-go
import (
"context"
"fmt"
"os"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
client := telnyx.NewClient(
option.WithAPIKey(os.Getenv("TELNYX_API_KEY")),
)
All examples below assume client is already initialized as shown above.
Retrieve all wireless regions for the given product.
GET /wireless/regions
response, err := client.Wireless.GetRegions(context.TODO(), telnyx.WirelessGetRegionsParams{
Product: "public_ips",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
Get all SIM cards belonging to the user that match the given filters.
GET /sim_cards
page, err := client.SimCards.List(context.TODO(), telnyx.SimCardListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Returns the details regarding a specific SIM card.
GET /sim_cards/{id}
simCard, err := client.SimCards.Get(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.SimCardGetParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCard.Data)
Updates SIM card data
PATCH /sim_cards/{id}
simCard, err := client.SimCards.Update(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.SimCardUpdateParams{
SimCard: telnyx.SimCardParam{},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCard.Data)
The SIM card will be decommissioned, removed from your account and you will stop being charged.<br />The SIM card won't be able to connect to the network after the deletion is completed, thus makin...
DELETE /sim_cards/{id}
simCard, err := client.SimCards.Delete(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.SimCardDeleteParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCard.Data)
It returns the activation code for an eSIM.<br/><br/> This API is only available for eSIMs.
GET /sim_cards/{id}/activation_code
response, err := client.SimCards.GetActivationCode(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
It returns the device details where a SIM card is currently being used.
GET /sim_cards/{id}/device_details
response, err := client.SimCards.GetDeviceDetails(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
It returns the public IP requested for a SIM card.
GET /sim_cards/{id}/public_ip
response, err := client.SimCards.GetPublicIP(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
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
page, err := client.SimCards.ListWirelessConnectivityLogs(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.SimCardListWirelessConnectivityLogsParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
This API disables a SIM card, disconnecting it from the network and making it impossible to consume data.<br/> The API will trigger an asynchronous operation called a SIM Card Action.
POST /sim_cards/{id}/actions/disable
response, err := client.SimCards.Actions.Disable(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
This API enables a SIM card, connecting it to the network and making it possible to consume data.<br/> To enable a SIM card, it must be associated with a SIM card group.<br/> The API will trigger a...
POST /sim_cards/{id}/actions/enable
response, err := client.SimCards.Actions.Enable(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
This API removes an existing public IP from a SIM card.
POST /sim_cards/{id}/actions/remove_public_ip
response, err := client.SimCards.Actions.RemovePublicIP(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
This API makes a SIM card reachable on the public internet by mapping a random public IP to the SIM card.
POST /sim_cards/{id}/actions/set_public_ip
response, err := client.SimCards.Actions.SetPublicIP(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.SimCardActionSetPublicIPParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
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.<br/> To set a SIM card to standby, it must be ...
POST /sim_cards/{id}/actions/set_standby
response, err := client.SimCards.Actions.SetStandby(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
This API triggers an asynchronous operation to set a public IP for each of the specified SIM cards.<br/> For each SIM Card a SIM Card Action will be generated.
POST /sim_cards/actions/bulk_set_public_ips — Required: sim_card_ids
response, err := client.SimCards.Actions.BulkSetPublicIPs(context.TODO(), telnyx.SimCardActionBulkSetPublicIPsParams{
SimCardIDs: []string{"6b14e151-8493-4fa1-8664-1cc4e6d14158"},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
It validates whether SIM card registration codes are valid or not.
POST /sim_cards/actions/validate_registration_codes
response, err := client.SimCards.Actions.ValidateRegistrationCodes(context.TODO(), telnyx.SimCardActionValidateRegistrationCodesParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
This API lists a paginated collection of SIM card actions.
GET /sim_card_actions
page, err := client.SimCards.Actions.List(context.TODO(), telnyx.SimCardActionListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
This API fetches detailed information about a SIM card action to follow-up on an existing asynchronous operation.
GET /sim_card_actions/{id}
action, err := client.SimCards.Actions.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", action.Data)
This API lists a paginated collection of bulk SIM card actions.
GET /bulk_sim_card_actions
page, err := client.BulkSimCardActions.List(context.TODO(), telnyx.BulkSimCardActionListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
This API fetches information about a bulk SIM card action.
GET /bulk_sim_card_actions/{id}
bulkSimCardAction, err := client.BulkSimCardActions.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", bulkSimCardAction.Data)
Get all SIM card groups belonging to the user that match the given filters.
GET /sim_card_groups
page, err := client.SimCardGroups.List(context.TODO(), telnyx.SimCardGroupListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Creates a new SIM card group object
POST /sim_card_groups — Required: name
simCardGroup, err := client.SimCardGroups.New(context.TODO(), telnyx.SimCardGroupNewParams{
Name: "My Test Group",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCardGroup.Data)
Returns the details regarding a specific SIM card group
GET /sim_card_groups/{id}
simCardGroup, err := client.SimCardGroups.Get(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.SimCardGroupGetParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCardGroup.Data)
Updates a SIM card group
PATCH /sim_card_groups/{id}
simCardGroup, err := client.SimCardGroups.Update(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.SimCardGroupUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCardGroup.Data)
Permanently deletes a SIM card group
DELETE /sim_card_groups/{id}
simCardGroup, err := client.SimCardGroups.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCardGroup.Data)
This action will asynchronously remove an existing Private Wireless Gateway definition from a SIM card group.
POST /sim_card_groups/{id}/actions/remove_private_wireless_gateway
response, err := client.SimCardGroups.Actions.RemovePrivateWirelessGateway(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
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
response, err := client.SimCardGroups.Actions.RemoveWirelessBlocklist(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
This action will asynchronously assign a provisioned Private Wireless Gateway to the SIM card group.
POST /sim_card_groups/{id}/actions/set_private_wireless_gateway — Required: private_wireless_gateway_id
response, err := client.SimCardGroups.Actions.SetPrivateWirelessGateway(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.SimCardGroupActionSetPrivateWirelessGatewayParams{
PrivateWirelessGatewayID: "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
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
response, err := client.SimCardGroups.Actions.SetWirelessBlocklist(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.SimCardGroupActionSetWirelessBlocklistParams{
WirelessBlocklistID: "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
This API allows listing a paginated collection a SIM card group actions.
GET /sim_card_group_actions
page, err := client.SimCardGroups.Actions.List(context.TODO(), telnyx.SimCardGroupActionListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
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}
action, err := client.SimCardGroups.Actions.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", action.Data)
Get all SIM card orders according to filters.
GET /sim_card_orders
page, err := client.SimCardOrders.List(context.TODO(), telnyx.SimCardOrderListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Creates a new order for SIM cards.
POST /sim_card_orders — Required: address_id, quantity
simCardOrder, err := client.SimCardOrders.New(context.TODO(), telnyx.SimCardOrderNewParams{
AddressID: "1293384261075731499",
Quantity: 23,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCardOrder.Data)
Get a single SIM card order by its ID.
GET /sim_card_orders/{id}
simCardOrder, err := client.SimCardOrders.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCardOrder.Data)
Preview SIM card order purchases.
POST /sim_card_order_preview — Required: quantity, address_id
response, err := client.SimCardOrderPreview.Preview(context.TODO(), telnyx.SimCardOrderPreviewPreviewParams{
AddressID: "1293384261075731499",
Quantity: 21,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
Lists a paginated collection of SIM card data usage notifications.
GET /sim_card_data_usage_notifications
page, err := client.SimCardDataUsageNotifications.List(context.TODO(), telnyx.SimCardDataUsageNotificationListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Creates a new SIM card data usage notification.
POST /sim_card_data_usage_notifications — Required: sim_card_id, threshold
simCardDataUsageNotification, err := client.SimCardDataUsageNotifications.New(context.TODO(), telnyx.SimCardDataUsageNotificationNewParams{
SimCardID: "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
Threshold: telnyx.SimCardDataUsageNotificationNewParamsThreshold{},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCardDataUsageNotification.Data)
Get a single SIM Card Data Usage Notification.
GET /sim_card_data_usage_notifications/{id}
simCardDataUsageNotification, err := client.SimCardDataUsageNotifications.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCardDataUsageNotification.Data)
Updates information for a SIM Card Data Usage Notification.
PATCH /sim_card_data_usage_notifications/{id}
simCardDataUsageNotification, err := client.SimCardDataUsageNotifications.Update(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.SimCardDataUsageNotificationUpdateParams{
SimCardDataUsageNotification: telnyx.SimCardDataUsageNotificationParam{},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCardDataUsageNotification.Data)
Delete the SIM Card Data Usage Notification.
DELETE /sim_card_data_usage_notifications/{id}
simCardDataUsageNotification, err := client.SimCardDataUsageNotifications.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCardDataUsageNotification.Data)
Purchases and registers the specified amount of eSIMs to the current user's account.<br/><br/> If <code>sim_card_group_id</code> is provided, the eSIMs will be associated with that group.
POST /actions/purchase/esims — Required: amount
purchase, err := client.Actions.Purchase.New(context.TODO(), telnyx.ActionPurchaseNewParams{
Amount: 10,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", purchase.Data)
Register the SIM cards associated with the provided registration codes to the current user's account.<br/><br/> If <code>sim_card_group_id</code> is provided, the SIM cards will be associated with ...
POST /actions/register/sim_cards — Required: registration_codes
register, err := client.Actions.Register.New(context.TODO(), telnyx.ActionRegisterNewParams{
RegistrationCodes: []string{"0000000001", "0000000002", "0000000003"},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", register.Data)
GET /ota_updates
page, err := client.OtaUpdates.List(context.TODO(), telnyx.OtaUpdateListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
This API returns the details of an Over the Air (OTA) update.
GET /ota_updates/{id}
otaUpdate, err := client.OtaUpdates.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", otaUpdate.Data)
Get all Private Wireless Gateways belonging to the user.
GET /private_wireless_gateways
page, err := client.PrivateWirelessGateways.List(context.TODO(), telnyx.PrivateWirelessGatewayListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Asynchronously create a Private Wireless Gateway for SIM cards for a previously created network.
POST /private_wireless_gateways — Required: network_id, name
privateWirelessGateway, err := client.PrivateWirelessGateways.New(context.TODO(), telnyx.PrivateWirelessGatewayNewParams{
Name: "My private wireless gateway",
NetworkID: "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", privateWirelessGateway.Data)
Retrieve information about a Private Wireless Gateway.
GET /private_wireless_gateways/{id}
privateWirelessGateway, err := client.PrivateWirelessGateways.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", privateWirelessGateway.Data)
Deletes the Private Wireless Gateway.
DELETE /private_wireless_gateways/{id}
privateWirelessGateway, err := client.PrivateWirelessGateways.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", privateWirelessGateway.Data)
Get all Wireless Blocklists belonging to the user.
GET /wireless_blocklists
page, err := client.WirelessBlocklists.List(context.TODO(), telnyx.WirelessBlocklistListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a Wireless Blocklist to prevent SIMs from connecting to certain networks.
POST /wireless_blocklists — Required: name, type, values
wirelessBlocklist, err := client.WirelessBlocklists.New(context.TODO(), telnyx.WirelessBlocklistNewParams{
Name: "My Wireless Blocklist",
Type: telnyx.WirelessBlocklistNewParamsTypeCountry,
Values: []string{"CA", "US"},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wirelessBlocklist.Data)
Update a Wireless Blocklist.
PATCH /wireless_blocklists
wirelessBlocklist, err := client.WirelessBlocklists.Update(context.TODO(), telnyx.WirelessBlocklistUpdateParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wirelessBlocklist.Data)
Retrieve information about a Wireless Blocklist.
GET /wireless_blocklists/{id}
wirelessBlocklist, err := client.WirelessBlocklists.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wirelessBlocklist.Data)
Deletes the Wireless Blocklist.
DELETE /wireless_blocklists/{id}
wirelessBlocklist, err := client.WirelessBlocklists.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wirelessBlocklist.Data)
Retrieve all wireless blocklist values for a given blocklist type.
GET /wireless_blocklist_values
wirelessBlocklistValues, err := client.WirelessBlocklistValues.List(context.TODO(), telnyx.WirelessBlocklistValueListParams{
Type: telnyx.WirelessBlocklistValueListParamsTypeCountry,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wirelessBlocklistValues.Data)
tools
Build cross-platform VoIP calling apps with React Native using Telnyx Voice SDK. High-level reactive API with automatic lifecycle management, CallKit/ConnectionService integration, and push notifications. Use for mobile VoIP apps with minimal setup.
tools
Build browser-based VoIP calling apps using Telnyx WebRTC JavaScript SDK. Covers authentication, voice calls, events, debugging, call quality metrics, and AI Agent integration. Use for web-based real-time communication.
tools
Build VoIP calling apps on iOS using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, CallKit integration, PushKit/APNS push notifications, call quality metrics, and AI Agent integration. Use when implementing real-time voice communication on iOS.
tools
Build cross-platform VoIP calling apps with Flutter using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, push notifications (FCM + APNS), call quality metrics, and AI Agent integration. Works on Android, iOS, and Web.