Skip to content
Start here

Scripts

List Workers
GET/accounts/{account_id}/workers/scripts
Search Workers
GET/accounts/{account_id}/workers/scripts-search
Download Worker
GET/accounts/{account_id}/workers/scripts/{script_name}
Upload Worker Module
PUT/accounts/{account_id}/workers/scripts/{script_name}
Delete Worker
DELETE/accounts/{account_id}/workers/scripts/{script_name}
ModelsExpand Collapse
Script object { id, compatibility_date, compatibility_flags, 18 more }
id: optional string

The name used to identify the script.

compatibility_date: optional string

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

compatibility_flags: optional array of string

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.

created_on: optional string

When the script was created.

formatdate-time
etag: optional string

Hashed script content, can be used in a If-None-Match header when updating.

handlers: optional array of string

The names of handlers exported as part of the default export.

has_assets: optional boolean

Whether a Worker contains assets.

has_modules: optional boolean

Whether a Worker contains modules.

last_deployed_from: optional string

The client most recently used to deploy this Worker.

logpush: optional boolean

Whether Logpush is turned on for the Worker.

migration_tag: optional string

The tag of the Durable Object migration that was most recently applied for this Worker.

modified_on: optional string

When the script was last modified.

formatdate-time
named_handlers: optional array of object { handlers, name }

Named exports, such as Durable Object class implementations and named entrypoints.

handlers: optional array of string

The names of handlers exported as part of the named export.

name: optional string

The name of the export.

observability: optional object { enabled, head_sampling_rate, logs, traces }

Observability settings for the Worker.

enabled: boolean

Whether observability is enabled for the Worker.

head_sampling_rate: optional number

The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

logs: optional object { enabled, invocation_logs, destinations, 2 more }

Log settings for the Worker.

enabled: boolean

Whether logs are enabled for the Worker.

invocation_logs: boolean

Whether invocation logs are enabled for the Worker.

destinations: optional array of string

A list of destinations where logs will be exported to.

head_sampling_rate: optional number

The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: optional boolean

Whether log persistence is enabled for the Worker.

traces: optional object { destinations, enabled, head_sampling_rate, persist }

Trace settings for the Worker.

destinations: optional array of string

A list of destinations where traces will be exported to.

enabled: optional boolean

Whether traces are enabled for the Worker.

head_sampling_rate: optional number

The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: optional boolean

Whether trace persistence is enabled for the Worker.

placement: optional object { mode, last_analyzed_at, status } or object { region, last_analyzed_at, status } or object { hostname, last_analyzed_at, status } or 5 more

Configuration for Smart Placement. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.

One of the following:
object { mode, last_analyzed_at, status }
mode: "smart"
last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { region, last_analyzed_at, status }
region: string

Cloud region for targeted placement in format ‘provider:region’.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { hostname, last_analyzed_at, status }
hostname: string

HTTP hostname for targeted placement.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { host, last_analyzed_at, status }
host: string

TCP host and port for targeted placement.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { mode, region, last_analyzed_at, status }
mode: "targeted"

Targeted placement mode.

region: string

Cloud region for targeted placement in format ‘provider:region’.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { hostname, mode, last_analyzed_at, status }
hostname: string

HTTP hostname for targeted placement.

mode: "targeted"

Targeted placement mode.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { host, mode, last_analyzed_at, status }
host: string

TCP host and port for targeted placement.

mode: "targeted"

Targeted placement mode.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { mode, target, last_analyzed_at, status }
mode: "targeted"

Targeted placement mode.

target: array of object { region } or object { hostname } or object { host }

Array of placement targets (currently limited to single target).

One of the following:
Region object { region }
region: string

Cloud region in format ‘provider:region’.

Hostname object { hostname }
hostname: string

HTTP hostname for targeted placement.

Host object { host }
host: string

TCP host:port for targeted placement.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
Deprecatedplacement_mode: optional "smart" or "targeted"

Configuration for Smart Placement. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.

One of the following:
"smart"
"targeted"
Deprecatedplacement_status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
tag: optional string

The immutable ID of the script.

tags: optional array of string

Tags associated with the Worker.

tail_consumers: optional array of ConsumerScript { service, environment, namespace }

List of Workers that will consume logs from the attached Worker.

service: string

Name of Worker that is to be the consumer.

environment: optional string

Optional environment if the Worker utilizes one.

namespace: optional string

Optional dispatch namespace the script belongs to.

usage_model: optional "standard" or "bundled" or "unbound"

Usage model for the Worker invocations.

One of the following:
"standard"
"bundled"
"unbound"
ScriptSetting object { logpush, observability, tags, tail_consumers }
logpush: optional boolean

Whether Logpush is turned on for the Worker.

observability: optional object { enabled, head_sampling_rate, logs, traces }

Observability settings for the Worker.

enabled: boolean

Whether observability is enabled for the Worker.

head_sampling_rate: optional number

The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

logs: optional object { enabled, invocation_logs, destinations, 2 more }

Log settings for the Worker.

enabled: boolean

Whether logs are enabled for the Worker.

invocation_logs: boolean

Whether invocation logs are enabled for the Worker.

destinations: optional array of string

A list of destinations where logs will be exported to.

head_sampling_rate: optional number

The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: optional boolean

Whether log persistence is enabled for the Worker.

traces: optional object { destinations, enabled, head_sampling_rate, persist }

Trace settings for the Worker.

destinations: optional array of string

A list of destinations where traces will be exported to.

enabled: optional boolean

Whether traces are enabled for the Worker.

head_sampling_rate: optional number

The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: optional boolean

Whether trace persistence is enabled for the Worker.

tags: optional array of string

Tags associated with the Worker.

tail_consumers: optional array of ConsumerScript { service, environment, namespace }

List of Workers that will consume logs from the attached Worker.

service: string

Name of Worker that is to be the consumer.

environment: optional string

Optional environment if the Worker utilizes one.

namespace: optional string

Optional dispatch namespace the script belongs to.

ScriptListResponse object { id, compatibility_date, compatibility_flags, 19 more }
id: optional string

The name used to identify the script.

compatibility_date: optional string

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

compatibility_flags: optional array of string

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.

created_on: optional string

When the script was created.

formatdate-time
etag: optional string

Hashed script content, can be used in a If-None-Match header when updating.

handlers: optional array of string

The names of handlers exported as part of the default export.

has_assets: optional boolean

Whether a Worker contains assets.

has_modules: optional boolean

Whether a Worker contains modules.

last_deployed_from: optional string

The client most recently used to deploy this Worker.

logpush: optional boolean

Whether Logpush is turned on for the Worker.

migration_tag: optional string

The tag of the Durable Object migration that was most recently applied for this Worker.

modified_on: optional string

When the script was last modified.

formatdate-time
named_handlers: optional array of object { handlers, name }

Named exports, such as Durable Object class implementations and named entrypoints.

handlers: optional array of string

The names of handlers exported as part of the named export.

name: optional string

The name of the export.

observability: optional object { enabled, head_sampling_rate, logs, traces }

Observability settings for the Worker.

enabled: boolean

Whether observability is enabled for the Worker.

head_sampling_rate: optional number

The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

logs: optional object { enabled, invocation_logs, destinations, 2 more }

Log settings for the Worker.

enabled: boolean

Whether logs are enabled for the Worker.

invocation_logs: boolean

Whether invocation logs are enabled for the Worker.

destinations: optional array of string

A list of destinations where logs will be exported to.

head_sampling_rate: optional number

The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: optional boolean

Whether log persistence is enabled for the Worker.

traces: optional object { destinations, enabled, head_sampling_rate, persist }

Trace settings for the Worker.

destinations: optional array of string

A list of destinations where traces will be exported to.

enabled: optional boolean

Whether traces are enabled for the Worker.

head_sampling_rate: optional number

The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: optional boolean

Whether trace persistence is enabled for the Worker.

placement: optional object { mode, last_analyzed_at, status } or object { region, last_analyzed_at, status } or object { hostname, last_analyzed_at, status } or 5 more

Configuration for Smart Placement. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.

One of the following:
object { mode, last_analyzed_at, status }
mode: "smart"
last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { region, last_analyzed_at, status }
region: string

Cloud region for targeted placement in format ‘provider:region’.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { hostname, last_analyzed_at, status }
hostname: string

HTTP hostname for targeted placement.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { host, last_analyzed_at, status }
host: string

TCP host and port for targeted placement.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { mode, region, last_analyzed_at, status }
mode: "targeted"

Targeted placement mode.

region: string

Cloud region for targeted placement in format ‘provider:region’.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { hostname, mode, last_analyzed_at, status }
hostname: string

HTTP hostname for targeted placement.

mode: "targeted"

Targeted placement mode.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { host, mode, last_analyzed_at, status }
host: string

TCP host and port for targeted placement.

mode: "targeted"

Targeted placement mode.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { mode, target, last_analyzed_at, status }
mode: "targeted"

Targeted placement mode.

target: array of object { region } or object { hostname } or object { host }

Array of placement targets (currently limited to single target).

