PHP Client for Cloudflare API
Tunnel

Virtual Networks

Virtual Networks endpoint reference.

List

Lists and filters virtual networks in an account.

ParamTypeRequiredDefaultDescription
accountIdstringYesAccount identifier.
paramsarrayNo[]Array containing the necessary params.
php
$response = $client->tunnel()->virtualNetworks()->list('ACCOUNT_ID', []);
View this operation on the Cloudflare API Reference

Create

Adds a new virtual network to an account.

ParamTypeRequiredDefaultDescription
accountIdstringYesAccount identifier.
namestringYesA user-friendly name for the virtual network.
isDefaultboolNofalseIf `true`, this virtual network is the default for the account.
commentstring|nullNoOptional remark describing the virtual network.
php
$response = $client->tunnel()->virtualNetworks()->create('ACCOUNT_ID', 'NAME', true, 'COMMENT');
View this operation on the Cloudflare API Reference

Get

Get a virtual network.

ParamTypeRequiredDefaultDescription
accountIdstringYesAccount identifier.
virtualNetworkIdstringYesUUID of the virtual network.
php
$response = $client->tunnel()->virtualNetworks()->get('ACCOUNT_ID', 'VIRTUAL_NETWORK_ID');
View this operation on the Cloudflare API Reference

Edit

Updates an existing virtual network.

ParamTypeRequiredDefaultDescription
accountIdstringYesAccount identifier.
virtualNetworkIdstringYesUUID of the virtual network.
valuesarrayNo[]he fields that are meant to be updated
php
$response = $client->tunnel()->virtualNetworks()->edit('ACCOUNT_ID', 'VIRTUAL_NETWORK_ID', []);
View this operation on the Cloudflare API Reference

Delete

Deletes an existing virtual network.

ParamTypeRequiredDefaultDescription
accountIdstringYesAccount identifier.
virtualNetworkIdstringYesUUID of the virtual network.
php
$response = $client->tunnel()->virtualNetworks()->delete('ACCOUNT_ID', 'VIRTUAL_NETWORK_ID');
View this operation on the Cloudflare API Reference
Copyright © 2026