Skip to content
Start here

Scripts

List Worker Scripts
client.Workers.Scripts.List(ctx, params) (*SinglePage[ScriptListResponse], error)
GET/accounts/{account_id}/workers/scripts
Search Worker Scripts
client.Workers.Scripts.Search(ctx, params) (*[]ScriptSearchResponse, error)
GET/accounts/{account_id}/workers/scripts-search
Download Worker Script
client.Workers.Scripts.Get(ctx, scriptName, query) (*string, error)
GET/accounts/{account_id}/workers/scripts/{script_name}
Upload Worker Module
client.Workers.Scripts.Update(ctx, scriptName, params) (*ScriptUpdateResponse, error)
PUT/accounts/{account_id}/workers/scripts/{script_name}
Delete Worker
client.Workers.Scripts.Delete(ctx, scriptName, params) (*ScriptDeleteResponse, error)
DELETE/accounts/{account_id}/workers/scripts/{script_name}
ModelsExpand Collapse
type Script struct{…}
ID stringOptional

The name used to identify the script.

CacheOptions ScriptCacheOptionsOptional

Global CacheW configuration for the Worker. When caching is on, the platform provisions a cloudflare.app zone for the Worker. A type: worker entry in the exports map can override this value for a single entrypoint.

Enabled bool

Whether caching is enabled for this Worker.

CrossVersionCache boolOptional

Whether cached responses are shared across Worker version uploads. This is independent of enabled. It can stay true while caching is off, so the preference survives turning caching off and back on.

CompatibilityDate stringOptional

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

CompatibilityFlags []stringOptional

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.

CreatedOn TimeOptional

When the script was created.

formatdate-time
Etag stringOptional

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

Exports map[string, ScriptExport]Optional

Declarative exports for the Worker’s most recent version, including Durable Object classes (with their storage backend) and named Worker entrypoints. Tombstoned lifecycle entries are omitted, so only live exports (created and expecting-transfer) are returned.

One of the following:
type ScriptExportsWorkersWorkerExport struct{…}

A named Worker entrypoint export (type: worker). Worker entrypoints are always live (state: created) and carry no storage or lifecycle fields. The optional cache block overrides the Worker’s global cache_options.enabled for this entrypoint.

Type ScriptExportsWorkersWorkerExportType

Marks this entry as a Worker entrypoint export.

Cache ScriptExportsWorkersWorkerExportCacheOptional

Cache override for this entrypoint. Overrides the Worker’s global cache_options.enabled for this entrypoint only.

Enabled bool

Whether caching is enabled for this entrypoint.

State ScriptExportsWorkersWorkerExportStateOptional

Live export. May be omitted; defaults to created.

type ScriptExportsWorkersDurableObjectExport struct{…}

A live Durable Object export (state: created, the default). The platform auto-provisions the namespace on first deploy, matches it on subsequent deploys, and never mutates or deletes it as a side effect of a code-only change. storage is required; renamed_to, transferred_to and transfer_from are not allowed on a live entry.

Storage ScriptExportsWorkersDurableObjectExportStorage

Durable Object storage backend. sqlite is the recommended (and only) backend for new namespaces. legacy-kv is accepted only for a class whose namespace already exists as KV-backed; the exports flow never provisions a new legacy-kv namespace.

One of the following:
const ScriptExportsWorkersDurableObjectExportStorageSqlite ScriptExportsWorkersDurableObjectExportStorage = "sqlite"
const ScriptExportsWorkersDurableObjectExportStorageLegacyKV ScriptExportsWorkersDurableObjectExportStorage = "legacy-kv"
Type ScriptExportsWorkersDurableObjectExportType

Marks this entry as a Durable Object export.

Container stringOptional

Name of the container (declared in the upload’s metadata.containers) that backs this Durable Object. When set, the namespace is container-enabled. Valid only on live entries.

maxLength128
State ScriptExportsWorkersDurableObjectExportStateOptional

Live export. May be omitted; defaults to created.

type ScriptExportsWorkersDurableObjectDeletedExport struct{…}