One of the following:
Region object { region }
region: string

Cloud region in format ‘provider:region’.

Hostname object { hostname }
hostname: string

HTTP hostname for targeted placement.

Host object { host }
host: string

TCP host:port for targeted placement.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
Deprecatedplacement_mode: optional "smart" or "targeted"
One of the following:
"smart"
"targeted"
Deprecatedplacement_status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"
One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
routes: optional array of object { id, pattern, script }

Routes associated with the Worker.

id: string

Identifier.

maxLength32
pattern: string

Pattern to match incoming requests against. Learn more.

script: optional string

Name of the script to run if the route matches.

tag: optional string

The immutable ID of the script.

tags: optional array of string

Tags associated with the Worker.

tail_consumers: optional array of ConsumerScript { service, environment, namespace }

List of Workers that will consume logs from the attached Worker.

service: string

Name of Worker that is to be the consumer.

environment: optional string

Optional environment if the Worker utilizes one.

namespace: optional string

Optional dispatch namespace the script belongs to.

usage_model: optional "standard" or "bundled" or "unbound"

Usage model for the Worker invocations.

One of the following:
"standard"
"bundled"
"unbound"
ScriptSearchResponse = array of object { id, created_on, modified_on, 4 more }
id: string

Identifier.

maxLength32
created_on: string

When the script was created.

formatdate-time
modified_on: string

When the script was last modified.

formatdate-time
script_name: string

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

environment_is_default: optional boolean

Whether the environment is the default environment.

environment_name: optional string

Name of the environment.

service_name: optional string

Name of the service.

ScriptGetResponse = string
ScriptUpdateResponse object { startup_time_ms, id, compatibility_date, 20 more }
startup_time_ms: number
id: optional string

The name used to identify the script.

compatibility_date: optional string

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

compatibility_flags: optional array of string

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.

created_on: optional string

When the script was created.

formatdate-time
entry_point: optional string

The entry point for the script.

etag: optional string

Hashed script content, can be used in a If-None-Match header when updating.

handlers: optional array of string

The names of handlers exported as part of the default export.

has_assets: optional boolean

Whether a Worker contains assets.

has_modules: optional boolean

Whether a Worker contains modules.

last_deployed_from: optional string

The client most recently used to deploy this Worker.

logpush: optional boolean

Whether Logpush is turned on for the Worker.

migration_tag: optional string

The tag of the Durable Object migration that was most recently applied for this Worker.

modified_on: optional string

When the script was last modified.

formatdate-time
named_handlers: optional array of object { handlers, name }

Named exports, such as Durable Object class implementations and named entrypoints.

handlers: optional array of string

The names of handlers exported as part of the named export.

name: optional string

The name of the export.

observability: optional object { enabled, head_sampling_rate, logs, traces }

Observability settings for the Worker.

enabled: boolean

Whether observability is enabled for the Worker.

head_sampling_rate: optional number

The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

logs: optional object { enabled, invocation_logs, destinations, 2 more }

Log settings for the Worker.

enabled: boolean

Whether logs are enabled for the Worker.

invocation_logs: boolean

Whether invocation logs are enabled for the Worker.

destinations: optional array of string

A list of destinations where logs will be exported to.

head_sampling_rate: optional number

The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: optional boolean

Whether log persistence is enabled for the Worker.

traces: optional object { destinations, enabled, head_sampling_rate, persist }

Trace settings for the Worker.

destinations: optional array of string

A list of destinations where traces will be exported to.

enabled: optional boolean

Whether traces are enabled for the Worker.

head_sampling_rate: optional number

The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: optional boolean

Whether trace persistence is enabled for the Worker.

placement: optional object { mode, last_analyzed_at, status } or object { region, last_analyzed_at, status } or object { hostname, last_analyzed_at, status } or 5 more

Configuration for Smart Placement. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.

One of the following:
object { mode, last_analyzed_at, status }
mode: "smart"
last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { region, last_analyzed_at, status }
region: string

Cloud region for targeted placement in format ‘provider:region’.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { hostname, last_analyzed_at, status }
hostname: string

HTTP hostname for targeted placement.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { host, last_analyzed_at, status }
host: string

TCP host and port for targeted placement.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { mode, region, last_analyzed_at, status }
mode: "targeted"

Targeted placement mode.

region: string

Cloud region for targeted placement in format ‘provider:region’.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { hostname, mode, last_analyzed_at, status }
hostname: string

HTTP hostname for targeted placement.

mode: "targeted"

Targeted placement mode.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { host, mode, last_analyzed_at, status }
host: string

TCP host and port for targeted placement.

mode: "targeted"

Targeted placement mode.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
object { mode, target, last_analyzed_at, status }
mode: "targeted"

Targeted placement mode.

target: array of object { region } or object { hostname } or object { host }

Array of placement targets (currently limited to single target).

One of the following:
Region object { region }
region: string

Cloud region in format ‘provider:region’.

Hostname object { hostname }
hostname: string

HTTP hostname for targeted placement.

Host object { host }
host: string

TCP host:port for targeted placement.

last_analyzed_at: optional string

The last time the script was analyzed for Smart Placement.

formatdate-time
status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
Deprecatedplacement_mode: optional "smart" or "targeted"
One of the following:
"smart"
"targeted"
Deprecatedplacement_status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"
One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
tag: optional string

The immutable ID of the script.

tags: optional array of string

Tags associated with the Worker.

tail_consumers: optional array of ConsumerScript { service, environment, namespace }

List of Workers that will consume logs from the attached Worker.

service: string

Name of Worker that is to be the consumer.

environment: optional string

Optional environment if the Worker utilizes one.

namespace: optional string

Optional dispatch namespace the script belongs to.

usage_model: optional "standard" or "bundled" or "unbound"

Usage model for the Worker invocations.

One of the following:
"standard"
"bundled"
"unbound"
ScriptDeleteResponse = unknown

ScriptsAssets

ScriptsAssetsUpload

Create Assets Upload Session
POST/accounts/{account_id}/workers/scripts/{script_name}/assets-upload-session
ModelsExpand Collapse
UploadCreateResponse object { buckets, jwt }
buckets: optional array of array of string

The requests to make to upload assets.

jwt: optional string

A JWT to use as authentication for uploading assets.

ScriptsSubdomain

Get Worker subdomain
GET/accounts/{account_id}/workers/scripts/{script_name}/subdomain
Post Worker subdomain
POST/accounts/{account_id}/workers/scripts/{script_name}/subdomain
Delete Worker subdomain
DELETE/accounts/{account_id}/workers/scripts/{script_name}/subdomain
ModelsExpand Collapse
SubdomainGetResponse object { enabled, previews_enabled }
enabled: boolean

Whether the Worker is available on the workers.dev subdomain.

previews_enabled: boolean

Whether the Worker’s Preview URLs are available on the workers.dev subdomain.

SubdomainCreateResponse object { enabled, previews_enabled }
enabled: boolean

Whether the Worker is available on the workers.dev subdomain.

previews_enabled: boolean

Whether the Worker’s Preview URLs are available on the workers.dev subdomain.

SubdomainDeleteResponse object { enabled, previews_enabled }
enabled: boolean

Whether the Worker is available on the workers.dev subdomain.

previews_enabled: boolean

Whether the Worker’s Preview URLs are available on the workers.dev subdomain.

ScriptsSchedules

Get Cron Triggers
GET/accounts/{account_id}/workers/scripts/{script_name}/schedules
Update Cron Triggers
PUT/accounts/{account_id}/workers/scripts/{script_name}/schedules
ModelsExpand Collapse
ScheduleGetResponse object { schedules }
schedules: array of object { cron, created_on, modified_on }
cron: string
created_on: optional string
modified_on: optional string
ScheduleUpdateResponse object { schedules }
schedules: array of object { cron, created_on, modified_on }
cron: string
created_on: optional string
modified_on: optional string

ScriptsTail

List Tails
GET/accounts/{account_id}/workers/scripts/{script_name}/tails
Start Tail
POST/accounts/{account_id}/workers/scripts/{script_name}/tails
Delete Tail
DELETE/accounts/{account_id}/workers/scripts/{script_name}/tails/{id}
ModelsExpand Collapse
ConsumerScript object { service, environment, namespace }

A reference to a script that will consume logs from the attached Worker.

service: string

Name of Worker that is to be the consumer.

environment: optional string

Optional environment if the Worker utilizes one.

namespace: optional string

Optional dispatch namespace the script belongs to.

TailGetResponse object { id, expires_at, url }
id: string

Identifier.

maxLength32
expires_at: string
url: string
TailCreateResponse object { id, expires_at, url }
id: string

Identifier.

maxLength32
expires_at: string
url: string
TailDeleteResponse object { errors, messages, success }
errors: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
messages: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
success: true

Whether the API call was successful.

ScriptsContent

Get script content
GET/accounts/{account_id}/workers/scripts/{script_name}/content/v2
Put script content
PUT/accounts/{account_id}/workers/scripts/{script_name}/content

ScriptsSettings

