Workers
Deployments
Deployments endpoint reference.
List
List of Worker Deployments. The first deployment in the list is the latest deployment actively serving traffic.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account identifier. | |
scriptName | string | Yes | Name of the script, used in URLs and route configuration. |
php
$response = $client->workers()->deployments()->list('ACCOUNT_ID', 'SCRIPT_NAME');
Create
Deployments configure how [Worker Versions](https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/deployments/methods/create/ are deployed to traffic. A deployment can consist of one or two versions of a Worker.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account identifier. | |
scriptName | string | Yes | Name of the script, used in URLs and route configuration. | |
values | Deployment|array | Yes | Dployment config. | |
force | bool | No | false | If set to true, the deployment will be created even if normally blocked by something such rolling back to an older version when a secret has changed. |
php
$response = $client->workers()->deployments()->create('ACCOUNT_ID', 'SCRIPT_NAME', $values, true);