A deleted tombstone: retires the provisioned namespace for this class and all of its data. The class must be absent from the uploaded code and no other Worker in the account may bind to the namespace, otherwise the deploy is rejected. No other fields are allowed. Deletion is irreversible.

State ScriptExportsWorkersDurableObjectDeletedExportState

Tombstone that deletes the namespace.

Type ScriptExportsWorkersDurableObjectDeletedExportType

Marks this entry as a Durable Object export.

type ScriptExportsWorkersDurableObjectRenamedExport struct{…}

A renamed tombstone: rewrites the provisioned namespace’s class name from this map key to renamed_to. The source class may stay in code during the rollout window (an info notice is emitted). storage, transferred_to and transfer_from are not allowed.

RenamedTo string

The destination class name. Must differ from the source class (the map key) and must be declared as a live (created) entry in the same exports map. Write-only: never present in GET responses.

maxLength128
State ScriptExportsWorkersDurableObjectRenamedExportState

Tombstone that renames the namespace’s class.

Type ScriptExportsWorkersDurableObjectRenamedExportType

Marks this entry as a Durable Object export.

type ScriptExportsWorkersDurableObjectTransferredExport struct{…}

A transferred tombstone (source side of a two-phase transfer): hands ownership of the provisioned namespace to another script in the same account, named by transferred_to. The target must have already deployed a matching expecting-transfer entry. The source class may stay in code during the rollout window (an info notice is emitted). storage, renamed_to and transfer_from are not allowed.

State ScriptExportsWorkersDurableObjectTransferredExportState

Tombstone that transfers the namespace to another script.

TransferredTo string

The destination script name. Must be in the same account and the same dispatch-namespace context (or both non-dispatch). Cross-dispatch-namespace transfers are rejected. Write-only: never present in GET responses.

maxLength128
Type ScriptExportsWorkersDurableObjectTransferredExportType

Marks this entry as a Durable Object export.

type ScriptExportsWorkersDurableObjectExpectingTransferExport struct{…}

The target side of a two-phase transfer (state: expecting-transfer). Declares that this script expects to receive a namespace for this class from the transfer_from script. This is a live entry, not a tombstone: bindings resolve through the source’s namespace until the source commits with a transferred tombstone. storage and transfer_from are required; renamed_to and transferred_to are not allowed.

State ScriptExportsWorkersDurableObjectExpectingTransferExportState

Target side of a two-phase transfer.

Storage ScriptExportsWorkersDurableObjectExpectingTransferExportStorage

Durable Object storage backend. sqlite is the recommended (and only) backend for new namespaces. legacy-kv is accepted only for a class whose namespace already exists as KV-backed; the exports flow never provisions a new legacy-kv namespace.

One of the following:
const ScriptExportsWorkersDurableObjectExpectingTransferExportStorageSqlite ScriptExportsWorkersDurableObjectExpectingTransferExportStorage = "sqlite"
const ScriptExportsWorkersDurableObjectExpectingTransferExportStorageLegacyKV ScriptExportsWorkersDurableObjectExpectingTransferExportStorage = "legacy-kv"
TransferFrom string

The source script name to receive the namespace from. Must be in the same account and dispatch-namespace context. Present on reads for expecting-transfer entries.

maxLength128
Type ScriptExportsWorkersDurableObjectExpectingTransferExportType

Marks this entry as a Durable Object export.

Container stringOptional

Name of the container (declared in the upload’s metadata.containers) that backs this Durable Object once the transfer settles. Valid only on live entries.

maxLength128
Handlers []stringOptional

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

HasAssets boolOptional

Whether a Worker contains assets.

HasModules boolOptional

Whether a Worker contains modules.

LastDeployedFrom stringOptional

The client most recently used to deploy this Worker.

Logpush boolOptional

Whether Logpush is turned on for the Worker.

MigrationTag stringOptional

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

ModifiedOn TimeOptional

When the script was last modified.

formatdate-time
NamedHandlers []ScriptNamedHandlerOptional

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

Handlers []stringOptional

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

Name stringOptional

The name of the export.

Observability ScriptObservabilityOptional

Observability settings for the Worker.

