{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Only `/deployments/latest` is supported. Creates a new preview deployment by applying a JSON Merge Patch (RFC 7396) to the latest deployment. Patching a specific deployment ID is not supported. Omitted fields are inherited from the latest deployment. Preview base config is used for the first deployment.","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"},"preview_id":{"description":"Identifier for the Preview, which can be ID, slug, or URL-encoded name.","type":"string"}},"required":["account_id","worker_id","preview_id"],"additionalProperties":false},"query":{"type":"object","properties":{"ignore_defaults":{"description":"If true, preview defaults from the parent Worker are ignored.","type":"boolean"}},"required":[],"additionalProperties":false},"body":{"$ref":"#/definitions/workers_PreviewDeploymentRequest"}},"required":["path"],"additionalProperties":false,"definitions":{"workers_identifier":{"description":"Identifier.","type":"string","maxLength":32,"examples":["023e105f4ecef8ad9ca31a8372d0c353"]},"workers_PreviewDeploymentRequest":{"description":"Preview deployment configuration with base64-encoded modules.","allOf":[{"$ref":"#/definitions/workers_PreviewDeploymentConfig"},{"properties":{"modules":{"description":"Code, sourcemaps, and other content used at runtime.","type":"array","items":{"properties":{"content_base64":{"description":"The base64-encoded module content.","type":"string","format":"byte","examples":["ZXhwb3J0IGRlZmF1bHQgewogIGFzeW5jIGZldGNoKHJlcXVlc3QsIGVudiwgY3R4KSB7CiAgICByZXR1cm4gbmV3IFJlc3BvbnNlKCdIZWxsbyBXb3JsZCEnKQogIH0KfQ=="]},"content_type":{"description":"The content type of the module.","type":"string","examples":["application/javascript+module"]},"name":{"description":"The name of the module.","type":"string","examples":["index.js"]}},"required":["name","content_type","content_base64"],"type":"object"}}},"type":"object"}]},"workers_PreviewDeploymentConfig":{"description":"Configuration shared by JSON and multipart preview deployment uploads.","type":"object","properties":{"annotations":{"description":"Metadata about the deployment.","type":"object","properties":{"workers/commit_sha":{"description":"Full commit SHA associated with the deployment, detected from the CI environment. Maximum 64 bytes.","type":"string","maxLength":64,"examples":["8b6aeb38455e2f92e170deb46313b90166ccc1e5"]},"workers/message":{"description":"Human-readable message about the deployment. Truncated to 1000 bytes if longer.","type":"string","maxLength":1000,"examples":["Fixed bug."]},"workers/pull_request_number":{"description":"Number of the pull or merge request associated with the deployment, detected from the CI environment. Maximum 20 bytes.","type":"string","maxLength":20,"examples":["14966"]},"workers/pull_request_title":{"description":"Title of the pull or merge request associated with the deployment, detected from the CI environment. Maximum 512 bytes.","type":"string","maxLength":512,"examples":["Add a cool new feature"]},"workers/pull_request_url":{"description":"URL of the pull or merge request associated with the deployment, detected from the CI environment. Maximum 512 bytes.","type":"string","maxLength":512,"examples":["https://github.com/cloudflare/workers-sdk/pull/14966"]},"workers/repository_url":{"description":"URL of the source repository the deployment was built from, detected from the CI environment. Maximum 512 bytes.","type":"string","maxLength":512,"examples":["https://github.com/cloudflare/workers-sdk"]},"workers/tag":{"description":"User-provided identifier for the deployment. Maximum 100 bytes.","type":"string","maxLength":100,"examples":["v1.0.1"]}}},"assets":{"$ref":"#/definitions/workers_assets"},"bindings":{"description":"Bindings attached to the deployment, as an array of objects\nthat each name themselves. An upload can send `env` or\n`bindings`, and a read returns both. Uploads to a Preview whose\nparent Worker has a previews base config must use `env`.\n","allOf":[{"$ref":"#/definitions/workers_bindings"}]},"cache_options":{"$ref":"#/definitions/workers_cache_options"},"compatibility_date":{"$ref":"#/definitions/workers_compatibility_date"},"compatibility_flags":{"$ref":"#/definitions/workers_compatibility_flags"},"containers":{"$ref":"#/definitions/workers_containers"},"env":{"description":"Bindings attached to the deployment, keyed by binding name. An\nupload can send `env` or `bindings`, and a read returns both.\n","allOf":[{"$ref":"#/definitions/workers_env"}]},"exports":{"description":"Declarative exports for the deployment, including Durable\nObject classes (with their `storage` backend) and named Worker\nentrypoints. On reads, tombstoned lifecycle entries are\nomitted, so only live exports (`created` and\n`expecting-transfer`) are returned. `exports` and `migrations`\nare mutually exclusive on upload.\n","allOf":[{"$ref":"#/definitions/workers_exports_config_map"}]},"limits":{"description":"Resource limits enforced at runtime.","type":"object","properties":{"cpu_ms":{"description":"CPU time limit in milliseconds.","type":"integer","examples":[50]},"subrequests":{"description":"Subrequest limit per request.","type":"integer","examples":[1000]}}},"main_module":{"description":"The name of the module that exports a `fetch` handler. Multipart uploads reference the file part by filename.","type":"string","examples":["index.js"]},"migrations":{"description":"Migrations for Durable Objects associated with the deployment. Migrations are applied when the deployment is created.","oneOf":[{"$ref":"#/definitions/workers_single_step_migrations"},{"$ref":"#/definitions/workers_multiple_step_migrations"}]},"placement":{"$ref":"#/definitions/workers_placement_info_no_status"},"usage_model":{"description":"Usage model for the deployment.","type":"string","default":"standard","enum":["standard","bundled","unbound"],"examples":["standard"]}}},"workers_assets":{"description":"Configuration for assets within a Worker.\n\n[`_headers`](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) and\n[`_redirects`](https://developers.cloudflare.com/workers/static-assets/redirects/) files should be\nincluded as modules named `_headers` and `_redirects` with content type `text/plain`.\n","type":"object","properties":{"config":{"description":"Configuration for assets within a Worker.","type":"object","properties":{"base_path":{"description":"The public URL path prefix under which assets are served. A null request value resets it to `/`; responses represent the root as `/`. All versions in a gradual deployment must use the same canonical value. To change it, first deploy the version containing the change at 100%.","type":["string","null"],"default":"/","examples":["/docs/"]},"html_handling":{"description":"Determines the redirects and rewrites of requests for HTML content.","type":"string","default":"auto-trailing-slash","enum":["auto-trailing-slash","force-trailing-slash","drop-trailing-slash","none"],"examples":["auto-trailing-slash"]},"not_found_handling":{"description":"Determines the response when a request does not match a static asset, and there is no Worker script.","type":"string","default":"none","enum":["none","404-page","single-page-application"],"examples":["404-page"]},"run_worker_first":{"default":false,"oneOf":[{"description":"Contains a list path rules to control routing to either the Worker or assets. Glob (*) and negative (!) rules are supported. Rules must start with either '/' or '!/'. At least one non-negative rule must be provided, and negative rules have higher precedence than non-negative rules.","items":{"type":"string"},"type":"array","examples":["[\"/api/*\", \"/oauth/callback\", \"!/api/assets/*\"]"]},{"description":"Enables routing to always invoke the Worker script ahead of all requests. When true, this is equivalent to `[\"/*\"]` in the string array version of this field.","type":"boolean","examples":[true]}]}}},"jwt":{"description":"Token provided upon successful upload of all files from a registered manifest.","type":"string"}}},"workers_bindings":{"description":"List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings.","type":"array","items":{"$ref":"#/definitions/workers_binding_item"},"examples":[[{"name":"MY_ENV_VAR","text":"my_data","type":"plain_text"}]]},"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_compatibility_date":{"description":"Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.","type":"string","examples":["2021-01-01T00:00:00Z"]},"workers_compatibility_flags":{"description":"Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a `compatibility_date`.","type":"array","items":{"$ref":"#/definitions/workers_compatibility_flag"},"default":[],"examples":[["nodejs_compat"]]},"workers_containers":{"description":"List of containers attached to a Worker. Containers can only be attached to Durable Object classes of this Worker script.","type":"array","items":{"$ref":"#/definitions/workers_container_item"},"examples":[[{"class_name":"MyDurableObject"}]]},"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_exports_config_map":{"description":"Declarative exports for the Worker, keyed by export name. Worker\nentrypoint entries (`type: worker`) carry cache configuration for\nthat entrypoint. Durable Object entries (`type: durable-object`)\nare also configured here and drive namespace reconciliation. At\nmost 100 entries; class names are at most 128 characters.\n","type":"object","additionalProperties":{"$ref":"#/definitions/workers_export_config"},"maxProperties":100,"examples":[{"Admin":{"cache":{"enabled":true},"type":"worker"},"Counter":{"storage":"sqlite","type":"durable-object"},"OldCounter":{"renamed_to":"Counter","state":"renamed","type":"durable-object"},"default":{"cache":{"enabled":false},"type":"worker"}}]},"workers_single_step_migrations":{"description":"A single set of migrations to apply.","allOf":[{"$ref":"#/definitions/workers_migration_tag_conditions"},{"$ref":"#/definitions/workers_migration_step"}]},"workers_multiple_step_migrations":{"allOf":[{"$ref":"#/definitions/workers_migration_tag_conditions"},{"properties":{"steps":{"description":"Migrations to apply in order.","type":"array","items":{"$ref":"#/definitions/workers_migration_step"}}},"type":"object"}]},"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_binding_item":{"description":"A binding to allow the Worker to communicate with resources.","type":"object","oneOf":[{"$ref":"#/definitions/workers_binding_kind_ai"},{"$ref":"#/definitions/workers_binding_kind_ai_search"},{"$ref":"#/definitions/workers_binding_kind_ai_search_namespace"},{"$ref":"#/definitions/workers_binding_kind_messaging"},{"$ref":"#/definitions/workers_binding_kind_analytics_engine"},{"$ref":"#/definitions/workers_binding_kind_artifacts"},{"$ref":"#/definitions/workers_binding_kind_assets"},{"$ref":"#/definitions/workers_binding_kind_browser"},{"$ref":"#/definitions/workers_binding_kind_d1"},{"$ref":"#/definitions/workers_binding_kind_data_blob"},{"$ref":"#/definitions/workers_binding_kind_dispatch_namespace"},{"$ref":"#/definitions/workers_binding_kind_durable_object_namespace"},{"$ref":"#/definitions/workers_binding_kind_hyperdrive"},{"$ref":"#/definitions/workers_binding_kind_inherit"},{"$ref":"#/definitions/workers_binding_kind_images"},{"$ref":"#/definitions/workers_binding_kind_json"},{"$ref":"#/definitions/workers_binding_kind_kv_namespace"},{"$ref":"#/definitions/workers_binding_kind_media"},{"$ref":"#/definitions/workers_binding_kind_mtls_certificate"},{"$ref":"#/definitions/workers_binding_kind_plain_text"},{"$ref":"#/definitions/workers_binding_kind_pipelines"},{"$ref":"#/definitions/workers_binding_kind_k2"},{"$ref":"#/definitions/workers_binding_kind_queue"},{"$ref":"#/definitions/workers_binding_kind_ratelimit"},{"$ref":"#/definitions/workers_binding_kind_r2_bucket"},{"$ref":"#/definitions/workers_binding_kind_secret_text"},{"$ref":"#/definitions/workers_binding_kind_send_email"},{"$ref":"#/definitions/workers_binding_kind_service"},{"$ref":"#/definitions/workers_binding_kind_text_blob"},{"$ref":"#/definitions/workers_binding_kind_vectorize"},{"$ref":"#/definitions/workers_binding_kind_version_metadata"},{"$ref":"#/definitions/workers_binding_kind_secrets_store_secret"},{"$ref":"#/definitions/workers_binding_kind_flagship"},{"$ref":"#/definitions/workers_binding_kind_secret_key"},{"$ref":"#/definitions/workers_binding_kind_workflow"},{"$ref":"#/definitions/workers_binding_kind_wasm_module"},{"$ref":"#/definitions/workers_binding_kind_vpc_service"},{"$ref":"#/definitions/workers_binding_kind_vpc_network"}]},"workers_compatibility_flag":{"description":"Flag that enables or disables a specific feature in the Workers runtime.","type":"string","examples":["nodejs_compat"]},"workers_container_item":{"description":"Container configuration for a Worker.","type":"object","properties":{"class_name":{"description":"Select which Durable Object class should get this container attached.","type":"string"}},"required":["class_name"]},"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_export_config":{"description":"A single entry in the `exports` map, keyed by export name (a\n`WorkerEntrypoint` class name, a Durable Object class name, or\n`default` for the Worker's default export). The `type`\ndiscriminator selects the top-level shape: `worker` entrypoint\nentries may carry `cache` configuration, while `durable-object`\nentries are further refined by the optional `state` field\n(default `created`). Tombstone states (`deleted`, `renamed`,\n`transferred`) express destructive lifecycle operations\ndeclaratively; `expecting-transfer` is the live target side of a\ntransfer. The server validates the exact per-(type, state) field\ncombinations; fields not listed for a variant are rejected.\n","oneOf":[{"$ref":"#/definitions/workers_worker_export"},{"$ref":"#/definitions/workers_durable_object_export_variants"}]},"workers_migration_tag_conditions":{"type":"object","properties":{"new_tag":{"description":"Tag to set as the latest migration tag.","type":"string","examples":["v2"]},"old_tag":{"description":"Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.","type":"string","examples":["v1"]}}},"workers_migration_step":{"type":"object","properties":{"deleted_classes":{"description":"A list of classes to delete Durable Object namespaces from.","type":"array","items":{"type":"string"}},"new_classes":{"description":"A list of classes to create Durable Object namespaces from.","type":"array","items":{"type":"string"}},"new_sqlite_classes":{"description":"A list of classes to create Durable Object namespaces with SQLite from.","type":"array","items":{"type":"string"}},"renamed_classes":{"description":"A list of classes with Durable Object namespaces that were renamed.","type":"array","items":{"properties":{"from":{"type":"string"},"to":{"type":"string"}},"type":"object"}},"transferred_classes":{"description":"A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.","type":"array","items":{"properties":{"from":{"type":"string"},"from_script":{"type":"string"},"to":{"type":"string"}},"type":"object"}}}},"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"}]},"workers_binding_kind_ai":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["ai"]}},"required":["name","type"]},"workers_binding_kind_ai_search":{"type":"object","properties":{"instance_name":{"description":"The user-chosen instance name. Must exist at deploy time. The worker can search, chat, update, and manage items/jobs on this instance.","type":"string","examples":["cloudflare-blog"]},"name":{"$ref":"#/definitions/workers_binding_name"},"namespace":{"description":"The namespace the instance belongs to. Defaults to \"default\" if omitted. Customers who don't use namespaces can simply omit this field.","type":"string","examples":["production"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["ai_search"]}},"required":["name","type","instance_name"]},"workers_binding_kind_ai_search_namespace":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"namespace":{"description":"The user-chosen namespace name. Must exist before deploy -- Wrangler handles auto-creation on deploy failure (R2 bucket pattern). The \"default\" namespace is auto-created by config-api for new accounts. Grants full access (CRUD + search + chat) to all instances within the namespace.","type":"string","examples":["production"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["ai_search_namespace"]}},"required":["name","type","namespace"]},"workers_binding_kind_messaging":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"namespace":{"description":"The Messaging namespace to bind to.","type":"string","examples":["production"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["messaging"]}},"required":["name","type","namespace"]},"workers_binding_kind_analytics_engine":{"type":"object","properties":{"dataset":{"description":"The name of the dataset to bind to.","type":"string","examples":["some_dataset"]},"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["analytics_engine"]}},"required":["name","type","dataset"]},"workers_binding_kind_artifacts":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"namespace":{"description":"The Artifacts namespace exposed to the Worker in the Worker's account. Must be 2-63 characters, start with an ASCII alphanumeric character, contain only ASCII alphanumeric characters, dots, underscores, and hyphens, and must not end with a hyphen. The namespace does not need to be created before binding it.","type":"string","maxLength":63,"minLength":2,"pattern":"^[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9._])?$","examples":["agent-workspace"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["artifacts"]}},"required":["name","type","namespace"]},"workers_binding_kind_assets":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["assets"]}},"required":["name","type"]},"workers_binding_kind_browser":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["browser"]}},"required":["name","type"]},"workers_binding_kind_d1":{"type":"object","properties":{"database_id":{"description":"Identifier of the D1 database to bind to.","type":"string","examples":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]},"id":{"description":"Identifier of the D1 database to bind to.","type":"string","examples":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]},"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["d1"]}},"required":["name","type","database_id"]},"workers_binding_kind_data_blob":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"part":{"description":"The name of the file containing the data content. Only accepted for `service worker syntax` Workers.","type":"string","examples":["my-module.bin"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["data_blob"]}},"required":["name","type","part"]},"workers_binding_kind_dispatch_namespace":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"namespace":{"description":"The name of the dispatch namespace.","type":"string","examples":["my-namespace"]},"outbound":{"description":"Outbound worker.","type":"object","properties":{"params":{"description":"Pass information from the Dispatch Worker to the Outbound Worker through the parameters.","type":"array","items":{"properties":{"name":{"description":"Name of the parameter.","type":"string","examples":["customer_name"]}},"required":["name"],"type":"object"}},"worker":{"description":"Outbound worker.","type":"object","properties":{"entrypoint":{"description":"Entrypoint to invoke on the outbound worker.","type":"string"},"environment":{"description":"Environment of the outbound worker.","type":"string"},"service":{"description":"Name of the outbound worker.","type":"string"}}}}},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["dispatch_namespace"]}},"required":["name","type","namespace"]},"workers_binding_kind_durable_object_namespace":{"type":"object","properties":{"class_name":{"description":"The exported class name of the Durable Object.","type":"string","examples":["MyDurableObject"]},"dispatch_namespace":{"description":"The dispatch namespace the Durable Object script belongs to.","type":"string","examples":["my-dispatch-namespace"]},"environment":{"description":"The environment of the script_name to bind to.","type":"string","examples":["production"]},"name":{"$ref":"#/definitions/workers_binding_name"},"namespace_id":{"allOf":[{"$ref":"#/definitions/workers_namespace_identifier"},{"type":"string"}]},"script_name":{"description":"The script where the Durable Object is defined, if it is external to this Worker.","type":"string","examples":["my-other-worker"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["durable_object_namespace"]}},"required":["name","type"]},"workers_binding_kind_hyperdrive":{"type":"object","properties":{"id":{"description":"Identifier of the Hyperdrive connection to bind to.","type":"string","examples":["57b7076f58be42419276f058a8968187"]},"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["hyperdrive"]}},"required":["name","type","id"]},"workers_binding_kind_inherit":{"type":"object","properties":{"name":{"description":"The name of the inherited binding.","type":"string","examples":["MY_BINDING"]},"old_name":{"description":"The old name of the inherited binding. If set, the binding will be renamed from `old_name` to `name` in the new version. If not set, the binding will keep the same name between versions.","type":"string","examples":["MY_OLD_BINDING"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["inherit"]},"version_id":{"description":"Identifier for the version to inherit the binding from. This can be a version ID, or the literal \"latest\" to inherit from the most recently uploaded version, which may not be the deployed version. Defaults to \"latest\". Only the Workers API version endpoints under `/accounts/{account_id}/workers/workers/{worker_id}/versions` accept a version ID. Other endpoints, including script upload and script version upload, accept only \"latest\" and reject a version ID with error 10057.","type":"string","default":"latest","examples":["latest"]}},"required":["name","type"]},"workers_binding_kind_images":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["images"]}},"required":["name","type"]},"workers_binding_kind_json":{"type":"object","properties":{"json":{"description":"JSON data to use.","type":"object"},"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["json"]}},"required":["name","type","json"]},"workers_binding_kind_kv_namespace":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"namespace_id":{"$ref":"#/definitions/workers_namespace_identifier"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["kv_namespace"]}},"required":["name","type","namespace_id"]},"workers_binding_kind_media":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["media"]}},"required":["name","type"]},"workers_binding_kind_mtls_certificate":{"type":"object","properties":{"certificate_id":{"description":"Identifier of the certificate to bind to.","type":"string","examples":["efwu2n6s-q69d-2kr9-184j-4913e8h391k6"]},"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["mtls_certificate"]}},"required":["name","type","certificate_id"]},"workers_binding_kind_plain_text":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"text":{"description":"The text value to use.","type":"string","examples":["Hello, world!"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["plain_text"]}},"required":["name","type","text"]},"workers_binding_kind_pipelines":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"pipeline":{"description":"Name of the Pipeline to bind to.","type":"string","examples":["my-pipeline"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["pipelines"]}},"required":["name","type","pipeline"]},"workers_binding_kind_k2":{"description":"A K2 stream binding. Available only to accounts enabled for K2.","type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"stream":{"description":"ID of a K2 stream owned by the account deploying the Worker.","type":"string","pattern":"^[a-f0-9]{32}$","examples":["0123456789abcdef0123456789abcdef"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["k2"]}},"required":["name","type","stream"]},"workers_binding_kind_queue":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"queue_name":{"description":"Name of the Queue to bind to.","type":"string","examples":["my-queue"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["queue"]}},"required":["name","type","queue_name"]},"workers_binding_kind_ratelimit":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"namespace_id":{"description":"Identifier of the rate limit namespace to bind to.","type":"string","examples":["1234"]},"simple":{"description":"The rate limit configuration.","type":"object","properties":{"limit":{"description":"The limit (requests per period).","type":"number","examples":[100]},"mitigation_timeout":{"description":"Duration in seconds to apply the mitigation action after the rate limit is exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400. Must be greater than or equal to the period when non-zero.\n","type":"integer","examples":[60]},"period":{"description":"The period in seconds.","type":"integer","examples":[60]}},"required":["limit","period"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["ratelimit"]}},"required":["name","type","namespace_id","simple"]},"workers_binding_kind_r2_bucket":{"type":"object","properties":{"bucket_name":{"description":"R2 bucket to bind to.","type":"string","examples":["my-r2-bucket"]},"jurisdiction":{"description":"The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) of the R2 bucket.","type":"string","enum":["eu","fedramp","fedramp-high","us"],"examples":["eu"]},"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["r2_bucket"]}},"required":["name","type","bucket_name"]},"workers_binding_kind_secret_text":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"text":{"description":"The secret value to use.","type":"string","examples":["My secret."]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["secret_text"]}},"required":["name","type","text"]},"workers_binding_kind_send_email":{"type":"object","properties":{"allowed_destination_addresses":{"description":"List of allowed destination addresses.","type":"array","items":{"format":"email","type":"string"},"examples":[["user1@example.com","user2@example.com"]]},"allowed_sender_addresses":{"description":"List of allowed sender addresses.","type":"array","items":{"format":"email","type":"string"},"examples":[["user1@example.com","user2@example.com"]]},"destination_address":{"description":"Destination address for the email.","type":"string","format":"email","examples":["user@example.com"]},"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["send_email"]}},"required":["name","type"]},"workers_binding_kind_service":{"type":"object","properties":{"entrypoint":{"description":"Entrypoint to invoke on the target Worker.","type":"string","examples":["MyHandler"]},"environment":{"description":"Optional environment if the Worker utilizes one.","type":"string","default":"production","examples":["production"]},"name":{"$ref":"#/definitions/workers_binding_name"},"service":{"description":"Name of Worker to bind to.","type":"string","examples":["my-worker"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["service"]}},"required":["name","type","service"]},"workers_binding_kind_text_blob":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"part":{"description":"The name of the file containing the text content. Only accepted for `service worker syntax` Workers.","type":"string","examples":["my-module.txt"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["text_blob"]}},"required":["name","type","part"]},"workers_binding_kind_vectorize":{"type":"object","properties":{"index_name":{"description":"Name of the Vectorize index to bind to.","type":"string","examples":["my-index-name"]},"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["vectorize"]}},"required":["name","type","index_name"]},"workers_binding_kind_version_metadata":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["version_metadata"]}},"required":["name","type"]},"workers_binding_kind_secrets_store_secret":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"secret_name":{"description":"Name of the secret in the store.","type":"string","examples":["my_secret"]},"store_id":{"description":"ID of the store containing the secret.","type":"string","examples":["8c8b1387108e49be85669169793e7bd2"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["secrets_store_secret"]}},"required":["name","type","store_id","secret_name"]},"workers_binding_kind_flagship":{"type":"object","properties":{"app_id":{"description":"ID of the Flagship app to bind to for feature flag evaluation.","type":"string","maxLength":128,"examples":["app-12345678-1234-1234-1234-123456789012"]},"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["flagship"]}},"required":["name","type","app_id"]},"workers_binding_kind_secret_key":{"type":"object","properties":{"algorithm":{"description":"Algorithm-specific key parameters. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm).","type":"object"},"format":{"description":"Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format).","type":"string","enum":["raw","pkcs8","spki","jwk"],"examples":["raw"]},"key_base64":{"description":"Base64-encoded key data. Required if `format` is \"raw\", \"pkcs8\", or \"spki\".","type":"string"},"key_jwk":{"description":"Key data in [JSON Web Key](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#json_web_key) format. Required if `format` is \"jwk\".","type":"object"},"name":{"$ref":"#/definitions/workers_binding_name"},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["secret_key"]},"usages":{"description":"Allowed operations with the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages).","type":"array","items":{"enum":["encrypt","decrypt","sign","verify","deriveKey","deriveBits","wrapKey","unwrapKey"],"type":"string"},"examples":[["encrypt","decrypt"]]}},"required":["name","type","format","algorithm","usages"]},"workers_binding_kind_workflow":{"type":"object","properties":{"class_name":{"description":"Class name of the Workflow. Should only be provided if the Workflow belongs to this script.","type":"string","examples":["my-workflow"]},"name":{"$ref":"#/definitions/workers_binding_name"},"script_name":{"description":"Script name that contains the Workflow. If not provided, defaults to this script name.","type":"string","examples":["my-workflow"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["workflow"]},"workflow_name":{"description":"Name of the Workflow to bind to.","type":"string","examples":["my-workflow"]}},"required":["name","type","workflow_name"]},"workers_binding_kind_wasm_module":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"part":{"description":"The name of the file containing the WebAssembly module content. Only accepted for `service worker syntax` Workers.","type":"string","examples":["my-module.wasm"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["wasm_module"]}},"required":["name","type","part"]},"workers_binding_kind_vpc_service":{"type":"object","properties":{"name":{"$ref":"#/definitions/workers_binding_name"},"service_id":{"description":"Identifier of the VPC service to bind to.","type":"string","examples":["8c8b1387108e49be85669169793e7bd2"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["vpc_service"]}},"required":["name","type","service_id"]},"workers_binding_kind_vpc_network":{"type":"object","properties":{"identity":{"description":"Enables Gateway identity for the binding. Requires network_id to be \"cf1:network\" and cannot be combined with tunnel_id or an explicit \"cf1:vnet:<UUID>\" network_id.\n","type":"string","enum":["runtime-email-alpha"]},"name":{"$ref":"#/definitions/workers_binding_name"},"network_id":{"description":"Identifier of the network to bind to. Use \"cf1:network\" to select the account's default virtual network at runtime, or \"cf1:vnet:<UUID>\" to select an explicit virtual network in the Worker's account. Mutually exclusive with tunnel_id.\n","type":"string","examples":["cf1:network"]},"tunnel_id":{"description":"UUID of the Cloudflare Tunnel to bind to. Mutually exclusive with network_id.\n","type":"string","examples":["abcd1234-5678-90ef-ghij-klmnopqrstuv"]},"type":{"description":"The kind of resource that the binding provides.","type":"string","enum":["vpc_network"]}},"required":["name","type"]},"workers_worker_export":{"description":"A named Worker entrypoint export (`type: worker`). Worker\nentrypoints are always live (`state: created`) and carry no\nstorage or lifecycle fields. The optional `cache` block overrides\nthe Worker's global `cache_options.enabled` for this entrypoint.\n","type":"object","properties":{"cache":{"description":"Cache override for this entrypoint. Overrides the Worker's\nglobal `cache_options.enabled` for this entrypoint only.\n","allOf":[{"$ref":"#/definitions/workers_entrypoint_cache_options"}]},"state":{"description":"Live export. May be omitted; defaults to `created`.","type":"string","default":"created","enum":["created"]},"type":{"description":"Marks this entry as a Worker entrypoint export.","type":"string","enum":["worker"]}},"additionalProperties":false,"required":["type"]},"workers_durable_object_export_variants":{"description":"Any Durable Object export entry (`type: durable-object`), across\nall lifecycle states. The optional `state` field selects the\nvariant (default `created`); the tombstone states (`deleted`,\n`renamed`, `transferred`) and the live transfer target\n(`expecting-transfer`) are the alternatives. The server validates\nthe exact per-state field combinations; fields not listed for a\nvariant are rejected.\n","oneOf":[{"$ref":"#/definitions/workers_durable_object_export"},{"$ref":"#/definitions/workers_durable_object_deleted_export"},{"$ref":"#/definitions/workers_durable_object_renamed_export"},{"$ref":"#/definitions/workers_durable_object_transferred_export"},{"$ref":"#/definitions/workers_durable_object_expecting_transfer_export"}]},"workers_binding_name":{"description":"A JavaScript variable name for the binding.","type":"string","examples":["myBinding"]},"workers_namespace_identifier":{"description":"Namespace identifier tag.","type":"string","maxLength":32,"examples":["0f2ac74b498b48028cb68387c421e279"]},"workers_entrypoint_cache_options":{"description":"CacheW configuration for a single `type: worker` entrypoint.\nWhen present it overrides the Worker's global\n`cache_options.enabled` for that entrypoint, so a Worker can turn\ncaching on globally and opt one entrypoint out, or the reverse.\n","type":"object","properties":{"enabled":{"description":"Whether caching is enabled for this entrypoint.","type":"boolean","examples":[true]}},"additionalProperties":false,"required":["enabled"]},"workers_durable_object_export":{"description":"A live Durable Object export (`state: created`, the default). The\nplatform auto-provisions the namespace on first deploy, matches it\non subsequent deploys, and never mutates or deletes it as a side\neffect of a code-only change. `storage` is required; `renamed_to`,\n`transferred_to` and `transfer_from` are not allowed on a live\nentry.\n","type":"object","properties":{"container":{"description":"Name of the container (declared in the upload's\n`metadata.containers`) that backs this Durable Object. When\nset, the namespace is container-enabled. Valid only on live\nentries.\n","type":"string","maxLength":128,"examples":["my-container"]},"state":{"description":"Live export. May be omitted; defaults to `created`.","type":"string","default":"created","enum":["created"]},"storage":{"$ref":"#/definitions/workers_export_storage"},"type":{"description":"Marks this entry as a Durable Object export.","type":"string","enum":["durable-object"]}},"additionalProperties":false,"required":["type","storage"]},"workers_durable_object_deleted_export":{"description":"A `deleted` tombstone: retires the provisioned namespace for this\nclass and all of its data. The class must be absent from the\nuploaded code and no other Worker in the account may bind to the\nnamespace, otherwise the deploy is rejected. No other fields are\nallowed. Deletion is irreversible.\n","type":"object","properties":{"state":{"description":"Tombstone that deletes the namespace.","type":"string","enum":["deleted"]},"type":{"description":"Marks this entry as a Durable Object export.","type":"string","enum":["durable-object"]}},"additionalProperties":false,"required":["type","state"]},"workers_durable_object_renamed_export":{"description":"A `renamed` tombstone: rewrites the provisioned namespace's class\nname from this map key to `renamed_to`. The source class may stay\nin code during the rollout window (an info notice is emitted).\n`storage`, `transferred_to` and `transfer_from` are not allowed.\n","type":"object","properties":{"renamed_to":{"description":"The destination class name. Must differ from the source class\n(the map key) and must be declared as a live (`created`) entry\nin the same `exports` map. Write-only: never present in GET\nresponses.\n","type":"string","maxLength":128,"examples":["NewName"]},"state":{"description":"Tombstone that renames the namespace's class.","type":"string","enum":["renamed"]},"type":{"description":"Marks this entry as a Durable Object export.","type":"string","enum":["durable-object"]}},"additionalProperties":false,"required":["type","state","renamed_to"]},"workers_durable_object_transferred_export":{"description":"A `transferred` tombstone (source side of a two-phase transfer):\nhands ownership of the provisioned namespace to another script in\nthe same account, named by `transferred_to`. The target must have\nalready deployed a matching `expecting-transfer` entry. The source\nclass may stay in code during the rollout window (an info notice\nis emitted). `storage`, `renamed_to` and `transfer_from` are not\nallowed.\n","type":"object","properties":{"state":{"description":"Tombstone that transfers the namespace to another script.","type":"string","enum":["transferred"]},"transferred_to":{"description":"The destination script name. Must be in the same account and\nthe same dispatch-namespace context (or both non-dispatch).\nCross-dispatch-namespace transfers are rejected. Write-only:\nnever present in GET responses.\n","type":"string","maxLength":128,"examples":["target-worker"]},"type":{"description":"Marks this entry as a Durable Object export.","type":"string","enum":["durable-object"]}},"additionalProperties":false,"required":["type","state","transferred_to"]},"workers_durable_object_expecting_transfer_export":{"description":"The target side of a two-phase transfer (`state:\nexpecting-transfer`). Declares that this script expects to receive\na namespace for this class from the `transfer_from` script. This\nis a live entry, not a tombstone: bindings resolve through the\nsource's namespace until the source commits with a `transferred`\ntombstone. `storage` and `transfer_from` are required; `renamed_to`\nand `transferred_to` are not allowed.\n","type":"object","properties":{"container":{"description":"Name of the container (declared in the upload's\n`metadata.containers`) that backs this Durable Object once the\ntransfer settles. Valid only on live entries.\n","type":"string","maxLength":128,"examples":["my-container"]},"state":{"description":"Target side of a two-phase transfer.","type":"string","enum":["expecting-transfer"]},"storage":{"$ref":"#/definitions/workers_export_storage"},"transfer_from":{"description":"The source script name to receive the namespace from. Must be\nin the same account and dispatch-namespace context. Present on\nreads for `expecting-transfer` entries.\n","type":"string","maxLength":128,"examples":["source-worker"]},"type":{"description":"Marks this entry as a Durable Object export.","type":"string","enum":["durable-object"]}},"additionalProperties":false,"required":["type","state","storage","transfer_from"]},"workers_export_storage":{"description":"Durable Object storage backend. `sqlite` is the recommended (and\nonly) backend for new namespaces. `legacy-kv` is accepted only for\na class whose namespace already exists as KV-backed; the `exports`\nflow never provisions a new `legacy-kv` namespace.\n","type":"string","enum":["sqlite","legacy-kv"]}}},"name":"Patch Latest Preview Deployment","id":"cloudflare.workers.previews.deployments.patchlatest","example":{"path":{"account_id":"023e105f4ecef8ad9ca31a8372d0c353","worker_id":"example","preview_id":"example"}},"maxRequests":1,"summary":false}}