api/go/telnyx-networking-go/SKILL.md
Configure private networks, WireGuard VPN gateways, internet gateways, and virtual cross connects. This skill provides Go SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-networking-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.
List all regions and the interfaces that region supports
GET /regions
regions, err := client.Regions.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", regions.Data)
List all Networks.
GET /networks
page, err := client.Networks.List(context.TODO(), telnyx.NetworkListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a new Network.
POST /networks
network, err := client.Networks.New(context.TODO(), telnyx.NetworkNewParams{
NetworkCreate: telnyx.NetworkCreateParam{
RecordParam: telnyx.RecordParam{},
Name: "test network",
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", network.Data)
Retrieve a Network.
GET /networks/{id}
network, err := client.Networks.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", network.Data)
Update a Network.
PATCH /networks/{id}
network, err := client.Networks.Update(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.NetworkUpdateParams{
NetworkCreate: telnyx.NetworkCreateParam{
RecordParam: telnyx.RecordParam{},
Name: "test network",
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", network.Data)
Delete a Network.
DELETE /networks/{id}
network, err := client.Networks.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", network.Data)
GET /networks/{id}/default_gateway
defaultGateway, err := client.Networks.DefaultGateway.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", defaultGateway.Data)
POST /networks/{id}/default_gateway
defaultGateway, err := client.Networks.DefaultGateway.New(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.NetworkDefaultGatewayNewParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", defaultGateway.Data)
DELETE /networks/{id}/default_gateway
defaultGateway, err := client.Networks.DefaultGateway.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", defaultGateway.Data)
GET /networks/{id}/network_interfaces
page, err := client.Networks.ListInterfaces(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.NetworkListInterfacesParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
List all WireGuard Interfaces.
GET /wireguard_interfaces
page, err := client.WireguardInterfaces.List(context.TODO(), telnyx.WireguardInterfaceListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a new WireGuard Interface.
POST /wireguard_interfaces
wireguardInterface, err := client.WireguardInterfaces.New(context.TODO(), telnyx.WireguardInterfaceNewParams{
RegionCode: "ashburn-va",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wireguardInterface.Data)
Retrieve a WireGuard Interfaces.
GET /wireguard_interfaces/{id}
wireguardInterface, err := client.WireguardInterfaces.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wireguardInterface.Data)
Delete a WireGuard Interface.
DELETE /wireguard_interfaces/{id}
wireguardInterface, err := client.WireguardInterfaces.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wireguardInterface.Data)
List all WireGuard peers.
GET /wireguard_peers
page, err := client.WireguardPeers.List(context.TODO(), telnyx.WireguardPeerListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a new WireGuard Peer.
POST /wireguard_peers
wireguardPeer, err := client.WireguardPeers.New(context.TODO(), telnyx.WireguardPeerNewParams{
WireguardInterfaceID: "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wireguardPeer.Data)
Retrieve the WireGuard peer.
GET /wireguard_peers/{id}
wireguardPeer, err := client.WireguardPeers.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wireguardPeer.Data)
Update the WireGuard peer.
PATCH /wireguard_peers/{id}
wireguardPeer, err := client.WireguardPeers.Update(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.WireguardPeerUpdateParams{
WireguardPeerPatch: telnyx.WireguardPeerPatchParam{},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wireguardPeer.Data)
Delete the WireGuard peer.
DELETE /wireguard_peers/{id}
wireguardPeer, err := client.WireguardPeers.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wireguardPeer.Data)
GET /wireguard_peers/{id}/config
response, err := client.WireguardPeers.GetConfig(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
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)
List all Public Internet Gateways.
GET /public_internet_gateways
page, err := client.PublicInternetGateways.List(context.TODO(), telnyx.PublicInternetGatewayListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a new Public Internet Gateway.
POST /public_internet_gateways
publicInternetGateway, err := client.PublicInternetGateways.New(context.TODO(), telnyx.PublicInternetGatewayNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", publicInternetGateway.Data)
Retrieve a Public Internet Gateway.
GET /public_internet_gateways/{id}
publicInternetGateway, err := client.PublicInternetGateways.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", publicInternetGateway.Data)
Delete a Public Internet Gateway.
DELETE /public_internet_gateways/{id}
publicInternetGateway, err := client.PublicInternetGateways.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", publicInternetGateway.Data)
List all Virtual Cross Connects.
GET /virtual_cross_connects
page, err := client.VirtualCrossConnects.List(context.TODO(), telnyx.VirtualCrossConnectListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a new Virtual Cross Connect.<br /><br />For AWS and GCE, you have the option of creating the primary connection first and the secondary connection later.
POST /virtual_cross_connects
virtualCrossConnect, err := client.VirtualCrossConnects.New(context.TODO(), telnyx.VirtualCrossConnectNewParams{
RegionCode: "ashburn-va",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", virtualCrossConnect.Data)
Retrieve a Virtual Cross Connect.
GET /virtual_cross_connects/{id}
virtualCrossConnect, err := client.VirtualCrossConnects.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", virtualCrossConnect.Data)
Update the Virtual Cross Connect.<br /><br />Cloud IPs can only be patched during the created state, as GCE will only inform you of your generated IP once the pending connection requested has bee...
PATCH /virtual_cross_connects/{id}
virtualCrossConnect, err := client.VirtualCrossConnects.Update(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.VirtualCrossConnectUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", virtualCrossConnect.Data)
Delete a Virtual Cross Connect.
DELETE /virtual_cross_connects/{id}
virtualCrossConnect, err := client.VirtualCrossConnects.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", virtualCrossConnect.Data)
List Virtual Cross Connects Cloud Coverage.<br /><br />This endpoint shows which cloud regions are available for the location_code your Virtual Cross Connect will be provisioned in.
GET /virtual_cross_connects/coverage
page, err := client.VirtualCrossConnectsCoverage.List(context.TODO(), telnyx.VirtualCrossConnectsCoverageListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
List all Global IPs.
GET /global_ips
page, err := client.GlobalIPs.List(context.TODO(), telnyx.GlobalIPListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a Global IP.
POST /global_ips
globalIP, err := client.GlobalIPs.New(context.TODO(), telnyx.GlobalIPNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIP.Data)
Retrieve a Global IP.
GET /global_ips/{id}
globalIP, err := client.GlobalIPs.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIP.Data)
Delete a Global IP.
DELETE /global_ips/{id}
globalIP, err := client.GlobalIPs.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIP.Data)
GET /global_ip_allowed_ports
globalIPAllowedPorts, err := client.GlobalIPAllowedPorts.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPAllowedPorts.Data)
GET /global_ip_assignment_health
globalIPAssignmentHealth, err := client.GlobalIPAssignmentHealth.Get(context.TODO(), telnyx.GlobalIPAssignmentHealthGetParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPAssignmentHealth.Data)
List all Global IP assignments.
GET /global_ip_assignments
page, err := client.GlobalIPAssignments.List(context.TODO(), telnyx.GlobalIPAssignmentListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a Global IP assignment.
POST /global_ip_assignments
globalIPAssignment, err := client.GlobalIPAssignments.New(context.TODO(), telnyx.GlobalIPAssignmentNewParams{
GlobalIPAssignment: telnyx.GlobalIPAssignmentParam{},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPAssignment.Data)
Retrieve a Global IP assignment.
GET /global_ip_assignments/{id}
globalIPAssignment, err := client.GlobalIPAssignments.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPAssignment.Data)
Update a Global IP assignment.
PATCH /global_ip_assignments/{id}
globalIPAssignment, err := client.GlobalIPAssignments.Update(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.GlobalIPAssignmentUpdateParams{
GlobalIPAssignmentUpdateRequest: telnyx.GlobalIPAssignmentUpdateParamsGlobalIPAssignmentUpdateRequest{
GlobalIPAssignmentParam: telnyx.GlobalIPAssignmentParam{},
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPAssignment.Data)
Delete a Global IP assignment.
DELETE /global_ip_assignments/{id}
globalIPAssignment, err := client.GlobalIPAssignments.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPAssignment.Data)
GET /global_ip_assignments/usage
globalIPAssignmentsUsage, err := client.GlobalIPAssignmentsUsage.Get(context.TODO(), telnyx.GlobalIPAssignmentsUsageGetParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPAssignmentsUsage.Data)
List all Global IP Health check types.
GET /global_ip_health_check_types
globalIPHealthCheckTypes, err := client.GlobalIPHealthCheckTypes.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPHealthCheckTypes.Data)
List all Global IP health checks.
GET /global_ip_health_checks
page, err := client.GlobalIPHealthChecks.List(context.TODO(), telnyx.GlobalIPHealthCheckListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a Global IP health check.
POST /global_ip_health_checks
globalIPHealthCheck, err := client.GlobalIPHealthChecks.New(context.TODO(), telnyx.GlobalIPHealthCheckNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPHealthCheck.Data)
Retrieve a Global IP health check.
GET /global_ip_health_checks/{id}
globalIPHealthCheck, err := client.GlobalIPHealthChecks.Get(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPHealthCheck.Data)
Delete a Global IP health check.
DELETE /global_ip_health_checks/{id}
globalIPHealthCheck, err := client.GlobalIPHealthChecks.Delete(context.TODO(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPHealthCheck.Data)
GET /global_ip_latency
globalIPLatency, err := client.GlobalIPLatency.Get(context.TODO(), telnyx.GlobalIPLatencyGetParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPLatency.Data)
GET /global_ip_protocols
globalIPProtocols, err := client.GlobalIPProtocols.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPProtocols.Data)
GET /global_ip_usage
globalIPUsage, err := client.GlobalIPUsage.Get(context.TODO(), telnyx.GlobalIPUsageGetParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPUsage.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.