PHP Client for Cloudflare API
Workers

Environment

Environment endpoint reference.

Get

Get script content from a worker with an environment

ParamTypeRequiredDefaultDescription
accountIdstringYesAccount identifier.
serviceNamestringYesName of Worker to bind to
environmentNamestringYesEnvironment of the Worker.
php
$response = $client->workers()->environment()->get('ACCOUNT_ID', 'SERVICE_NAME', 'ENVIRONMENT_NAME');
View this operation on the Cloudflare API Reference

Update

Put script content from a worker with an environment

ParamTypeRequiredDefaultDescription
accountIdstringYesAccount identifier.
serviceNamestringYesName of Worker to bind to
environmentNamestringYesEnvironment of the Worker.
php
$response = $client->workers()->environment()->update('ACCOUNT_ID', 'SERVICE_NAME', 'ENVIRONMENT_NAME');
View this operation on the Cloudflare API Reference

Get Settings

Get script settings from a worker with an environment

ParamTypeRequiredDefaultDescription
accountIdstringYesAccount identifier.
serviceNamestringYesName of Worker to bind to
environmentNamestringYesEnvironment of the Worker.
php
$response = $client->workers()->environment()->getSettings('ACCOUNT_ID', 'SERVICE_NAME', 'ENVIRONMENT_NAME');
View this operation on the Cloudflare API Reference

Update Settings

Patch script metadata, such as bindings

ParamTypeRequiredDefaultDescription
accountIdstringYesAccount identifier.
serviceNamestringYesName of Worker to bind to
environmentNamestringYesEnvironment of the Worker.
valuesarrayYesSettings values.
php
$response = $client->workers()->environment()->updateSettings('ACCOUNT_ID', 'SERVICE_NAME', 'ENVIRONMENT_NAME', []);
View this operation on the Cloudflare API Reference
Copyright © 2026