WireGuard Interfaces API

WireGuard Interface operations API

List all WireGuard Interfaces

List all WireGuard Interfaces.

SecuritybearerAuth
Request
query Parameters
page[number]
integer >= 1
Default: 1

The page number to load

page[size]
integer [ 1 .. 250 ]
Default: 20

The size of the page

filter[network_id]
string

The associated network id to filter on.

Example: filter[network_id]=6a09cdc3-8948-47f0-aa62-74ac943d6c58
Responses
200

Successful response

Response Schema: application/json
Array of objects (WireguardInterfaceRead)
object (PaginationMeta)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/wireguard_interfaces
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.WireguardInterface.list(page={"number":1,"size":20})
Response samples
application/json
{
  • "data": [
    • {
      • "created_at": "2018-02-02T22:25:27.521Z",
      • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
      • "record_type": "wireguard_interface",
      • "updated_at": "2018-02-02T22:25:27.521Z",
      • "name": "test interface",
      • "network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
      • "status": "provisioned",
      • "endpoint": "203.0.113.0:51871",
      • "public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
      • "region": {
        • "code": "ashburn-va",
        • "name": "Ashburn",
        • "record_type": "region"
        },
      • "region_code": "ashburn-va"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Create a WireGuard Interface

Create a new WireGuard Interface. Current limitation of 10 interfaces per user can be created.

SecuritybearerAuth
Request
Request Body schema: application/json
required
name
string

A user specified name for the interface.

network_id
required
string <uuid>

The id of the network associated with the interface.

region_code
required
string

The region the interface should be deployed to.

Responses
202

Successful response

Response Schema: application/json
object (WireguardInterfaceRead)
created_at
string

ISO 8601 formatted date-time indicating when the resource was created.

id
string <uuid>

Identifies the resource.

record_type
string

Identifies the type of the resource.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was updated.

name
string

A user specified name for the interface.

network_id
string <uuid>

The id of the network associated with the interface.

status
string (InterfaceStatus)

The current status of the interface deployment.

Enum: "created" "provisioning" "provisioned" "deleting"
endpoint
string

The Telnyx WireGuard peers Peer.endpoint value.

public_key
string

The Telnyx WireGuard peers Peer.PublicKey.

object
region_code
string

The region interface is deployed to.

422

Unprocessable entity. Check the 'detail' field in response for details.

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
post/wireguard_interfaces
Request samples
application/json
{
  • "name": "test interface",
  • "network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  • "region_code": "ashburn-va"
}
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "wireguard_interface",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "name": "test interface",
    • "network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "status": "provisioned",
    • "endpoint": "203.0.113.0:51871",
    • "public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
    • "region": {
      • "code": "ashburn-va",
      • "name": "Ashburn",
      • "record_type": "region"
      },
    • "region_code": "ashburn-va"
    }
}

Delete a WireGuard Interface

Delete a WireGuard Interface.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
Responses
200

Successful response

Response Schema: application/json
object (WireguardInterfaceRead)
created_at
string

ISO 8601 formatted date-time indicating when the resource was created.

id
string <uuid>

Identifies the resource.

record_type
string

Identifies the type of the resource.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was updated.

name
string

A user specified name for the interface.

network_id
string <uuid>

The id of the network associated with the interface.

status
string (InterfaceStatus)

The current status of the interface deployment.

Enum: "created" "provisioning" "provisioned" "deleting"
endpoint
string

The Telnyx WireGuard peers Peer.endpoint value.

public_key
string

The Telnyx WireGuard peers Peer.PublicKey.

object
region_code
string

The region interface is deployed to.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
delete/wireguard_interfaces/{id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

res = telnyx.WireguardInterface.retrieve('id')
res.delete()
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "wireguard_interface",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "name": "test interface",
    • "network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "status": "provisioned",
    • "endpoint": "203.0.113.0:51871",
    • "public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
    • "region": {
      • "code": "ashburn-va",
      • "name": "Ashburn",
      • "record_type": "region"
      },
    • "region_code": "ashburn-va"
    }
}

Retrieve a WireGuard Interfaces

Retrieve a WireGuard Interfaces.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
Responses
200

Successful response

Response Schema: application/json
object (WireguardInterfaceRead)
created_at
string

ISO 8601 formatted date-time indicating when the resource was created.

id
string <uuid>

Identifies the resource.

record_type
string

Identifies the type of the resource.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was updated.

name
string

A user specified name for the interface.

network_id
string <uuid>

The id of the network associated with the interface.

status
string (InterfaceStatus)

The current status of the interface deployment.

Enum: "created" "provisioning" "provisioned" "deleting"
endpoint
string

The Telnyx WireGuard peers Peer.endpoint value.

public_key
string

The Telnyx WireGuard peers Peer.PublicKey.

object
region_code
string

The region interface is deployed to.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/wireguard_interfaces/{id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.WireguardInterface.retrieve("id")
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "wireguard_interface",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "name": "test interface",
    • "network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "status": "provisioned",
    • "endpoint": "203.0.113.0:51871",
    • "public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
    • "region": {
      • "code": "ashburn-va",
      • "name": "Ashburn",
      • "record_type": "region"
      },
    • "region_code": "ashburn-va"
    }
}

Delete the WireGuard Peer

Delete the WireGuard peer.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
Responses
200

Successful response

Response Schema: application/json
object (WireguardPeer)
created_at
string

ISO 8601 formatted date-time indicating when the resource was created.

id
string <uuid>

Identifies the resource.

record_type
string

Identifies the type of the resource.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was updated.