Enabled bool

Whether observability is enabled for the Worker.

HeadSamplingRate float64Optional

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

Issues ScriptObservabilityIssuesOptional

Real-time Issues settings for the Worker.

Enabled boolOptional

Whether real-time Issues are enabled for the Worker.

Logs ScriptObservabilityLogsOptional

Log settings for the Worker.

Enabled bool

Whether logs are enabled for the Worker.

InvocationLogs bool

Whether invocation logs are enabled for the Worker.

Destinations []stringOptional

A list of destinations where logs will be exported to.

HeadSamplingRate float64Optional

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

Persist boolOptional

Whether log persistence is enabled for the Worker.

RedactQueryString boolOptional

Whether query strings are removed from request URLs in logs and traces.

Traces ScriptObservabilityTracesOptional

Trace settings for the Worker.

Destinations []stringOptional

A list of destinations where traces will be exported to.

Enabled boolOptional

Whether traces are enabled for the Worker.

HeadSamplingRate float64Optional

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

Persist boolOptional

Whether trace persistence is enabled for the Worker.

PropagationPolicy ScriptObservabilityTracesPropagationPolicyOptional

Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. “authenticated” honors inbound trace context only when accompanied by a valid trace auth token. “accept” unconditionally accepts inbound trace context. Requires the trace propagation feature to be enabled. Returns null when the trace propagation feature is not enabled for the account.

One of the following:
const ScriptObservabilityTracesPropagationPolicyAuthenticated ScriptObservabilityTracesPropagationPolicy = "authenticated"
const ScriptObservabilityTracesPropagationPolicyAccept ScriptObservabilityTracesPropagationPolicy = "accept"
Placement ScriptPlacementOptional

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

One of the following:
type ScriptPlacementObject struct{…}
Mode ScriptPlacementObjectMode
LastAnalyzedAt TimeOptional

The last time the script was analyzed for Smart Placement.

formatdate-time
Status ScriptPlacementObjectStatusOptional

Status of Smart Placement.

One of the following:
const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"
const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED_APPLICATION"
const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT_INVOCATIONS"
type ScriptPlacementObject struct{…}
Region string

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

LastAnalyzedAt TimeOptional

The last time the script was analyzed for Smart Placement.

formatdate-time
Status ScriptPlacementObjectStatusOptional

Status of Smart Placement.

One of the following:
const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"
const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED_APPLICATION"
const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT_INVOCATIONS"
type ScriptPlacementObject struct{…}
Hostname string

HTTP hostname for targeted placement.

LastAnalyzedAt TimeOptional

The last time the script was analyzed for Smart Placement.

formatdate-time
Status ScriptPlacementObjectStatusOptional

Status of Smart Placement.

One of the following:
const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"
const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED_APPLICATION"
const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT_INVOCATIONS"
type ScriptPlacementObject struct{…}
Host string

TCP host and port for targeted placement.

LastAnalyzedAt TimeOptional

The last time the script was analyzed for Smart Placement.

formatdate-time
Status ScriptPlacementObjectStatusOptional

Status of Smart Placement.

One of the following:
const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"
const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED_APPLICATION"
const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT_INVOCATIONS"
type ScriptPlacementObject struct{…}
Mode ScriptPlacementObjectMode

Targeted placement mode.

Region string

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

LastAnalyzedAt TimeOptional

The last time the script was analyzed for Smart Placement.

formatdate-time
Status ScriptPlacementObjectStatusOptional

Status of Smart Placement.

One of the following:
const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"
const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED_APPLICATION"
const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT_INVOCATIONS"
type ScriptPlacementObject struct{…}
Hostname string

HTTP hostname for targeted placement.

Mode ScriptPlacementObjectMode

Targeted placement mode.

LastAnalyzedAt TimeOptional

The last time the script was analyzed for Smart Placement.

formatdate-time
Status ScriptPlacementObjectStatusOptional

Status of Smart Placement.

One of the following:
const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"
const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED_APPLICATION"
const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT_INVOCATIONS"
type ScriptPlacementObject struct{…}
Host string

