Tunnel
Routes
Routes endpoint reference.
List
Lists and filters private network routes in an account.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account identifier. | |
params | array | No | [] | Array containing the necessary params. |
php
$response = $client->tunnel()->routes()->list('ACCOUNT_ID', []);
Get By IP
Fetches routes that contain the given IP address.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account identifier. | |
ip | string | Yes | IP | |
virtualNetworkId | string|null | No | UUID of the virtual network. |
php
$response = $client->tunnel()->routes()->getByIP('ACCOUNT_ID', 'IP', 'VIRTUAL_NETWORK_ID');
Create
Routes a private network through a Cloudflare Tunnel.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account identifier. | |
network | string | Yes | The private IPv4 or IPv6 range connected by the route, in CIDR notation. | |
virtualNetworkId | string|null | No | UUID of the virtual network. | |
comment | string|null | No | Optional remark describing the route. |
php
$response = $client->tunnel()->routes()->create('ACCOUNT_ID', 'NETWORK', 'VIRTUAL_NETWORK_ID', 'COMMENT');
Get
Get a private network route in an account.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account identifier. | |
routeId | string | Yes | UUID of the route. |
php
$response = $client->tunnel()->routes()->get('ACCOUNT_ID', 'ROUTE_ID');
Edit
Updates an existing private network route in an account.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account identifier. | |
routeId | string | Yes | UUID of the route. | |
values | array | No | [] | The fields that are meant to be updated |
php
$response = $client->tunnel()->routes()->edit('ACCOUNT_ID', 'ROUTE_ID', []);
Delete
Deletes a private network route from an account.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account identifier. | |
routeId | string | Yes | UUID of the route. |
php
$response = $client->tunnel()->routes()->delete('ACCOUNT_ID', 'ROUTE_ID');