Get Script Settings
GET/accounts/{account_id}/workers/scripts/{script_name}/script-settings
Patch Script Settings
PATCH/accounts/{account_id}/workers/scripts/{script_name}/script-settings

ScriptsDeployments

List Deployments
GET/accounts/{account_id}/workers/scripts/{script_name}/deployments
Create Deployment
POST/accounts/{account_id}/workers/scripts/{script_name}/deployments
Get Deployment
GET/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}
Delete Deployment
DELETE/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}
ModelsExpand Collapse
Deployment object { id, created_on, source, 4 more }
id: string
formatuuid
created_on: string
formatdate-time
source: string
strategy: "percentage"
versions: array of object { percentage, version_id }
percentage: number
maximum100
minimum0.01
version_id: string
formatuuid
annotations: optional object { "workers/message", "workers/triggered_by" }
"workers/message": optional string

Human-readable message about the deployment. Truncated to 1000 bytes if longer.

maxLength1000
"workers/triggered_by": optional string

Operation that triggered the creation of the deployment.

author_email: optional string
formatemail
DeploymentListResponse object { deployments }
deployments: array of Deployment { id, created_on, source, 4 more }
id: string
formatuuid
created_on: string
formatdate-time
source: string
strategy: "percentage"
versions: array of object { percentage, version_id }
percentage: number
maximum100
minimum0.01
version_id: string
formatuuid
annotations: optional object { "workers/message", "workers/triggered_by" }
"workers/message": optional string

Human-readable message about the deployment. Truncated to 1000 bytes if longer.

maxLength1000
"workers/triggered_by": optional string

Operation that triggered the creation of the deployment.

author_email: optional string
formatemail
DeploymentDeleteResponse object { errors, messages, success }
errors: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
messages: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
success: true

Whether the API call was successful.

ScriptsVersions

List Versions
GET/accounts/{account_id}/workers/scripts/{script_name}/versions
Get Version Detail
GET/accounts/{account_id}/workers/scripts/{script_name}/versions/{version_id}
Upload Version
POST/accounts/{account_id}/workers/scripts/{script_name}/versions
ModelsExpand Collapse
VersionListResponse object { id, metadata, number }
id: optional string

Unique identifier for the version.

metadata: optional object { author_email, author_id, created_on, 3 more }
author_email: optional string

Email of the user who created the version.

author_id: optional string

Identifier of the user who created the version.

created_on: optional string

When the version was created.

hasPreview: optional boolean

Whether the version can be previewed.

modified_on: optional string

When the version was last modified.

source: optional "unknown" or "api" or "wrangler" or 7 more

The source of the version upload.

One of the following:
"unknown"
"api"
"wrangler"
"terraform"
"dash"
"dash_template"
"integration"
"quick_editor"
"playground"
"workersci"
number: optional number

Sequential version number.

VersionGetResponse object { resources, id, metadata, number }
resources: object { bindings, script, script_runtime }
bindings: optional array of object { name, type } or object { instance_name, name, type, namespace } or object { name, namespace, type } or 32 more

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.

One of the following:
AI object { name, type }
name: string

A JavaScript variable name for the binding.

type: "ai"

The kind of resource that the binding provides.

AISearch object { instance_name, name, type, namespace }
instance_name: string

The user-chosen instance name. Must exist at deploy time. The worker can search, chat, update, and manage items/jobs on this instance.

name: string

A JavaScript variable name for the binding.

type: "ai_search"

The kind of resource that the binding provides.

namespace: optional string

The namespace the instance belongs to. Defaults to “default” if omitted. Customers who don’t use namespaces can simply omit this field.

AISearchNamespace object { name, namespace, type }
name: string

A JavaScript variable name for the binding.

namespace: string

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: "ai_search_namespace"

The kind of resource that the binding provides.

AnalyticsEngine object { dataset, name, type }
dataset: string

The name of the dataset to bind to.

name: string

A JavaScript variable name for the binding.

type: "analytics_engine"

The kind of resource that the binding provides.

Assets object { name, type }
name: string

A JavaScript variable name for the binding.

type: "assets"

The kind of resource that the binding provides.

Browser object { name, type }
name: string

A JavaScript variable name for the binding.

type: "browser"

The kind of resource that the binding provides.

D1 object { database_id, name, type, id }
database_id: string

Identifier of the D1 database to bind to.

name: string

A JavaScript variable name for the binding.

type: "d1"

The kind of resource that the binding provides.

Deprecatedid: optional string
This property has been renamed to `database_id`.

Identifier of the D1 database to bind to.

DataBlob object { name, part, type }
name: string

A JavaScript variable name for the binding.

part: string

The name of the file containing the data content. Only accepted for service worker syntax Workers.

Deprecatedtype: "data_blob"

The kind of resource that the binding provides.

DispatchNamespace object { name, namespace, type, outbound }
name: string

A JavaScript variable name for the binding.

namespace: string

The name of the dispatch namespace.

type: "dispatch_namespace"

The kind of resource that the binding provides.

outbound: optional object { params, worker }

Outbound worker.

params: optional array of object { name }

Pass information from the Dispatch Worker to the Outbound Worker through the parameters.

name: string

Name of the parameter.

worker: optional object { entrypoint, environment, service }

Outbound worker.

entrypoint: optional string

Entrypoint to invoke on the outbound worker.

environment: optional string

Environment of the outbound worker.

service: optional string

Name of the outbound worker.

DurableObjectNamespace object { name, type, class_name, 4 more }
name: string

A JavaScript variable name for the binding.

type: "durable_object_namespace"

The kind of resource that the binding provides.

class_name: optional string

The exported class name of the Durable Object.

dispatch_namespace: optional string

The dispatch namespace the Durable Object script belongs to.

environment: optional string

The environment of the script_name to bind to.

namespace_id: optional string

Namespace identifier tag.

maxLength32
script_name: optional string

The script where the Durable Object is defined, if it is external to this Worker.

Hyperdrive object { id, name, type }
id: string

Identifier of the Hyperdrive connection to bind to.

name: string

A JavaScript variable name for the binding.

type: "hyperdrive"

The kind of resource that the binding provides.

Inherit object { name, type, old_name, version_id }
name: string

The name of the inherited binding.

type: "inherit"

The kind of resource that the binding provides.

old_name: optional string

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.

version_id: optional string

Identifier for the version to inherit the binding from, which can be the version ID or the literal “latest” to inherit from the latest version. Defaults to inheriting the binding from the latest version.

Images object { name, type }
name: string

A JavaScript variable name for the binding.

type: "images"

The kind of resource that the binding provides.

Json object { json, name, type }
json: unknown

JSON data to use.

name: string

A JavaScript variable name for the binding.

type: "json"

The kind of resource that the binding provides.

KVNamespace object { name, namespace_id, type }
name: string

A JavaScript variable name for the binding.

namespace_id: string

Namespace identifier tag.

maxLength32
type: "kv_namespace"

The kind of resource that the binding provides.

Media object { name, type }
name: string

A JavaScript variable name for the binding.

type: "media"

The kind of resource that the binding provides.

MTLSCertificate object { certificate_id, name, type }
certificate_id: string

Identifier of the certificate to bind to.

name: string

A JavaScript variable name for the binding.

type: "mtls_certificate"

The kind of resource that the binding provides.

PlainText object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The text value to use.

type: "plain_text"

The kind of resource that the binding provides.

Pipelines object { name, pipeline, type }
name: string

A JavaScript variable name for the binding.

pipeline: string

Name of the Pipeline to bind to.

type: "pipelines"

The kind of resource that the binding provides.

Queue object { name, queue_name, type }
name: string

A JavaScript variable name for the binding.

queue_name: string

Name of the Queue to bind to.

type: "queue"

The kind of resource that the binding provides.

Ratelimit object { name, namespace_id, simple, type }
name: string

A JavaScript variable name for the binding.

namespace_id: string

Identifier of the rate limit namespace to bind to.

simple: object { limit, period }

The rate limit configuration.

limit: number

The limit (requests per period).

period: number

The period in seconds.

type: "ratelimit"

The kind of resource that the binding provides.

R2Bucket object { bucket_name, name, type, jurisdiction }
bucket_name: string

R2 bucket to bind to.

name: string

A JavaScript variable name for the binding.

type: "r2_bucket"

The kind of resource that the binding provides.

jurisdiction: optional "eu" or "fedramp" or "fedramp-high"

The jurisdiction of the R2 bucket.

One of the following:
"eu"
"fedramp"
"fedramp-high"
SecretText object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

SendEmail object { name, type, allowed_destination_addresses, 2 more }
name: string

A JavaScript variable name for the binding.

type: "send_email"

The kind of resource that the binding provides.

allowed_destination_addresses: optional array of string

List of allowed destination addresses.

allowed_sender_addresses: optional array of string

List of allowed sender addresses.

destination_address: optional string

Destination address for the email.

formatemail
Service object { name, service, type, 2 more }
name: string

A JavaScript variable name for the binding.

service: string

Name of Worker to bind to.

type: "service"

The kind of resource that the binding provides.

entrypoint: optional string

Entrypoint to invoke on the target Worker.

environment: optional string

