WorkerWorker Script

Upload Worker Module

PUT
Upload a worker module.

Path parameters

script_namestringRequired
Name of the script, used in URLs and route configuration.
account_identifierstringRequired
Identifier

Query parameters

rollback_tostringOptional

Rollback to provided deployment based on deployment ID. Request body will only parse a “message” part. You can learn more about deployments [here](https: //developers.cloudflare.com/workers/platform/deployments/).

Request

This endpoint expects an object.

Response

This endpoint returns an object
result
objectOptional
PUT
1curl -X PUT "https://api.cloudflare.com/client/v4/accounts/:account_identifier/workers/scripts/:script_name?rollback_to=string" \
2 -H "X-Auth-Key: string" \
3 -H "X-Auth-User-Service-Key: string" \
4 -H "Authorization: Bearer <token>" \
5 -H "Content-Type: application/json" \
6 -d '{}'
200Updated
1{
2 "result": {
3 "created_on": "2023-01-01T00:00:00Z",
4 "etag": "string",
5 "id": "string",
6 "logpush": true,
7 "modified_on": "2023-01-01T00:00:00Z",
8 "pipeline_hash": "string",
9 "placement_mode": "string",
10 "tail_consumers": [
11 {
12 "service": "string",
13 "environment": "string",
14 "namespace": "string"
15 }
16 ],
17 "usage_model": "string"
18 }
19}