PUT /accounts/{account_id}/workers/workers/{worker_id}
Perform a complete replacement of a Worker, where omitted properties are set to their default values. This is the exact same as the Create Worker endpoint, but operates on an existing Worker. To perform a partial update instead, use the Edit Worker endpoint.
Servers
- https://api.cloudflare.com/client/v4
Path parameters
Name | Type | Required | Description |
---|---|---|---|
worker_id |
String | Yes | |
account_id |
String | Yes |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
id |
String | Yes |
Immutable ID of the Worker. |
references |
Object | Yes |
Other resources that reference the Worker and depend on it existing. |
references.domains[] |
Array | Yes |
Custom domains connected to the Worker. |
references.domains[].id |
String | Yes |
ID of the custom domain. |
references.domains[].zone_name |
String | Yes |
Name of the zone. |
references.domains[].hostname |
String | Yes |
Full hostname of the custom domain, including the zone name. |
references.domains[].certificate_id |
String | Yes |
ID of the TLS certificate issued for the custom domain. |
references.domains[].zone_id |
String | Yes |
ID of the zone. |
references.workers[] |
Array | Yes |
Other Workers that reference the Worker using service bindings. |
references.workers[].id |
String | Yes |
ID of the referencing Worker. |
references.workers[].name |
String | Yes |
Name of the referencing Worker. |
references.durable_objects[] |
Array | Yes |
Other Workers that reference Durable Object classes implemented by the Worker. |
references.durable_objects[].worker_id |
String | Yes |
ID of the Worker using the Durable Object implementation. |
references.durable_objects[].namespace_name |
String | Yes |
Name of the Durable Object namespace being used. |
references.durable_objects[].worker_name |
String | Yes |
Name of the Worker using the Durable Object implementation. |
references.durable_objects[].namespace_id |
String | Yes |
ID of the Durable Object namespace being used. |
references.queues[] |
Array | Yes |
Queues that send messages to the Worker. |
references.queues[].queue_name |
String | Yes |
Name of the queue. |
references.queues[].queue_id |
String | Yes |
ID of the queue. |
references.queues[].queue_consumer_id |
String | Yes |
ID of the queue consumer configuration. |
references.dispatch_namespace_outbounds[] |
Array | Yes |
Other Workers that reference the Worker as an outbound for a dispatch namespace. |
references.dispatch_namespace_outbounds[].worker_id |
String | Yes |
ID of the Worker using the dispatch namespace. |
references.dispatch_namespace_outbounds[].namespace_name |
String | Yes |
Name of the dispatch namespace. |
references.dispatch_namespace_outbounds[].worker_name |
String | Yes |
Name of the Worker using the dispatch namespace. |
references.dispatch_namespace_outbounds[].namespace_id |
String | Yes |
ID of the dispatch namespace. |
name |
String | Yes |
Name of the Worker. |
subdomain |
Object | Yes |
Subdomain settings for the Worker. |
subdomain.previews_enabled |
Boolean | No |
Whether preview URLs are enabled for the Worker. Default value: false |
subdomain.enabled |
Boolean | No |
Whether the *.workers.dev subdomain is enabled for the Worker. Default value: false |
tail_consumers[] |
Array | Yes |
Other Workers that should consume logs from the Worker. |
tail_consumers[].name |
String | Yes |
Name of the consumer Worker. |
created_on |
String | Yes |
When the Worker was created. |
logpush |
Boolean | Yes |
Whether logpush is enabled for the Worker. Default value: false |
tags[] |
Array | Yes |
Tags associated with the Worker. |
observability |
Object | Yes |
Observability settings for the Worker. |
observability.head_sampling_rate |
Number | No |
The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%). Default value: 1 |
observability.logs |
Object | No |
Log settings for the Worker. |
observability.logs.head_sampling_rate |
Number | No |
The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default value: 1 |
observability.logs.enabled |
Boolean | No |
Whether logs are enabled for the Worker. Default value: false |
observability.logs.invocation_logs |
Boolean | No |
Whether invocation logs are enabled for the Worker. Default value: true |
observability.enabled |
Boolean | No |
Whether observability is enabled for the Worker. Default value: false |
updated_on |
String | Yes |
When the Worker was most recently updated. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.