Optional environment if the Worker utilizes one.

TextBlob object { name, part, type }
name: string

A JavaScript variable name for the binding.

part: string

The name of the file containing the text content. Only accepted for service worker syntax Workers.

Deprecatedtype: "text_blob"

The kind of resource that the binding provides.

Vectorize object { index_name, name, type }
index_name: string

Name of the Vectorize index to bind to.

name: string

A JavaScript variable name for the binding.

type: "vectorize"

The kind of resource that the binding provides.

VersionMetadata object { name, type }
name: string

A JavaScript variable name for the binding.

type: "version_metadata"

The kind of resource that the binding provides.

SecretsStoreSecret object { name, secret_name, store_id, type }
name: string

A JavaScript variable name for the binding.

secret_name: string

Name of the secret in the store.

store_id: string

ID of the store containing the secret.

type: "secrets_store_secret"

The kind of resource that the binding provides.

Flagship object { app_id, name, type }
app_id: string

ID of the Flagship app to bind to for feature flag evaluation.

maxLength128
name: string

A JavaScript variable name for the binding.

type: "flagship"

The kind of resource that the binding provides.

SecretKey object { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" or "pkcs8" or "spki" or "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: array of "encrypt" or "decrypt" or "sign" or 5 more

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: optional string

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: optional unknown

Key data in JSON Web Key format. Required if format is “jwk”.

Workflow object { name, type, workflow_name, 2 more }
name: string

A JavaScript variable name for the binding.

type: "workflow"

The kind of resource that the binding provides.

workflow_name: string

Name of the Workflow to bind to.

class_name: optional string

Class name of the Workflow. Should only be provided if the Workflow belongs to this script.

script_name: optional string

Script name that contains the Workflow. If not provided, defaults to this script name.

WasmModule object { name, part, type }
name: string

A JavaScript variable name for the binding.

part: string

The name of the file containing the WebAssembly module content. Only accepted for service worker syntax Workers.

Deprecatedtype: "wasm_module"

The kind of resource that the binding provides.

VPCService object { name, service_id, type }
name: string

A JavaScript variable name for the binding.

service_id: string

Identifier of the VPC service to bind to.

type: "vpc_service"

The kind of resource that the binding provides.

VPCNetwork object { name, type, network_id, tunnel_id }
name: string

A JavaScript variable name for the binding.

type: "vpc_network"

The kind of resource that the binding provides.

network_id: optional string

Identifier of the network to bind to. Only “cf1:network” is currently supported. Mutually exclusive with tunnel_id.

tunnel_id: optional string

UUID of the Cloudflare Tunnel to bind to. Mutually exclusive with network_id.

script: optional object { etag, handlers, last_deployed_from, named_handlers }
etag: optional string

Hashed script content

handlers: optional array of string

The names of handlers exported as part of the default export.

last_deployed_from: optional string

The client most recently used to deploy this Worker.

named_handlers: optional array of object { handlers, name }

Named exports, such as Durable Object class implementations and named entrypoints.

handlers: optional array of string

The names of handlers exported as part of the named export.

name: optional string

The name of the exported class or entrypoint.

script_runtime: optional object { compatibility_date, compatibility_flags, limits, 2 more }

Runtime configuration for the Worker.

compatibility_date: optional string

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

compatibility_flags: optional array of string

Flags that enable or disable certain features in the Workers runtime.

limits: optional object { cpu_ms }

Resource limits for the Worker.

cpu_ms: optional number

The amount of CPU time this Worker can use in milliseconds.

migration_tag: optional string

The tag of the Durable Object migration that was most recently applied for this Worker.

usage_model: optional "bundled" or "unbound" or "standard"

Usage model for the Worker invocations.

One of the following:
"bundled"
"unbound"
"standard"
id: optional string

Unique identifier for the version.

metadata: optional object { author_email, author_id, created_on, 3 more }
author_email: optional string

Email of the user who created the version.

author_id: optional string

Identifier of the user who created the version.

created_on: optional string

When the version was created.

hasPreview: optional boolean

Whether the version can be previewed.

modified_on: optional string

When the version was last modified.

source: optional "unknown" or "api" or "wrangler" or 7 more

The source of the version upload.

One of the following:
"unknown"
"api"
"wrangler"
"terraform"
"dash"
"dash_template"
"integration"
"quick_editor"
"playground"
"workersci"
number: optional number

Sequential version number.

VersionCreateResponse object { resources, id, metadata, 2 more }
resources: object { bindings, script, script_runtime }
bindings: optional array of object { name, type } or object { instance_name, name, type, namespace } or object { name, namespace, type } or 32 more

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.

One of the following:
AI object { name, type }
name: string

A JavaScript variable name for the binding.

type: "ai"

The kind of resource that the binding provides.

AISearch object { instance_name, name, type, namespace }
instance_name: string

The user-chosen instance name. Must exist at deploy time. The worker can search, chat, update, and manage items/jobs on this instance.

name: string

A JavaScript variable name for the binding.

type: "ai_search"

The kind of resource that the binding provides.

namespace: optional string

The namespace the instance belongs to. Defaults to “default” if omitted. Customers who don’t use namespaces can simply omit this field.

AISearchNamespace object { name, namespace, type }
name: string

A JavaScript variable name for the binding.

namespace: string

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: "ai_search_namespace"

The kind of resource that the binding provides.

AnalyticsEngine object { dataset, name, type }
dataset: string

The name of the dataset to bind to.

name: string

A JavaScript variable name for the binding.

type: "analytics_engine"

The kind of resource that the binding provides.

Assets object { name, type }
name: string

A JavaScript variable name for the binding.

type: "assets"

The kind of resource that the binding provides.

Browser object { name, type }
name: string

A JavaScript variable name for the binding.

type: "browser"

The kind of resource that the binding provides.

D1 object { database_id, name, type, id }
database_id: string

Identifier of the D1 database to bind to.

name: string

A JavaScript variable name for the binding.

type: "d1"

The kind of resource that the binding provides.

Deprecatedid: optional string
This property has been renamed to `database_id`.

Identifier of the D1 database to bind to.

DataBlob object { name, part, type }
name: string

A JavaScript variable name for the binding.

part: string

The name of the file containing the data content. Only accepted for service worker syntax Workers.

Deprecatedtype: "data_blob"

The kind of resource that the binding provides.

DispatchNamespace object { name, namespace, type, outbound }
name: string

A JavaScript variable name for the binding.

namespace: string

The name of the dispatch namespace.

type: "dispatch_namespace"

The kind of resource that the binding provides.

outbound: optional object { params, worker }

Outbound worker.

params: optional array of object { name }

Pass information from the Dispatch Worker to the Outbound Worker through the parameters.

name: string

Name of the parameter.

worker: optional object { entrypoint, environment, service }

Outbound worker.

entrypoint: optional string

Entrypoint to invoke on the outbound worker.

environment: optional string

Environment of the outbound worker.

service: optional string

Name of the outbound worker.

DurableObjectNamespace object { name, type, class_name, 4 more }
name: string

A JavaScript variable name for the binding.

type: "durable_object_namespace"

The kind of resource that the binding provides.

class_name: optional string

The exported class name of the Durable Object.

dispatch_namespace: optional string

The dispatch namespace the Durable Object script belongs to.

environment: optional string

The environment of the script_name to bind to.

namespace_id: optional string

Namespace identifier tag.

maxLength32
script_name: optional string

The script where the Durable Object is defined, if it is external to this Worker.

Hyperdrive object { id, name, type }
id: string

Identifier of the Hyperdrive connection to bind to.

name: string

A JavaScript variable name for the binding.

type: "hyperdrive"

The kind of resource that the binding provides.

Inherit object { name, type, old_name, version_id }
name: string

The name of the inherited binding.

type: "inherit"

The kind of resource that the binding provides.

old_name: optional string

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.

version_id: optional string

Identifier for the version to inherit the binding from, which can be the version ID or the literal “latest” to inherit from the latest version. Defaults to inheriting the binding from the latest version.

Images object { name, type }
name: string

A JavaScript variable name for the binding.

type: "images"

The kind of resource that the binding provides.

Json object { json, name, type }
json: unknown

JSON data to use.

name: string

A JavaScript variable name for the binding.

type: "json"

The kind of resource that the binding provides.

KVNamespace object { name, namespace_id, type }
name: string

A JavaScript variable name for the binding.

namespace_id: string

Namespace identifier tag.

maxLength32
type: "kv_namespace"

The kind of resource that the binding provides.

Media object { name, type }
name: string

A JavaScript variable name for the binding.

type: "media"

The kind of resource that the binding provides.

MTLSCertificate object { certificate_id, name, type }
certificate_id: string

Identifier of the certificate to bind to.

name: string

A JavaScript variable name for the binding.

type: "mtls_certificate"

The kind of resource that the binding provides.

PlainText object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The text value to use.

type: "plain_text"

The kind of resource that the binding provides.

Pipelines object { name, pipeline, type }
name: string

A JavaScript variable name for the binding.

pipeline: string

Name of the Pipeline to bind to.

type: "pipelines"

The kind of resource that the binding provides.

Queue object { name, queue_name, type }
name: string

A JavaScript variable name for the binding.

queue_name: string

Name of the Queue to bind to.

type: "queue"

The kind of resource that the binding provides.

Ratelimit object { name, namespace_id, simple, type }
name: string

A JavaScript variable name for the binding.

namespace_id: string

Identifier of the rate limit namespace to bind to.

simple: object { limit, period }

The rate limit configuration.

limit: number

The limit (requests per period).

period: number

The period in seconds.

type: "ratelimit"

The kind of resource that the binding provides.

R2Bucket object { bucket_name, name, type, jurisdiction }
bucket_name: string

R2 bucket to bind to.

name: string

A JavaScript variable name for the binding.

type: "r2_bucket"

The kind of resource that the binding provides.

jurisdiction: optional "eu" or "fedramp" or "fedramp-high"

The jurisdiction of the R2 bucket.

One of the following:
"eu"
"fedramp"
"fedramp-high"
SecretText object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

SendEmail object { name, type, allowed_destination_addresses, 2 more }
name: string

A JavaScript variable name for the binding.

type: "send_email"

The kind of resource that the binding provides.

allowed_destination_addresses: optional array of string

List of allowed destination addresses.

allowed_sender_addresses: optional array of string

List of allowed sender addresses.

destination_address: optional string

Destination address for the email.

formatemail
Service object { name, service, type, 2 more }
name: string

A JavaScript variable name for the binding.

service: string

Name of Worker to bind to.

type: "service"

The kind of resource that the binding provides.

entrypoint: optional string

Entrypoint to invoke on the target Worker.

environment: optional string

Optional environment if the Worker utilizes one.

TextBlob object { name, part, type }
name: string

A JavaScript variable name for the binding.

part: string

The name of the file containing the text content. Only accepted for service worker syntax Workers.

Deprecatedtype: "text_blob"

The kind of resource that the binding provides.

Vectorize object { index_name, name, type }
index_name: string

Name of the Vectorize index to bind to.

name: string

A JavaScript variable name for the binding.

type: "vectorize"

The kind of resource that the binding provides.

VersionMetadata object { name, type }
name: string

A JavaScript variable name for the binding.

type: "version_metadata"

The kind of resource that the binding provides.

SecretsStoreSecret object { name, secret_name, store_id, type }
name: string

A JavaScript variable name for the binding.

secret_name: string

Name of the secret in the store.

store_id: string

ID of the store containing the secret.

type: "secrets_store_secret"

The kind of resource that the binding provides.

Flagship object { app_id, name, type }
app_id: string

ID of the Flagship app to bind to for feature flag evaluation.

maxLength128
name: string

A JavaScript variable name for the binding.

type: "flagship"

The kind of resource that the binding provides.

SecretKey object { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" or "pkcs8" or "spki" or "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: array of "encrypt" or "decrypt" or "sign" or 5 more

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: optional string

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: optional unknown

Key data in JSON Web Key format. Required if format is “jwk”.

Workflow object { name, type, workflow_name, 2 more }
name: string

A JavaScript variable name for the binding.

type: "workflow"

The kind of resource that the binding provides.

workflow_name: string

Name of the Workflow to bind to.

class_name: optional string

Class name of the Workflow. Should only be provided if the Workflow belongs to this script.

script_name: optional string

Script name that contains the Workflow. If not provided, defaults to this script name.

WasmModule object { name, part, type }
name: string

A JavaScript variable name for the binding.

part: string

The name of the file containing the WebAssembly module content. Only accepted for service worker syntax Workers.

Deprecatedtype: "wasm_module"

The kind of resource that the binding provides.

VPCService object { name, service_id, type }
name: string

A JavaScript variable name for the binding.

service_id: string

Identifier of the VPC service to bind to.

type: "vpc_service"

The kind of resource that the binding provides.

VPCNetwork object { name, type, network_id, tunnel_id }
name: string

A JavaScript variable name for the binding.

type: "vpc_network"

The kind of resource that the binding provides.

network_id: optional string

Identifier of the network to bind to. Only “cf1:network” is currently supported. Mutually exclusive with tunnel_id.

tunnel_id: optional string

UUID of the Cloudflare Tunnel to bind to. Mutually exclusive with network_id.

script: optional object { etag, handlers, last_deployed_from, named_handlers }
etag: optional string

Hashed script content

handlers: optional array of string

The names of handlers exported as part of the default export.

last_deployed_from: optional string

The client most recently used to deploy this Worker.

named_handlers: optional array of object { handlers, name }

Named exports, such as Durable Object class implementations and named entrypoints.

handlers: optional array of string

The names of handlers exported as part of the named export.

name: optional string

The name of the exported class or entrypoint.

script_runtime: optional object { compatibility_date, compatibility_flags, limits, 2 more }

Runtime configuration for the Worker.

compatibility_date: optional string

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

compatibility_flags: optional array of string

Flags that enable or disable certain features in the Workers runtime.

limits: optional object { cpu_ms }

Resource limits for the Worker.

cpu_ms: optional number

The amount of CPU time this Worker can use in milliseconds.

migration_tag: optional string

The tag of the Durable Object migration that was most recently applied for this Worker.

usage_model: optional "bundled" or "unbound" or "standard"

Usage model for the Worker invocations.

One of the following:
"bundled"
"unbound"
"standard"
id: optional string

Unique identifier for the version.

metadata: optional object { author_email, author_id, created_on, 3 more }
author_email: optional string

Email of the user who created the version.

author_id: optional string

Identifier of the user who created the version.

created_on: optional string

When the version was created.

hasPreview: optional boolean

Whether the version can be previewed.

modified_on: optional string

When the version was last modified.

source: optional "unknown" or "api" or "wrangler" or 7 more

The source of the version upload.

One of the following:
"unknown"
"api"
"wrangler"
"terraform"
"dash"
"dash_template"
"integration"
"quick_editor"
"playground"
"workersci"
number: optional number

Sequential version number.

startup_time_ms: optional number

Time in milliseconds spent on Worker startup.

ScriptsSecrets

List script secrets
GET/accounts/{account_id}/workers/scripts/{script_name}/secrets
Get secret binding
GET/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}
Add script secret
PUT/accounts/{account_id}/workers/scripts/{script_name}/secrets
Delete script secret
DELETE/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}
ModelsExpand Collapse
SecretListResponse = object { name, text, type } or object { algorithm, format, name, 4 more }

