{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"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.","properties":{"path":{"type":"object","properties":{"account_id":{"$ref":"#/definitions/workers_identifier"},"worker_id":{"description":"Identifier for the Worker, which can be ID or name.","type":"string"}},"required":["account_id","worker_id"],"additionalProperties":false},"body":{"allOf":[{"$ref":"#/definitions/workers_Worker"},{"required":["name"],"type":"object"}]}},"required":["path","body"],"additionalProperties":false,"definitions":{"workers_identifier":{"description":"Identifier.","type":"string","maxLength":32,"examples":["023e105f4ecef8ad9ca31a8372d0c353"]},"workers_Worker":{"type":"object","properties":{"logpush":{"description":"Whether logpush is enabled for the Worker.","type":"boolean","default":false},"name":{"description":"Name of the Worker.","type":"string","pattern":"^[a-z0-9_][a-z0-9-_]*$","examples":["my-worker"]},"observability":{"description":"Observability settings for the Worker.","type":"object","properties":{"enabled":{"description":"Whether observability is enabled for the Worker.","type":"boolean","default":false},"head_sampling_rate":{"description":"The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).","type":"number","default":1,"examples":[1]},"issues":{"description":"Real-time Issues settings for the Worker.","type":["object","null"],"properties":{"enabled":{"description":"Whether real-time Issues are enabled for the Worker.","type":"boolean","default":false}}},"logs":{"description":"Log settings for the Worker.","type":"object","properties":{"destinations":{"description":"A list of destinations where logs will be exported to.","type":"array","items":{"type":"string"},"default":[]},"enabled":{"description":"Whether logs are enabled for the Worker.","type":"boolean","default":false},"head_sampling_rate":{"description":"The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).","type":"number","default":1,"examples":[1]},"invocation_logs":{"description":"Whether [invocation logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs) are enabled for the Worker.","type":"boolean","default":true},"persist":{"description":"Whether log persistence is enabled for the Worker.","type":"boolean","default":true}}},"redact_query_string":{"description":"Whether query strings are removed from request URLs in logs and traces.","type":"boolean","default":false},"traces":{"description":"Trace settings for the Worker.","type":"object","properties":{"destinations":{"description":"A list of destinations where traces will be exported to.","type":"array","items":{"type":"string"},"default":[]},"enabled":{"description":"Whether traces are enabled for the Worker.","type":"boolean","default":false},"head_sampling_rate":{"description":"The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%).","type":"number","default":1,"examples":[1]},"persist":{"description":"Whether trace persistence is enabled for the Worker.","type":"boolean","default":true},"propagation_policy":{"description":"Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. \"authenticated\" honors inbound trace context only when accompanied by a valid trace auth token. \"accept\" unconditionally accepts inbound trace context. Requires the trace propagation feature to be enabled. Returns null when the trace propagation feature is not enabled for the account.","type":["string","null"],"enum":["authenticated","accept",null]}}}}},"previews_base_config":{"description":"Template configuration used when creating new Previews for this Worker.","allOf":[{"$ref":"#/definitions/workers_PreviewsBaseConfig"}]},"subdomain":{"description":"Subdomain settings for the Worker.","type":"object","properties":{"enabled":{"description":"Whether the *.workers.dev subdomain is enabled for the Worker.","type":"boolean","default":false},"previews_enabled":{"description":"Whether [preview URLs](https://developers.cloudflare.com/workers/configuration/previews/) are enabled for the Worker.","type":"boolean"}}},"tags":{"description":"Tags associated with the Worker.","type":"array","items":{"maxLength":1024,"pattern":"^[^,&]*$","type":"string"},"default":[],"maxItems":8,"examples":[["my-team","my-public-api"]]},"tail_consumers":{"description":"Other Workers that should consume logs from the Worker.","type":"array","items":{"properties":{"name":{"description":"Name of the consumer Worker.","type":"string","examples":["my-tail-consumer"]}},"required":["name"],"type":"object"},"default":[]}},"required":["name","tags","subdomain","observability","logpush","tail_consumers"]},"workers_PreviewsBaseConfig":{"type":"object","properties":{"cache_options":{"description":"Cache options used when creating new Previews.","allOf":[{"$ref":"#/definitions/workers_cache_options"}]},"env":{"description":"Bindings used when creating new Previews, keyed by binding name.","allOf":[{"$ref":"#/definitions/workers_env"}]},"limits":{"description":"Resource limits enforced at runtime for newly created Previews.","allOf":[{"$ref":"#/definitions/workers_limits"}]},"logpush":{"description":"Whether logpush is enabled when creating new Previews.","type":"boolean"},"observability":{"description":"Observability settings used when creating new Previews.","allOf":[{"$ref":"#/definitions/workers_observability"}]},"placement":{"description":"Placement configuration used when creating new Previews.","allOf":[{"$ref":"#/definitions/workers_placement_info_no_status"}]},"tail_consumers":{"description":"Other Workers that should consume logs from newly created Previews.","type":"array","items":{"properties":{"name":{"description":"Name of the consumer Worker.","type":"string","examples":["my-tail-consumer"]}},"required":["name"],"type":"object"}}}},"workers_cache_options":{"description":"Global CacheW configuration for the Worker. When caching is on,\nthe platform provisions a `cloudflare.app` zone for the Worker.\nA `type: worker` entry in the `exports` map can override this\nvalue for a single entrypoint.\n","type":"object","properties":{"cross_version_cache":{"description":"Whether cached responses are shared across Worker version\nuploads. This is independent of `enabled`. It can stay true\nwhile caching is off, so the preference survives turning\ncaching off and back on.\n","type":"boolean","default":false,"examples":[true]},"enabled":{"description":"Whether caching is enabled for this Worker.","type":"boolean","default":false,"examples":[true]}},"additionalProperties":false,"required":["enabled"]},"workers_env":{"description":"Bindings attached to a Worker, keyed by binding name. `bindings`\ncarries the same information as an array of objects that each\nname themselves, and an upload can use one form or the other.\n","type":"object","additionalProperties":{"$ref":"#/definitions/workers_env_binding_item"},"examples":[{"MY_ENV_VAR":{"text":"my_data","type":"plain_text"}}]},"workers_limits":{"description":"Limits to apply for this Worker.","type":"object","properties":{"cpu_ms":{"description":"The amount of CPU time this Worker can use in milliseconds.","type":"integer","examples":[50]},"subrequests":{"description":"The number of subrequests this Worker can make per request.","type":"integer","examples":[1000]}}},"workers_observability":{"description":"Observability settings for the Worker.","type":"object","properties":{"enabled":{"description":"Whether observability is enabled for the Worker.","type":"boolean","default":false},"head_sampling_rate":{"description":"The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).","type":"number","default":1,"examples":[1]},"issues":{"description":"Real-time Issues settings for the Worker.","type":["object","null"],"properties":{"enabled":{"description":"Whether real-time Issues are enabled for the Worker.","type":"boolean","default":false}}},"logs":{"description":"Log settings for the Worker.","type":"object","properties":{"destinations":{"description":"A list of destinations where logs will be exported to.","type":"array","items":{"type":"string"},"default":[]},"enabled":{"description":"Whether logs are enabled for the Worker.","type":"boolean","default":false},"head_sampling_rate":{"description":"The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).","type":"number","default":1,"examples":[1]},"invocation_logs":{"description":"Whether [invocation logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs) are enabled for the Worker.","type":"boolean","default":true},"persist":{"description":"Whether log persistence is enabled for the Worker.","type":"boolean","default":true}}},"redact_query_string":{"description":"Whether query strings are removed from request URLs in logs and traces.","type":"boolean","default":false},"traces":{"description":"Trace settings for the Worker.","type":"object","properties":{"destinations":{"description":"A list of destinations where traces will be exported to.","type":"array","items":{"type":"string"},"default":[]},"enabled":{"description":"Whether traces are enabled for the Worker.","type":"boolean","default":false},"head_sampling_rate":{"description":"The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%).","type":"number","default":1,"examples":[1]},"persist":{"description":"Whether trace persistence is enabled for the Worker.","type":"boolean","default":true},"propagation_policy":{"description":"Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. \"authenticated\" honors inbound trace context only when accompanied by a valid trace auth token. \"accept\" unconditionally accepts inbound trace context. Requires the trace propagation feature to be enabled. Returns null when the trace propagation feature is not enabled for the account.","type":["string","null"],"enum":["authenticated","accept",null]}}}}},"workers_placement_info_no_status":{"description":"Configuration for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). Specify mode='smart' for Smart Placement, or one of region/hostname/host.","type":"object","oneOf":[{"additionalProperties":false,"properties":{"mode":{"description":"Enables [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).","type":"string","enum":["smart"]}},"required":["mode"],"type":"object"},{"additionalProperties":false,"properties":{"region":{"description":"Cloud region for targeted placement in format 'provider:region'.","type":"string","examples":["aws:us-east-1"]}},"required":["region"],"type":"object"},{"additionalProperties":false,"properties":{"hostname":{"description":"HTTP hostname for targeted placement.","type":"string","examples":["api.example.com"]}},"required":["hostname"],"type":"object"},{"additionalProperties":false,"properties":{"host":{"description":"TCP host and port for targeted placement.","type":"string","examples":["db.example.com:5432"]}},"required":["host"],"type":"object"},{"additionalProperties":false,"properties":{"mode":{"description":"Targeted placement mode.","type":"string","enum":["targeted"]},"region":{"description":"Cloud region for targeted placement in format 'provider:region'.","type":"string","examples":["aws:us-east-1"]}},"required":["mode","region"],"type":"object"},{"additionalProperties":false,"properties":{"hostname":{"description":"HTTP hostname for targeted placement.","type":"string","examples":["api.example.com"]},"mode":{"description":"Targeted placement mode.","type":"string","enum":["targeted"]}},"required":["mode","hostname"],"type":"object"},{"additionalProperties":false,"properties":{"host":{"description":"TCP host and port for targeted placement.","type":"string","examples":["db.example.com:5432"]},"mode":{"description":"Targeted placement mode.","type":"string","enum":["targeted"]}},"required":["mode","host"],"type":"object"},{"additionalProperties":false,"properties":{"mode":{"description":"Targeted placement mode.","type":"string","enum":["targeted"]},"target":{"description":"Array of placement targets (currently limited to single target).","type":"array","items":{"$ref":"#/definitions/workers_placement_target"},"maxItems":1,"minItems":1}},"required":["mode","target"],"type":"object"}]},"workers_env_binding_item":{"description":"A single entry in the `env` map. An entry holds the same payload\nas an entry of `bindings` without the `name` property, because\nthe map key supplies the name. See `binding_item` for the payload\nof each binding kind.\n","type":"object","properties":{"type":{"description":"The kind of resource that the binding provides.","type":"string","examples":["plain_text"]}},"additionalProperties":true,"required":["type"]},"workers_placement_target":{"description":"A target to run your Worker near.","type":"object","oneOf":[{"additionalProperties":false,"properties":{"region":{"description":"Cloud region in format 'provider:region'.","type":"string","examples":["aws:us-east-1"]}},"required":["region"],"type":"object"},{"additionalProperties":false,"properties":{"hostname":{"description":"HTTP hostname for targeted placement.","type":"string","examples":["api.example.com"]}},"required":["hostname"],"type":"object"},{"additionalProperties":false,"properties":{"host":{"description":"TCP host:port for targeted placement.","type":"string","examples":["db.example.com:5432"]}},"required":["host"],"type":"object"}]}}},"name":"Update Worker","id":"cloudflare.updateworker","example":{"path":{"account_id":"023e105f4ecef8ad9ca31a8372d0c353","worker_id":"example"},"body":{"name":"example","tags":["my-team","my-public-api"],"subdomain":{},"observability":{},"logpush":false,"tail_consumers":[]}},"maxRequests":1,"summary":false}}