TCP host and port for targeted placement.

Mode ScriptPlacementObjectMode

Targeted placement mode.

LastAnalyzedAt TimeOptional

The last time the script was analyzed for Smart Placement.

formatdate-time
Status ScriptPlacementObjectStatusOptional

Status of Smart Placement.

One of the following:
const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"
const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED_APPLICATION"
const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT_INVOCATIONS"
type ScriptPlacementObject struct{…}
Mode ScriptPlacementObjectMode

Targeted placement mode.

Target []ScriptPlacementObjectTarget

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

One of the following:
type ScriptPlacementObjectTargetRegion struct{…}
Region string

Cloud region in format ‘provider:region’.

type ScriptPlacementObjectTargetHostname struct{…}
Hostname string

HTTP hostname for targeted placement.

type ScriptPlacementObjectTargetHost struct{…}
Host string

TCP host:port for targeted placement.

LastAnalyzedAt TimeOptional

The last time the script was analyzed for Smart Placement.

formatdate-time
Status ScriptPlacementObjectStatusOptional

Status of Smart Placement.

One of the following:
const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"
const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED_APPLICATION"
const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT_INVOCATIONS"
DeprecatedPlacementMode ScriptPlacementModeOptional

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

One of the following:
const ScriptPlacementModeSmart ScriptPlacementMode = "smart"
const ScriptPlacementModeTargeted ScriptPlacementMode = "targeted"
DeprecatedPlacementStatus ScriptPlacementStatusOptional

Status of Smart Placement.

One of the following:
const ScriptPlacementStatusSuccess ScriptPlacementStatus = "SUCCESS"
const ScriptPlacementStatusUnsupportedApplication ScriptPlacementStatus = "UNSUPPORTED_APPLICATION"
const ScriptPlacementStatusInsufficientInvocations ScriptPlacementStatus = "INSUFFICIENT_INVOCATIONS"
Tag stringOptional

The immutable ID of the script.

Tags []stringOptional

Tags associated with the Worker.

TailConsumers []ConsumerScriptOptional

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

Service string

Name of Worker that is to be the consumer.

Environment stringOptional

Optional environment if the Worker utilizes one.

Namespace stringOptional

Optional dispatch namespace the script belongs to.

UsageModel ScriptUsageModelOptional

Usage model for the Worker invocations.

One of the following:
const ScriptUsageModelStandard ScriptUsageModel = "standard"
const ScriptUsageModelBundled ScriptUsageModel = "bundled"
const ScriptUsageModelUnbound ScriptUsageModel = "unbound"
type ScriptSetting struct{…}
Logpush boolOptional

Whether Logpush is turned on for the Worker.

Observability ScriptSettingObservabilityOptional

Observability settings for the Worker.

Enabled bool

Whether observability is enabled for the Worker.

HeadSamplingRate float64Optional

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

Issues ScriptSettingObservabilityIssuesOptional

Real-time Issues settings for the Worker.

Enabled boolOptional

Whether real-time Issues are enabled for the Worker.

Logs ScriptSettingObservabilityLogsOptional

Log settings for the Worker.

Enabled bool

Whether logs are enabled for the Worker.

InvocationLogs bool

Whether invocation logs are enabled for the Worker.

Destinations []stringOptional

A list of destinations where logs will be exported to.

HeadSamplingRate float64Optional

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

Persist boolOptional

Whether log persistence is enabled for the Worker.

RedactQueryString boolOptional

Whether query strings are removed from request URLs in logs and traces.

Traces ScriptSettingObservabilityTracesOptional

Trace settings for the Worker.

Destinations []stringOptional

A list of destinations where traces will be exported to.

Enabled boolOptional

Whether traces are enabled for the Worker.

HeadSamplingRate float64Optional

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

Persist boolOptional

Whether trace persistence is enabled for the Worker.

PropagationPolicy ScriptSettingObservabilityTracesPropagationPolicyOptional

Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. “authenticated” honors inbound trace context only when accompanied by a valid trace auth token. “accept” unconditionally accepts inbound trace context. Requires the trace propagation feature to be enabled. Returns null when the trace propagation feature is not enabled for the account.