public_key
string

The WireGuard PublicKey.

If you do not provide a Public Key, a new Public and Private key pair will be generated for you.

last_seen
string

ISO 8601 formatted date-time indicating when peer sent traffic last time.

private_key
string

Your WireGuard Interface.PrivateKey.

This attribute is only ever utlised if, on POST, you do NOT provide your own public_key. In which case, a new Public and Private key pair will be generated for you. When your private_key is returned, you must save this immediately as we do not save it within Telnyx. If you lose your Private Key, it can not be recovered.

wireguard_interface_id
string <uuid>

The id of the wireguard interface associated with the peer.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
delete/wireguard_peers/{id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

res = telnyx.WireguardPeer.retrieve('id')
res.delete()
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "wireguard_peer",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
    • "last_seen": "2018-02-02T22:25:27.521Z",
    • "private_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
    • "wireguard_interface_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58"
    }
}

Retrieve the WireGuard Peer

Retrieve the WireGuard peer.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
Responses
200

Successful response

Response Schema: application/json
object (WireguardPeer)
created_at
string

ISO 8601 formatted date-time indicating when the resource was created.

id
string <uuid>

Identifies the resource.

record_type
string

Identifies the type of the resource.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was updated.

public_key
string

The WireGuard PublicKey.

If you do not provide a Public Key, a new Public and Private key pair will be generated for you.

last_seen
string

ISO 8601 formatted date-time indicating when peer sent traffic last time.

private_key
string

Your WireGuard Interface.PrivateKey.

This attribute is only ever utlised if, on POST, you do NOT provide your own public_key. In which case, a new Public and Private key pair will be generated for you. When your private_key is returned, you must save this immediately as we do not save it within Telnyx. If you lose your Private Key, it can not be recovered.

wireguard_interface_id
string <uuid>

The id of the wireguard interface associated with the peer.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/wireguard_peers/{id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.WireguardPeer.retrieve("id")
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "wireguard_peer",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
    • "last_seen": "2018-02-02T22:25:27.521Z",
    • "private_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
    • "wireguard_interface_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58"
    }
}

Update the WireGuard Peer

Update the WireGuard peer.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
Request Body schema: application/json
required
public_key
string

The WireGuard PublicKey.

If you do not provide a Public Key, a new Public and Private key pair will be generated for you.

Responses
200

Successful response

Response Schema: application/json
object (WireguardPeer)
created_at
string

ISO 8601 formatted date-time indicating when the resource was created.

id
string <uuid>

Identifies the resource.

record_type
string

Identifies the type of the resource.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was updated.

public_key
string

The WireGuard PublicKey.

If you do not provide a Public Key, a new Public and Private key pair will be generated for you.

last_seen
string

ISO 8601 formatted date-time indicating when peer sent traffic last time.

private_key
string

Your WireGuard Interface.PrivateKey.

This attribute is only ever utlised if, on POST, you do NOT provide your own public_key. In which case, a new Public and Private key pair will be generated for you. When your private_key is returned, you must save this immediately as we do not save it within Telnyx. If you lose your Private Key, it can not be recovered.

wireguard_interface_id
string <uuid>

The id of the wireguard interface associated with the peer.

422

Unprocessable entity. Check the 'detail' field in response for details.

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
patch/wireguard_peers/{id}
Request samples
application/json
{
  • "public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU="
}
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "wireguard_peer",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
    • "last_seen": "2018-02-02T22:25:27.521Z",
    • "private_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
    • "wireguard_interface_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58"
    }
}

List all Allowed IPs for a WireGuard Peer

List all Allowed IPs for a WireGuard peer.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
query Parameters
page[number]
integer >= 1
Default: 1

The page number to load

page[size]
integer [ 1 .. 250 ]
Default: 20

The size of the page

Responses
200

Successful response

Response Schema: application/json
Array of objects (WireguardPeerAllowedIP)
object (PaginationMeta)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/wireguard_peers/{id}/allowed_ips
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.WireguardPeers.retrieve_allowed_ip.retrieve("id",page={"number":1,"size":20})
Response samples
application/json
{
  • "data": [
    • {
      • "created_at": "2018-02-02T22:25:27.521Z",
      • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
      • "record_type": "wireguard_allowed_ip",
      • "updated_at": "2018-02-02T22:25:27.521Z",
      • "ip_address": "198.51.100.1"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Retrieve the Allowed IP

Retrieve the Allowed IP.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
child_id
required
string <uuid>

Identifies the child resource

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
Responses
200

Successful response

Response Schema: application/json
object (WireguardPeerAllowedIP)
created_at
string

ISO 8601 formatted date-time indicating when the resource was created.

id
string <uuid>

Identifies the resource.

record_type
string

Identifies the type of the resource.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was updated.

ip_address
string

The IP address to add to the Wireguard Interface's AllowedIP list.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/wireguard_peers/{id}/allowed_ips/{child_id}
Request samples
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "wireguard_allowed_ip",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "ip_address": "198.51.100.1"
    }
}

Retrieve Wireguard config template for Peer

Retrieve Wireguard config template for Peer

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
Responses
200

Successful response

Response Schema: text/plain; charset=utf-8
string
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/wireguard_peers/{id}/config
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.WireguardPeers.retrieve_config.retrieve("id")
Response samples
application/json
{
  • "errors": [
    • {
      • "code": "string",
      • "detail": "string",
      • "meta": { },
      • "source": {
        • "parameter": "string",
        • "pointer": "/json/pointer"
        },
      • "title": "string"
      }
    ]
}