PHP Client for Cloudflare API
Workers

Routes

Routes endpoint reference.

List

Returns routes for a zone.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone identifier.
paramsarrayNo[]
php
$response = $client->workers()->routes()->list('ZONE_ID', []);
View this operation on the Cloudflare API Reference

Create

Creates a route that maps a URL pattern to a Worker.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone identifier.
valuesarrayYesValues.
php
$response = $client->workers()->routes()->create('ZONE_ID', []);
View this operation on the Cloudflare API Reference

Get

Returns information about a route, including URL pattern and Worker.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone identifier.
routeIdstringYesRoute Identifier.
php
$response = $client->workers()->routes()->get('ZONE_ID', 'ROUTE_ID');
View this operation on the Cloudflare API Reference

Update

Updates the URL pattern or Worker associated with a route.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone identifier.
routeIdstringYesRoute Identifier.
valuesarrayYesValues.
php
$response = $client->workers()->routes()->update('ZONE_ID', 'ROUTE_ID', []);
View this operation on the Cloudflare API Reference

Delete

Deletes a route.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone identifier.
routeIdstringYesRoute Identifier.
php
$response = $client->workers()->routes()->delete('ZONE_ID', 'ROUTE_ID');
View this operation on the Cloudflare API Reference
Copyright © 2026