One of the following:
const ScriptSettingObservabilityTracesPropagationPolicyAuthenticated ScriptSettingObservabilityTracesPropagationPolicy = "authenticated"
const ScriptSettingObservabilityTracesPropagationPolicyAccept ScriptSettingObservabilityTracesPropagationPolicy = "accept"
Tags []stringOptional

Tags associated with the Worker.

TailConsumers []ConsumerScriptOptional

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

Service string

Name of Worker that is to be the consumer.

Environment stringOptional

Optional environment if the Worker utilizes one.

Namespace stringOptional

Optional dispatch namespace the script belongs to.

ScriptsAssets

ScriptsAssetsUpload

Create Worker Assets Upload Session
client.Workers.Scripts.Assets.Upload.New(ctx, scriptName, params) (*ScriptAssetUploadNewResponse, error)
POST/accounts/{account_id}/workers/scripts/{script_name}/assets-upload-session

ScriptsSubdomain

Get Worker Script Subdomain
client.Workers.Scripts.Subdomain.Get(ctx, scriptName, query) (*ScriptSubdomainGetResponse, error)
GET/accounts/{account_id}/workers/scripts/{script_name}/subdomain
Update Worker Script Subdomain
client.Workers.Scripts.Subdomain.New(ctx, scriptName, params) (*ScriptSubdomainNewResponse, error)
POST/accounts/{account_id}/workers/scripts/{script_name}/subdomain
Delete Worker Script Subdomain
client.Workers.Scripts.Subdomain.Delete(ctx, scriptName, body) (*ScriptSubdomainDeleteResponse, error)
DELETE/accounts/{account_id}/workers/scripts/{script_name}/subdomain

ScriptsSchedules

Get Worker Script Schedules (Cron Triggers)
client.Workers.Scripts.Schedules.Get(ctx, scriptName, query) (*ScriptScheduleGetResponse, error)
GET/accounts/{account_id}/workers/scripts/{script_name}/schedules
Update Worker Script Schedules (Cron Triggers)
client.Workers.Scripts.Schedules.Update(ctx, scriptName, params) (*ScriptScheduleUpdateResponse, error)
PUT/accounts/{account_id}/workers/scripts/{script_name}/schedules

ScriptsTail

List Worker Tails
client.Workers.Scripts.Tail.Get(ctx, scriptName, query) (*ScriptTailGetResponse, error)
GET/accounts/{account_id}/workers/scripts/{script_name}/tails
Start Worker Tail
client.Workers.Scripts.Tail.New(ctx, scriptName, body) (*ScriptTailNewResponse, error)
POST/accounts/{account_id}/workers/scripts/{script_name}/tails
Delete Worker Tail
client.Workers.Scripts.Tail.Delete(ctx, scriptName, id, body) (*ScriptTailDeleteResponse, error)
DELETE/accounts/{account_id}/workers/scripts/{script_name}/tails/{id}
ModelsExpand Collapse
type ConsumerScript struct{…}

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 stringOptional

Optional environment if the Worker utilizes one.

Namespace stringOptional

Optional dispatch namespace the script belongs to.

ScriptsContent

Get Worker Script Content
client.Workers.Scripts.Content.Get(ctx, scriptName, query) (*Response, error)
GET/accounts/{account_id}/workers/scripts/{script_name}/content/v2
Replace Worker Script Content
client.Workers.Scripts.Content.Update(ctx, scriptName, params) (*Script, error)
PUT/accounts/{account_id}/workers/scripts/{script_name}/content

ScriptsSettings

Get Worker Script Settings
client.Workers.Scripts.Settings.Get(ctx, scriptName, query) (*ScriptSetting, error)
GET/accounts/{account_id}/workers/scripts/{script_name}/script-settings
Patch Worker Script Settings
client.Workers.Scripts.Settings.Edit(ctx, scriptName, params) (*ScriptSetting, error)
PATCH/accounts/{account_id}/workers/scripts/{script_name}/script-settings

ScriptsDeployments

