Routes
Cloudflare API docsList
Returns routes for a zone.
php
$response = $client->workers()->routes()->get('zone_id');
Create
Creates a route that maps a URL pattern to a Worker.
php
$response = $client->workers()->routes()->create('zone_id', [
'pattern' => 'example.net/*',
'script' => 'this-is_my_script-01'
]);
Get
Returns information about a route, including URL pattern and Worker.
php
$response = $client->workers()->routes()->details('zone_id', 'route_id');
Update
Updates the URL pattern or Worker associated with a route.
php
$response = $client->workers()->routes()->update('zone_id', 'route_id', [
'pattern' => 'example.net/*',
'script' => 'this-is_my_script-01'
]);
Delete
Deletes a route.
php
$response = $client->workers()->routes()->delete('zone_id', 'route_id');