A secret value accessible through a binding.

One of the following:
SecretText object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

SecretKey object { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" or "pkcs8" or "spki" or "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: array of "encrypt" or "decrypt" or "sign" or 5 more

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: optional string

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: optional unknown

Key data in JSON Web Key format. Required if format is “jwk”.

SecretGetResponse = object { name, text, type } or object { algorithm, format, name, 4 more }

A secret value accessible through a binding.

One of the following:
SecretText object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

SecretKey object { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" or "pkcs8" or "spki" or "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: array of "encrypt" or "decrypt" or "sign" or 5 more

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: optional string

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: optional unknown

Key data in JSON Web Key format. Required if format is “jwk”.

SecretUpdateResponse = object { name, text, type } or object { algorithm, format, name, 4 more }

A secret value accessible through a binding.

One of the following:
SecretText object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

SecretKey object { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" or "pkcs8" or "spki" or "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: array of "encrypt" or "decrypt" or "sign" or 5 more

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: optional string

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: optional unknown

Key data in JSON Web Key format. Required if format is “jwk”.

SecretDeleteResponse = unknown

ScriptsScript And Version Settings

Get Settings
GET/accounts/{account_id}/workers/scripts/{script_name}/settings
Patch Settings
PATCH/accounts/{account_id}/workers/scripts/{script_name}/settings
ModelsExpand Collapse
ScriptAndVersionSettingGetResponse object { annotations, bindings, compatibility_date, 9 more }
annotations: optional object { "workers/message", "workers/tag", "workers/triggered_by" }

Annotations for the Worker version. Annotations are not inherited across settings updates; omitting this field means the new version will have no annotations.

"workers/message": optional string

Human-readable message about the version. Truncated to 1000 bytes if longer.

maxLength1000
"workers/tag": optional string

User-provided identifier for the version. Maximum 100 bytes.

maxLength100
"workers/triggered_by": optional string

Operation that triggered the creation of the version. This is read-only and set by the server.

bindings: optional array of object { name, type } or object { instance_name, name, type, namespace } or object { name, namespace, type } or 32 more

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.

One of the following:
AI object { name, type }
name: string

A JavaScript variable name for the binding.

type: "ai"

The kind of resource that the binding provides.

AISearch object { instance_name, name, type, namespace }
instance_name: string

The user-chosen instance name. Must exist at deploy time. The worker can search, chat, update, and manage items/jobs on this instance.

name: string

A JavaScript variable name for the binding.

type: "ai_search"

The kind of resource that the binding provides.

namespace: optional string

The namespace the instance belongs to. Defaults to “default” if omitted. Customers who don’t use namespaces can simply omit this field.

AISearchNamespace object { name, namespace, type }
name: string

A JavaScript variable name for the binding.

namespace: string

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: "ai_search_namespace"

The kind of resource that the binding provides.

AnalyticsEngine object { dataset, name, type }
dataset: string

The name of the dataset to bind to.

name: string

A JavaScript variable name for the binding.

type: "analytics_engine"

The kind of resource that the binding provides.

Assets object { name, type }
name: string

A JavaScript variable name for the binding.

type: "assets"

The kind of resource that the binding provides.

Browser object { name, type }
name: string

A JavaScript variable name for the binding.

type: "browser"

The kind of resource that the binding provides.

D1 object { database_id, name, type, id }
database_id: string

Identifier of the D1 database to bind to.

name: string

A JavaScript variable name for the binding.

type: "d1"

The kind of resource that the binding provides.

Deprecatedid: optional string
This property has been renamed to `database_id`.

Identifier of the D1 database to bind to.

DataBlob object { name, part, type }
name: string

A JavaScript variable name for the binding.

part: string

The name of the file containing the data content. Only accepted for service worker syntax Workers.

Deprecatedtype: "data_blob"

The kind of resource that the binding provides.

DispatchNamespace object { name, namespace, type, outbound }
name: string

A JavaScript variable name for the binding.

namespace: string

The name of the dispatch namespace.

type: "dispatch_namespace"

The kind of resource that the binding provides.

outbound: optional object { params, worker }

Outbound worker.

params: optional array of object { name }

Pass information from the Dispatch Worker to the Outbound Worker through the parameters.

name: string

Name of the parameter.

worker: optional object { entrypoint, environment, service }

Outbound worker.

entrypoint: optional string

Entrypoint to invoke on the outbound worker.

environment: optional string

Environment of the outbound worker.

service: optional string

Name of the outbound worker.

DurableObjectNamespace object { name, type, class_name, 4 more }
name: string

A JavaScript variable name for the binding.

type: "durable_object_namespace"

The kind of resource that the binding provides.

class_name: optional string

The exported class name of the Durable Object.

dispatch_namespace: optional string

The dispatch namespace the Durable Object script belongs to.

environment: optional string

The environment of the script_name to bind to.

namespace_id: optional string

Namespace identifier tag.

maxLength32
script_name: optional string

The script where the Durable Object is defined, if it is external to this Worker.

Hyperdrive object { id, name, type }
id: string

Identifier of the Hyperdrive connection to bind to.

name: string

A JavaScript variable name for the binding.

type: "hyperdrive"

The kind of resource that the binding provides.

Inherit object { name, type, old_name, version_id }
name: string

The name of the inherited binding.

type: "inherit"

The kind of resource that the binding provides.

old_name: optional string

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.

version_id: optional string

Identifier for the version to inherit the binding from, which can be the version ID or the literal “latest” to inherit from the latest version. Defaults to inheriting the binding from the latest version.

Images object { name, type }
name: string

A JavaScript variable name for the binding.

type: "images"

The kind of resource that the binding provides.

Json object { json, name, type }
json: unknown

JSON data to use.

name: string

A JavaScript variable name for the binding.

type: "json"

The kind of resource that the binding provides.

KVNamespace object { name, namespace_id, type }
name: string

A JavaScript variable name for the binding.

namespace_id: string

Namespace identifier tag.

maxLength32
type: "kv_namespace"

The kind of resource that the binding provides.

Media object { name, type }
name: string

A JavaScript variable name for the binding.

type: "media"

The kind of resource that the binding provides.

MTLSCertificate object { certificate_id, name, type }
certificate_id: string

Identifier of the certificate to bind to.

name: string

A JavaScript variable name for the binding.

type: "mtls_certificate"

The kind of resource that the binding provides.

PlainText object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The text value to use.

type: "plain_text"

The kind of resource that the binding provides.

Pipelines object { name, pipeline, type }
name: string

A JavaScript variable name for the binding.

pipeline: string

Name of the Pipeline to bind to.

type: "pipelines"

The kind of resource that the binding provides.

Queue object { name, queue_name, type }
name: string

A JavaScript variable name for the binding.

queue_name: string

Name of the Queue to bind to.

type: "queue"

The kind of resource that the binding provides.

Ratelimit object { name, namespace_id, simple, type }
name: string

A JavaScript variable name for the binding.

namespace_id: string

Identifier of the rate limit namespace to bind to.

simple: object { limit, period }

The rate limit configuration.

limit: number

The limit (requests per period).

period: number

The period in seconds.

type: "ratelimit"

The kind of resource that the binding provides.

R2Bucket object { bucket_name, name, type, jurisdiction }
bucket_name: string

R2 bucket to bind to.

name: string

A JavaScript variable name for the binding.

type: "r2_bucket"

The kind of resource that the binding provides.

jurisdiction: optional "eu" or "fedramp" or "fedramp-high"

The jurisdiction of the R2 bucket.

One of the following:
"eu"
"fedramp"
"fedramp-high"
SecretText object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

SendEmail object { name, type, allowed_destination_addresses, 2 more }
name: string

A JavaScript variable name for the binding.

type: "send_email"

The kind of resource that the binding provides.

allowed_destination_addresses: optional array of string

List of allowed destination addresses.

allowed_sender_addresses: optional array of string

List of allowed sender addresses.

destination_address: optional string

Destination address for the email.

formatemail
Service object { name, service, type, 2 more }
name: string

A JavaScript variable name for the binding.

service: string

Name of Worker to bind to.

type: "service"

The kind of resource that the binding provides.

entrypoint: optional string

Entrypoint to invoke on the target Worker.

environment: optional string

Optional environment if the Worker utilizes one.

TextBlob object { name, part, type }
name: string

A JavaScript variable name for the binding.

part: string

The name of the file containing the text content. Only accepted for service worker syntax Workers.

Deprecatedtype: "text_blob"

The kind of resource that the binding provides.

Vectorize object { index_name, name, type }
index_name: string

Name of the Vectorize index to bind to.

name: string

A JavaScript variable name for the binding.

type: "vectorize"

The kind of resource that the binding provides.

VersionMetadata object { name, type }
name: string

A JavaScript variable name for the binding.

type: "version_metadata"

The kind of resource that the binding provides.

SecretsStoreSecret object { name, secret_name, store_id, type }
name: string

A JavaScript variable name for the binding.

secret_name: string

Name of the secret in the store.

store_id: string

ID of the store containing the secret.

type: "secrets_store_secret"

The kind of resource that the binding provides.

Flagship object { app_id, name, type }
app_id: string

ID of the Flagship app to bind to for feature flag evaluation.

maxLength128
name: string

A JavaScript variable name for the binding.

type: "flagship"

The kind of resource that the binding provides.

SecretKey object { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" or "pkcs8" or "spki" or "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: array of "encrypt" or "decrypt" or "sign" or 5 more

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: optional string

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: optional unknown

Key data in JSON Web Key format. Required if format is “jwk”.

Workflow object { name, type, workflow_name, 2 more }
name: string

A JavaScript variable name for the binding.

type: "workflow"

The kind of resource that the binding provides.

workflow_name: string

Name of the Workflow to bind to.

class_name: optional string

Class name of the Workflow. Should only be provided if the Workflow belongs to this script.

script_name: optional string

Script name that contains the Workflow. If not provided, defaults to this script name.

WasmModule object { name, part, type }
name: string

A JavaScript variable name for the binding.

part: string

The name of the file containing the WebAssembly module content. Only accepted for service worker syntax Workers.

Deprecatedtype: "wasm_module"

The kind of resource that the binding provides.

VPCService object { name, service_id, type }
name: string

A JavaScript variable name for the binding.

service_id: string

Identifier of the VPC service to bind to.

type: "vpc_service"

The kind of resource that the binding provides.

VPCNetwork object { name, type, network_id, tunnel_id }
name: string

A JavaScript variable name for the binding.

type: "vpc_network"

The kind of resource that the binding provides.

network_id: optional string

Identifier of the network to bind to. Only “cf1:network” is currently supported. Mutually exclusive with tunnel_id.

tunnel_id: optional string

UUID of the Cloudflare Tunnel to bind to. Mutually exclusive with network_id.

compatibility_date: optional string

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

compatibility_flags: optional array of string

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.

limits: optional object { cpu_ms, subrequests }

Limits to apply for this Worker.

cpu_ms: optional number

The amount of CPU time this Worker can use in milliseconds.

subrequests: optional number

The number of subrequests this Worker can make per request.

logpush: optional boolean

Whether Logpush is turned on for the Worker.

migrations: optional SingleStepMigration { deleted_classes, new_classes, new_sqlite_classes, 4 more } or object { new_tag, old_tag, steps }

Migrations to apply for Durable Objects associated with this Worker.

One of the following:
SingleStepMigration object { deleted_classes, new_classes, new_sqlite_classes, 4 more }

A single set of migrations to apply.

deleted_classes: optional array of string

A list of classes to delete Durable Object namespaces from.

new_classes: optional array of string

A list of classes to create Durable Object namespaces from.

new_sqlite_classes: optional array of string

A list of classes to create Durable Object namespaces with SQLite from.

new_tag: optional string

Tag to set as the latest migration tag.

old_tag: optional string

Tag used to verify against the latest migration tag for this Worker. If they don’t match, the upload is rejected.

renamed_classes: optional array of object { from, to }

A list of classes with Durable Object namespaces that were renamed.

from: optional string
to: optional string
transferred_classes: optional array of object { from, from_script, to }

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from: optional string
from_script: optional string
to: optional string
WorkersMultipleStepMigrations object { new_tag, old_tag, steps }
new_tag: optional string

Tag to set as the latest migration tag.

old_tag: optional string

Tag used to verify against the latest migration tag for this Worker. If they don’t match, the upload is rejected.

steps: optional array of MigrationStep { deleted_classes, new_classes, new_sqlite_classes, 2 more }

Migrations to apply in order.

deleted_classes: optional array of string

A list of classes to delete Durable Object namespaces from.

new_classes: optional array of string

A list of classes to create Durable Object namespaces from.

new_sqlite_classes: optional array of string

A list of classes to create Durable Object namespaces with SQLite from.

renamed_classes: optional array of object { from, to }

A list of classes with Durable Object namespaces that were renamed.

from: optional string
to: optional string
transferred_classes: optional array of object { from, from_script, to }

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from: optional string
from_script: optional string
to: optional string
observability: optional object { enabled, head_sampling_rate, logs, traces }

Observability settings for the Worker.

enabled: boolean

Whether observability is enabled for the Worker.

head_sampling_rate: optional number

The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

logs: optional object { enabled, invocation_logs, destinations, 2 more }

Log settings for the Worker.

enabled: boolean

Whether logs are enabled for the Worker.

invocation_logs: boolean

Whether invocation logs are enabled for the Worker.

destinations: optional array of string

A list of destinations where logs will be exported to.

head_sampling_rate: optional number

The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: optional boolean

Whether log persistence is enabled for the Worker.

traces: optional object { destinations, enabled, head_sampling_rate, persist }

Trace settings for the Worker.

destinations: optional array of string

A list of destinations where traces will be exported to.

enabled: optional boolean

Whether traces are enabled for the Worker.

head_sampling_rate: optional number

The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: optional boolean

Whether trace persistence is enabled for the Worker.

placement: optional object { mode } or object { region } or object { hostname } or 5 more

Configuration for Smart Placement. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.

One of the following:
Mode object { mode }
mode: "smart"
Region object { region }
region: string

Cloud region for targeted placement in format ‘provider:region’.

Hostname object { hostname }
hostname: string

HTTP hostname for targeted placement.

Host object { host }
host: string

TCP host and port for targeted placement.

object { mode, region }
mode: "targeted"

Targeted placement mode.

region: string

Cloud region for targeted placement in format ‘provider:region’.

object { hostname, mode }
hostname: string

HTTP hostname for targeted placement.

mode: "targeted"

Targeted placement mode.

object { host, mode }
host: string

TCP host and port for targeted placement.

mode: "targeted"

Targeted placement mode.

object { mode, target }
mode: "targeted"

Targeted placement mode.

target: array of object { region } or object { hostname } or object { host }

Array of placement targets (currently limited to single target).

One of the following:
Region object { region }
region: string

Cloud region in format ‘provider:region’.

Hostname object { hostname }
hostname: string

HTTP hostname for targeted placement.

Host object { host }
host: string

TCP host:port for targeted placement.

tags: optional array of string

Tags associated with the Worker.

tail_consumers: optional array of ConsumerScript { service, environment, namespace }

List of Workers that will consume logs from the attached Worker.

service: string

Name of Worker that is to be the consumer.

environment: optional string

Optional environment if the Worker utilizes one.

namespace: optional string

Optional dispatch namespace the script belongs to.

usage_model: optional "standard" or "bundled" or "unbound"

Usage model for the Worker invocations.

One of the following:
"standard"
"bundled"
"unbound"
ScriptAndVersionSettingEditResponse object { annotations, bindings, compatibility_date, 9 more }
annotations: optional object { "workers/message", "workers/tag", "workers/triggered_by" }

Annotations for the Worker version. Annotations are not inherited across settings updates; omitting this field means the new version will have no annotations.

"workers/message": optional string

Human-readable message about the version. Truncated to 1000 bytes if longer.

maxLength1000
"workers/tag": optional string

User-provided identifier for the version. Maximum 100 bytes.

maxLength100
"workers/triggered_by": optional string

Operation that triggered the creation of the version. This is read-only and set by the server.

bindings: optional array of object { name, type } or object { instance_name, name, type, namespace } or object { name, namespace, type } or 32 more

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.

One of the following:
AI object { name, type }
name: string

A JavaScript variable name for the binding.

type: "ai"

The kind of resource that the binding provides.

AISearch object { instance_name, name, type, namespace }
instance_name: string

The user-chosen instance name. Must exist at deploy time. The worker can search, chat, update, and manage items/jobs on this instance.

name: string

A JavaScript variable name for the binding.

type: "ai_search"

The kind of resource that the binding provides.

namespace: optional string

The namespace the instance belongs to. Defaults to “default” if omitted. Customers who don’t use namespaces can simply omit this field.

AISearchNamespace object { name, namespace, type }
name: string

A JavaScript variable name for the binding.

namespace: string

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: "ai_search_namespace"

The kind of resource that the binding provides.

AnalyticsEngine object { dataset, name, type }
dataset: string

The name of the dataset to bind to.

name: string

A JavaScript variable name for the binding.

type: "analytics_engine"

The kind of resource that the binding provides.

Assets object { name, type }
name: string

A JavaScript variable name for the binding.

type: "assets"

The kind of resource that the binding provides.

Browser object { name, type }
name: string

A JavaScript variable name for the binding.

type: "browser"

The kind of resource that the binding provides.

D1 object { database_id, name, type, id }
database_id: string

Identifier of the D1 database to bind to.

name: string

A JavaScript variable name for the binding.

type: "d1"

The kind of resource that the binding provides.

Deprecatedid: optional string
This property has been renamed to `database_id`.

Identifier of the D1 database to bind to.

DataBlob object { name, part, type }
name: string

A JavaScript variable name for the binding.

part: string

The name of the file containing the data content. Only accepted for service worker syntax Workers.

Deprecatedtype: "data_blob"

The kind of resource that the binding provides.

DispatchNamespace object { name, namespace, type, outbound }
name: string

A JavaScript variable name for the binding.

namespace: string

The name of the dispatch namespace.

type: "dispatch_namespace"

The kind of resource that the binding provides.

outbound: optional object { params, worker }

Outbound worker.

params: optional array of object { name }

Pass information from the Dispatch Worker to the Outbound Worker through the parameters.

name: string

Name of the parameter.

worker: optional object { entrypoint, environment, service }

Outbound worker.

entrypoint: optional string

Entrypoint to invoke on the outbound worker.

environment: optional string

Environment of the outbound worker.

service: optional string

Name of the outbound worker.

DurableObjectNamespace object { name, type, class_name, 4 more }
name: string

A JavaScript variable name for the binding.

type: "durable_object_namespace"

The kind of resource that the binding provides.

class_name: optional string

The exported class name of the Durable Object.

dispatch_namespace: optional string

The dispatch namespace the Durable Object script belongs to.

environment: optional string

The environment of the script_name to bind to.

namespace_id: optional string

Namespace identifier tag.

maxLength32
script_name: optional string

The script where the Durable Object is defined, if it is external to this Worker.

Hyperdrive object { id, name, type }
id: string

Identifier of the Hyperdrive connection to bind to.

name: string

A JavaScript variable name for the binding.

type: "hyperdrive"

The kind of resource that the binding provides.

Inherit object { name, type, old_name, version_id }
name: string

The name of the inherited binding.

type: "inherit"

The kind of resource that the binding provides.

old_name: optional string

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.

version_id: optional string

Identifier for the version to inherit the binding from, which can be the version ID or the literal “latest” to inherit from the latest version. Defaults to inheriting the binding from the latest version.

Images object { name, type }
name: string

A JavaScript variable name for the binding.

type: "images"

The kind of resource that the binding provides.

Json object { json, name, type }
json: unknown

JSON data to use.

name: string

A JavaScript variable name for the binding.

type: "json"

The kind of resource that the binding provides.

KVNamespace object { name, namespace_id, type }
name: string

A JavaScript variable name for the binding.

namespace_id: string

Namespace identifier tag.

maxLength32
type: "kv_namespace"

The kind of resource that the binding provides.

Media object { name, type }
name: string

A JavaScript variable name for the binding.

type: "media"

The kind of resource that the binding provides.

MTLSCertificate object { certificate_id, name, type }
certificate_id: string

Identifier of the certificate to bind to.

name: string

A JavaScript variable name for the binding.

type: "mtls_certificate"

The kind of resource that the binding provides.

PlainText object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The text value to use.

type: "plain_text"

The kind of resource that the binding provides.

Pipelines object { name, pipeline, type }
name: string

A JavaScript variable name for the binding.

pipeline: string

Name of the Pipeline to bind to.

type: "pipelines"

The kind of resource that the binding provides.

Queue object { name, queue_name, type }
name: string

A JavaScript variable name for the binding.

queue_name: string

Name of the Queue to bind to.

type: "queue"

The kind of resource that the binding provides.

Ratelimit object { name, namespace_id, simple, type }
name: string

A JavaScript variable name for the binding.

namespace_id: string

Identifier of the rate limit namespace to bind to.

simple: object { limit, period }

The rate limit configuration.

limit: number

The limit (requests per period).

period: number

The period in seconds.

type: "ratelimit"

The kind of resource that the binding provides.

R2Bucket object { bucket_name, name, type, jurisdiction }
bucket_name: string

R2 bucket to bind to.

name: string

A JavaScript variable name for the binding.

type: "r2_bucket"

The kind of resource that the binding provides.

jurisdiction: optional "eu" or "fedramp" or "fedramp-high"

The jurisdiction of the R2 bucket.

One of the following:
"eu"
"fedramp"
"fedramp-high"
SecretText object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

SendEmail object { name, type, allowed_destination_addresses, 2 more }
name: string

A JavaScript variable name for the binding.

type: "send_email"

The kind of resource that the binding provides.

allowed_destination_addresses: optional array of string

List of allowed destination addresses.

allowed_sender_addresses: optional array of string

List of allowed sender addresses.

destination_address: optional string

Destination address for the email.

formatemail
Service object { name, service, type, 2 more }
name: string

A JavaScript variable name for the binding.

service: string

Name of Worker to bind to.

type: "service"

The kind of resource that the binding provides.

entrypoint: optional string

Entrypoint to invoke on the target Worker.

environment: optional string

Optional environment if the Worker utilizes one.

TextBlob object { name, part, type }
name: string

A JavaScript variable name for the binding.

part: string

The name of the file containing the text content. Only accepted for service worker syntax Workers.

Deprecatedtype: "text_blob"

The kind of resource that the binding provides.

Vectorize object { index_name, name, type }
index_name: string

Name of the Vectorize index to bind to.

name: string

A JavaScript variable name for the binding.

type: "vectorize"

The kind of resource that the binding provides.

VersionMetadata object { name, type }
name: string

A JavaScript variable name for the binding.

type: "version_metadata"

The kind of resource that the binding provides.

SecretsStoreSecret object { name, secret_name, store_id, type }
name: string

A JavaScript variable name for the binding.

secret_name: string

Name of the secret in the store.

store_id: string

ID of the store containing the secret.

type: "secrets_store_secret"

The kind of resource that the binding provides.

Flagship object { app_id, name, type }
app_id: string

ID of the Flagship app to bind to for feature flag evaluation.

maxLength128
name: string

A JavaScript variable name for the binding.

type: "flagship"

The kind of resource that the binding provides.

SecretKey object { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" or "pkcs8" or "spki" or "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: array of "encrypt" or "decrypt" or "sign" or 5 more

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: optional string

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: optional unknown

Key data in JSON Web Key format. Required if format is “jwk”.

Workflow object { name, type, workflow_name, 2 more }
name: string

A JavaScript variable name for the binding.

type: "workflow"

The kind of resource that the binding provides.

workflow_name: string

Name of the Workflow to bind to.

class_name: optional string

Class name of the Workflow. Should only be provided if the Workflow belongs to this script.

script_name: optional string

Script name that contains the Workflow. If not provided, defaults to this script name.

WasmModule object { name, part, type }
name: string

A JavaScript variable name for the binding.

part: string

The name of the file containing the WebAssembly module content. Only accepted for service worker syntax Workers.

Deprecatedtype: "wasm_module"

The kind of resource that the binding provides.

VPCService object { name, service_id, type }
name: string

A JavaScript variable name for the binding.

service_id: string

Identifier of the VPC service to bind to.

type: "vpc_service"

The kind of resource that the binding provides.

VPCNetwork object { name, type, network_id, tunnel_id }
name: string

A JavaScript variable name for the binding.

type: "vpc_network"

The kind of resource that the binding provides.

network_id: optional string

Identifier of the network to bind to. Only “cf1:network” is currently supported. Mutually exclusive with tunnel_id.

tunnel_id: optional string

UUID of the Cloudflare Tunnel to bind to. Mutually exclusive with network_id.

compatibility_date: optional string

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

compatibility_flags: optional array of string

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.

limits: optional object { cpu_ms, subrequests }

Limits to apply for this Worker.

cpu_ms: optional number

The amount of CPU time this Worker can use in milliseconds.

subrequests: optional number

The number of subrequests this Worker can make per request.

logpush: optional boolean

Whether Logpush is turned on for the Worker.

migrations: optional SingleStepMigration { deleted_classes, new_classes, new_sqlite_classes, 4 more } or object { new_tag, old_tag, steps }

Migrations to apply for Durable Objects associated with this Worker.

One of the following:
SingleStepMigration object { deleted_classes, new_classes, new_sqlite_classes, 4 more }

A single set of migrations to apply.

deleted_classes: optional array of string

A list of classes to delete Durable Object namespaces from.

new_classes: optional array of string

A list of classes to create Durable Object namespaces from.

new_sqlite_classes: optional array of string

A list of classes to create Durable Object namespaces with SQLite from.

new_tag: optional string

Tag to set as the latest migration tag.

old_tag: optional string

Tag used to verify against the latest migration tag for this Worker. If they don’t match, the upload is rejected.

renamed_classes: optional array of object { from, to }

A list of classes with Durable Object namespaces that were renamed.

from: optional string
to: optional string
transferred_classes: optional array of object { from, from_script, to }

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from: optional string
from_script: optional string
to: optional string
WorkersMultipleStepMigrations object { new_tag, old_tag, steps }
new_tag: optional string

Tag to set as the latest migration tag.

old_tag: optional string

Tag used to verify against the latest migration tag for this Worker. If they don’t match, the upload is rejected.

steps: optional array of MigrationStep { deleted_classes, new_classes, new_sqlite_classes, 2 more }

Migrations to apply in order.

deleted_classes: optional array of string

A list of classes to delete Durable Object namespaces from.

new_classes: optional array of string

A list of classes to create Durable Object namespaces from.

new_sqlite_classes: optional array of string

A list of classes to create Durable Object namespaces with SQLite from.

renamed_classes: optional array of object { from, to }

A list of classes with Durable Object namespaces that were renamed.

from: optional string
to: optional string
transferred_classes: optional array of object { from, from_script, to }

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from: optional string
from_script: optional string
to: optional string
observability: optional object { enabled, head_sampling_rate, logs, traces }

Observability settings for the Worker.

enabled: boolean

Whether observability is enabled for the Worker.

head_sampling_rate: optional number

The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

logs: optional object { enabled, invocation_logs, destinations, 2 more }

Log settings for the Worker.

enabled: boolean

Whether logs are enabled for the Worker.

invocation_logs: boolean

Whether invocation logs are enabled for the Worker.

destinations: optional array of string

A list of destinations where logs will be exported to.

head_sampling_rate: optional number

The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: optional boolean

Whether log persistence is enabled for the Worker.

traces: optional object { destinations, enabled, head_sampling_rate, persist }

Trace settings for the Worker.

destinations: optional array of string

A list of destinations where traces will be exported to.

enabled: optional boolean

Whether traces are enabled for the Worker.

head_sampling_rate: optional number

The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: optional boolean

Whether trace persistence is enabled for the Worker.

placement: optional object { mode } or object { region } or object { hostname } or 5 more

Configuration for Smart Placement. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.

One of the following:
Mode object { mode }
mode: "smart"
Region object { region }
region: string

Cloud region for targeted placement in format ‘provider:region’.

Hostname object { hostname }
hostname: string

HTTP hostname for targeted placement.

Host object { host }
host: string

TCP host and port for targeted placement.

object { mode, region }
mode: "targeted"

Targeted placement mode.

region: string

Cloud region for targeted placement in format ‘provider:region’.

object { hostname, mode }
hostname: string

HTTP hostname for targeted placement.

mode: "targeted"

Targeted placement mode.

object { host, mode }
host: string

TCP host and port for targeted placement.

mode: "targeted"

Targeted placement mode.

object { mode, target }
mode: "targeted"

Targeted placement mode.

target: array of object { region } or object { hostname } or object { host }

Array of placement targets (currently limited to single target).

One of the following:
Region object { region }
region: string

Cloud region in format ‘provider:region’.

Hostname object { hostname }
hostname: string

HTTP hostname for targeted placement.

Host object { host }
host: string

TCP host:port for targeted placement.

tags: optional array of string

Tags associated with the Worker.

tail_consumers: optional array of ConsumerScript { service, environment, namespace }

List of Workers that will consume logs from the attached Worker.

service: string

Name of Worker that is to be the consumer.

environment: optional string

Optional environment if the Worker utilizes one.

namespace: optional string

Optional dispatch namespace the script belongs to.

usage_model: optional "standard" or "bundled" or "unbound"

Usage model for the Worker invocations.

One of the following:
"standard"
"bundled"
"unbound"