List Worker Deployments
client.Workers.Scripts.Deployments.List(ctx, scriptName, params) (*V4PagePagination[ScriptDeploymentListResponse], error)
GET/accounts/{account_id}/workers/scripts/{script_name}/deployments
Create Worker Deployment
client.Workers.Scripts.Deployments.New(ctx, scriptName, params) (*Deployment, error)
POST/accounts/{account_id}/workers/scripts/{script_name}/deployments
Get Worker Deployment
client.Workers.Scripts.Deployments.Get(ctx, scriptName, deploymentID, query) (*Deployment, error)
GET/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}
Delete Worker Deployment
client.Workers.Scripts.Deployments.Delete(ctx, scriptName, deploymentID, body) (*ScriptDeploymentDeleteResponse, error)
DELETE/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}
ModelsExpand Collapse
type Deployment struct{…}
ID string
formatuuid
CreatedOn Time
formatdate-time
Source string
Strategy DeploymentStrategy
Versions []DeploymentVersion

Worker versions included in this deployment. Each object must contain a version_id UUID and a percentage; percentages across all objects must total 100. In the cf CLI, pass the entire array as one JSON value to --versions, either inline, for example --versions '[{"version_id":"023e105f-2a42-4f8b-a1c1-73f6a2a30c0f","percentage":100}]', or from a JSON file with --versions @versions.json.

Percentage float64

Percentage of traffic served by this version.

maximum100
minimum0.01
VersionID string

Identifier of the Worker Version.

formatuuid
Annotations DeploymentAnnotationsOptional
WorkersMessage stringOptional

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

maxLength1000
WorkersTriggeredBy stringOptional

Operation that triggered the creation of the deployment.

AuthorEmail stringOptional
formatemail

ScriptsVersions

List Versions
client.Workers.Scripts.Versions.List(ctx, scriptName, params) (*V4PagePagination[ScriptVersionListResponse], error)
GET/accounts/{account_id}/workers/scripts/{script_name}/versions
Get Worker Script Version
client.Workers.Scripts.Versions.Get(ctx, scriptName, versionID, query) (*ScriptVersionGetResponse, error)
GET/accounts/{account_id}/workers/scripts/{script_name}/versions/{version_id}
Upload Version
client.Workers.Scripts.Versions.New(ctx, scriptName, params) (*ScriptVersionNewResponse, error)
POST/accounts/{account_id}/workers/scripts/{script_name}/versions

ScriptsSecrets

List secrets bound to a Worker script
client.Workers.Scripts.Secrets.List(ctx, scriptName, query) (*SinglePage[ScriptSecretListResponse], error)
GET/accounts/{account_id}/workers/scripts/{script_name}/secrets
Get a secret binding
client.Workers.Scripts.Secrets.Get(ctx, scriptName, secretName, params) (*ScriptSecretGetResponse, error)
GET/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}
Add a secret to a Worker script
client.Workers.Scripts.Secrets.Update(ctx, scriptName, params) (*ScriptSecretUpdateResponse, error)
PUT/accounts/{account_id}/workers/scripts/{script_name}/secrets
Delete Worker script secret
client.Workers.Scripts.Secrets.Delete(ctx, scriptName, secretName, params) (*ScriptSecretDeleteResponse, error)
DELETE/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}
Patch multiple Worker script secrets
client.Workers.Scripts.Secrets.BulkUpdate(ctx, scriptName, params) (*ScriptSecretBulkUpdateResponse, error)
PATCH/accounts/{account_id}/workers/scripts/{script_name}/secrets-bulk

ScriptsScript And Version Settings

Get Worker Script and Version Settings
client.Workers.Scripts.ScriptAndVersionSettings.Get(ctx, scriptName, query) (*ScriptScriptAndVersionSettingGetResponse, error)
GET/accounts/{account_id}/workers/scripts/{script_name}/settings
Patch Worker Script and Version Settings
client.Workers.Scripts.ScriptAndVersionSettings.Edit(ctx, scriptName, params) (*ScriptScriptAndVersionSettingEditResponse, error)
PATCH/accounts/{account_id}/workers/scripts/{script_name}/settings