Networks API

Network operations API

List all Networks

List all Networks.

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[name]
string

The network name to filter on.

Example: filter[name]=test network
Responses
200

Successful response

Response Schema: application/json
Array of objects (Network)
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/networks
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.Network.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": "network",
      • "updated_at": "2018-02-02T22:25:27.521Z",
      • "name": "test network"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Create a Network

Create a new Network.

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

A user specified name for the network.

Responses
200

Successful response

Response Schema: application/json
object (Network)
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 network.

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/networks
Request samples
application/json
{
  • "name": "test network"
}
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "network",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "name": "test network"
    }
}

Delete a Network

Delete a Network.

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 (Network)
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 network.

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/networks/{id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

res = telnyx.Network.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": "network",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "name": "test network"
    }
}

Retrieve a Network

Retrieve a Network.

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 (Network)
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 network.

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/networks/{id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.Network.retrieve("id")
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "network",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "name": "test network"
    }
}

Update a Network

Update a Network.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

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

A user specified name for the network.

Responses
200

Successful response

Response Schema: application/json
object (Network)
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 network.

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/networks/{id}
Request samples
application/json
{
  • "name": "test network"
}
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "network",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "name": "test network"
    }
}

List all Interfaces for a Network.

List all Interfaces for a Network.

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

filter[name]
string

The interface name to filter on.

Example: filter[name]=test interface
filter[type]
string

The interface type to filter on.

Example: filter[type]=wireguard_interface
filter[status]
string (InterfaceStatus)

The interface status to filter on.

Enum: "created" "provisioning" "provisioned" "deleting"
Example: filter[status]=provisioned
Responses
200

Successful response

Response Schema: application/json
Array of objects (NetworkInterface)
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/networks/{id}/network_interfaces
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.Networks.retrieve_network_interface.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": "network_interface",
      • "updated_at": "2018-02-02T22:25:27.521Z",
      • "name": "test interface",
      • "network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
      • "status": "provisioned",
      • "region": {
        • "code": "ashburn-va",
        • "name": "Ashburn",
        • "record_type": "region"
        },
      • "region_code": "ashburn-va",
      • "type": "wireguard_interface"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}