Skip to content
Start here

Patch Script Settings

client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Settings.Edit(ctx, dispatchNamespace, scriptName, params) (*DispatchNamespaceScriptSettingEditResponse, error)
PATCH/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/settings

Patch script metadata, such as bindings.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Workers Scripts Write
ParametersExpand Collapse
dispatchNamespace string

Name of the Workers for Platforms dispatch namespace.

scriptName string

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

params DispatchNamespaceScriptSettingEditParams
AccountID param.Field[string]

Path param: Identifier.

maxLength32

Body param: Script and version settings for Workers for Platforms namespace scripts. Same as script-and-version-settings-item but without annotations, which are not supported for namespace scripts.

Bindings []DispatchNamespaceScriptSettingEditParamsSettingsBindingOptional

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:
type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindAI struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindAIType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindAISearch struct{…}
InstanceName 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 DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindAISearchType

The kind of resource that the binding provides.

Namespace stringOptional

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

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindAISearchNamespace struct{…}
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 DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindAISearchNamespaceType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindAnalyticsEngine struct{…}
Dataset string

The name of the dataset to bind to.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindAnalyticsEngineType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindAssets struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindAssetsType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindBrowser struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindBrowserType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindD1 struct{…}
DatabaseID string

Identifier of the D1 database to bind to.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindD1Type

The kind of resource that the binding provides.

DeprecatedID stringOptional

This property has been renamed to database_id.

Identifier of the D1 database to bind to.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindDataBlob struct{…}
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 DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindDataBlobType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindDispatchNamespace struct{…}
Name string

A JavaScript variable name for the binding.

Namespace string

The name of the dispatch namespace.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindDispatchNamespaceType

The kind of resource that the binding provides.

Outbound DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindDispatchNamespaceOutboundOptional

Outbound worker.

Params []DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindDispatchNamespaceOutboundParamOptional

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

Name string

Name of the parameter.

Worker DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindDispatchNamespaceOutboundWorkerOptional

Outbound worker.

Entrypoint stringOptional

Entrypoint to invoke on the outbound worker.

Environment stringOptional

Environment of the outbound worker.

Service stringOptional

Name of the outbound worker.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindDurableObjectNamespace struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindDurableObjectNamespaceType

The kind of resource that the binding provides.

ClassName stringOptional

The exported class name of the Durable Object.

DispatchNamespace stringOptional

The dispatch namespace the Durable Object script belongs to.

Environment stringOptional

The environment of the script_name to bind to.

NamespaceID stringOptional

Namespace identifier tag.

maxLength32
ScriptName stringOptional

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

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindHyperdrive struct{…}
ID string

Identifier of the Hyperdrive connection to bind to.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindHyperdriveType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindInherit struct{…}
Name string

The name of the inherited binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindInheritType

The kind of resource that the binding provides.

OldName stringOptional

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.

VersionID stringOptional

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.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindImages struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindImagesType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindJson struct{…}
Json unknown

JSON data to use.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindJsonType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindKVNamespace struct{…}
Name string

A JavaScript variable name for the binding.

NamespaceID string

Namespace identifier tag.

maxLength32
Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindKVNamespaceType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindMedia struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindMediaType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindMTLSCertificate struct{…}
CertificateID string

Identifier of the certificate to bind to.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindMTLSCertificateType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindPlainText struct{…}
Name string

A JavaScript variable name for the binding.

Text string

The text value to use.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindPlainTextType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindPipelines struct{…}
Name string

A JavaScript variable name for the binding.

Pipeline string

Name of the Pipeline to bind to.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindPipelinesType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindQueue struct{…}
Name string

A JavaScript variable name for the binding.

QueueName string

Name of the Queue to bind to.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindQueueType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindRatelimit struct{…}
Name string

A JavaScript variable name for the binding.

NamespaceID string

Identifier of the rate limit namespace to bind to.

Simple DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindRatelimitSimple

The rate limit configuration.

Limit float64

The limit (requests per period).

Period int64

The period in seconds.

MitigationTimeout int64Optional

Duration in seconds to apply the mitigation action after the rate limit is exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400. Must be greater than or equal to the period when non-zero.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindRatelimitType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindR2Bucket struct{…}
BucketName string

R2 bucket to bind to.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindR2BucketType

The kind of resource that the binding provides.

Jurisdiction DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindR2BucketJurisdictionOptional

The jurisdiction of the R2 bucket.

One of the following:
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindR2BucketJurisdictionEu DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindR2BucketJurisdiction = "eu"
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindR2BucketJurisdictionFedramp DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindR2BucketJurisdiction = "fedramp"
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindR2BucketJurisdictionFedrampHigh DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindR2BucketJurisdiction = "fedramp-high"
type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretText struct{…}
Name string

A JavaScript variable name for the binding.

Text string

The secret value to use.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretTextType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSendEmail struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSendEmailType

The kind of resource that the binding provides.

AllowedDestinationAddresses []stringOptional

List of allowed destination addresses.

AllowedSenderAddresses []stringOptional

List of allowed sender addresses.

DestinationAddress stringOptional

Destination address for the email.

formatemail
type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindService struct{…}
Name string

A JavaScript variable name for the binding.

Service string

Name of Worker to bind to.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindServiceType

The kind of resource that the binding provides.

Entrypoint stringOptional

Entrypoint to invoke on the target Worker.

Environment stringOptional

Optional environment if the Worker utilizes one.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindTextBlob struct{…}
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 DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindTextBlobType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindVectorize struct{…}
IndexName string

Name of the Vectorize index to bind to.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindVectorizeType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindVersionMetadata struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindVersionMetadataType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretsStoreSecret struct{…}
Name string

A JavaScript variable name for the binding.

SecretName string

Name of the secret in the store.

StoreID string

ID of the store containing the secret.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretsStoreSecretType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindFlagship struct{…}
AppID string

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

maxLength128
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindFlagshipType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKey struct{…}
Algorithm unknown

Algorithm-specific key parameters. Learn more.

Format DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyFormat

Data format of the key. Learn more.

One of the following:
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyFormatRaw DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyFormat = "raw"
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyFormatPkcs8 DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyFormat = "pkcs8"
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyFormatSpki DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyFormat = "spki"
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyFormatJwk DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyFormat = "jwk"
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyType

The kind of resource that the binding provides.

Usages []DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsage

Allowed operations with the key. Learn more.

One of the following:
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsageEncrypt DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsage = "encrypt"
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsageDecrypt DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsage = "decrypt"
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsageSign DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsage = "sign"
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsageVerify DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsage = "verify"
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsageDeriveKey DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsage = "deriveKey"
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsageDeriveBits DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsage = "deriveBits"
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsageWrapKey DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsage = "wrapKey"
const DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsageUnwrapKey DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindSecretKeyUsage = "unwrapKey"
KeyBase64 stringOptional

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

KeyJwk unknownOptional

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

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindWorkflow struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindWorkflowType

The kind of resource that the binding provides.

WorkflowName string

Name of the Workflow to bind to.

ClassName stringOptional

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

ScriptName stringOptional

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

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindWasmModule struct{…}
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 DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindWasmModuleType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindVPCService struct{…}
Name string

A JavaScript variable name for the binding.

ServiceID string

Identifier of the VPC service to bind to.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindVPCServiceType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindVPCNetwork struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditParamsSettingsBindingsWorkersBindingKindVPCNetworkType

The kind of resource that the binding provides.

NetworkID stringOptional

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

TunnelID stringOptional

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

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.

Limits DispatchNamespaceScriptSettingEditParamsSettingsLimitsOptional

Limits to apply for this Worker.

CPUMs int64Optional

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

Subrequests int64Optional

The number of subrequests this Worker can make per request.

Logpush boolOptional

Whether Logpush is turned on for the Worker.

Migrations DispatchNamespaceScriptSettingEditParamsSettingsMigrationsOptional

Migrations to apply for Durable Objects associated with this Worker.

One of the following:
type SingleStepMigration struct{…}

A single set of migrations to apply.

DeletedClasses []stringOptional

A list of classes to delete Durable Object namespaces from.

NewClasses []stringOptional

A list of classes to create Durable Object namespaces from.

NewSqliteClasses []stringOptional

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

NewTag stringOptional

Tag to set as the latest migration tag.

OldTag stringOptional

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

RenamedClasses []SingleStepMigrationRenamedClassOptional

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

From stringOptional
To stringOptional
TransferredClasses []SingleStepMigrationTransferredClassOptional

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

From stringOptional
FromScript stringOptional
To stringOptional
type DispatchNamespaceScriptSettingEditParamsSettingsMigrationsWorkersMultipleStepMigrations struct{…}
NewTag stringOptional

Tag to set as the latest migration tag.

OldTag stringOptional

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

Steps []MigrationStepOptional

Migrations to apply in order.

DeletedClasses []stringOptional

A list of classes to delete Durable Object namespaces from.

NewClasses []stringOptional

A list of classes to create Durable Object namespaces from.

NewSqliteClasses []stringOptional

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

RenamedClasses []MigrationStepRenamedClassOptional

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

From stringOptional
To stringOptional
TransferredClasses []MigrationStepTransferredClassOptional

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

From stringOptional
FromScript stringOptional
To stringOptional
Observability DispatchNamespaceScriptSettingEditParamsSettingsObservabilityOptional

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.

Logs DispatchNamespaceScriptSettingEditParamsSettingsObservabilityLogsOptional

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.

Traces DispatchNamespaceScriptSettingEditParamsSettingsObservabilityTracesOptional

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 DispatchNamespaceScriptSettingEditParamsSettingsObservabilityTracesPropagationPolicyOptional

Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. “authenticated” (default) 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.

One of the following:
const DispatchNamespaceScriptSettingEditParamsSettingsObservabilityTracesPropagationPolicyAuthenticated DispatchNamespaceScriptSettingEditParamsSettingsObservabilityTracesPropagationPolicy = "authenticated"
const DispatchNamespaceScriptSettingEditParamsSettingsObservabilityTracesPropagationPolicyAccept DispatchNamespaceScriptSettingEditParamsSettingsObservabilityTracesPropagationPolicy = "accept"
Placement DispatchNamespaceScriptSettingEditParamsSettingsPlacementOptional

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

One of the following:
type DispatchNamespaceScriptSettingEditParamsSettingsPlacementMode struct{…}
Mode DispatchNamespaceScriptSettingEditParamsSettingsPlacementModeMode
type DispatchNamespaceScriptSettingEditParamsSettingsPlacementRegion struct{…}
Region string

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

type DispatchNamespaceScriptSettingEditParamsSettingsPlacementHostname struct{…}
Hostname string

HTTP hostname for targeted placement.

type DispatchNamespaceScriptSettingEditParamsSettingsPlacementHost struct{…}
Host string

TCP host and port for targeted placement.

type DispatchNamespaceScriptSettingEditParamsSettingsPlacementObject struct{…}
Mode DispatchNamespaceScriptSettingEditParamsSettingsPlacementObjectMode

Targeted placement mode.

Region string

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

type DispatchNamespaceScriptSettingEditParamsSettingsPlacementObject struct{…}
Hostname string

HTTP hostname for targeted placement.

Mode DispatchNamespaceScriptSettingEditParamsSettingsPlacementObjectMode

Targeted placement mode.

type DispatchNamespaceScriptSettingEditParamsSettingsPlacementObject struct{…}
Host string

TCP host and port for targeted placement.

Mode DispatchNamespaceScriptSettingEditParamsSettingsPlacementObjectMode

Targeted placement mode.

type DispatchNamespaceScriptSettingEditParamsSettingsPlacementObject struct{…}
Mode DispatchNamespaceScriptSettingEditParamsSettingsPlacementObjectMode

Targeted placement mode.

Target []DispatchNamespaceScriptSettingEditParamsSettingsPlacementObjectTarget

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

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

Cloud region in format ‘provider:region’.

type DispatchNamespaceScriptSettingEditParamsSettingsPlacementObjectTargetHostname struct{…}
Hostname string

HTTP hostname for targeted placement.

type DispatchNamespaceScriptSettingEditParamsSettingsPlacementObjectTargetHost struct{…}
Host string

TCP host:port for targeted placement.

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 DispatchNamespaceScriptSettingEditParamsSettingsUsageModelOptional

Usage model for the Worker invocations.

One of the following:
const DispatchNamespaceScriptSettingEditParamsSettingsUsageModelStandard DispatchNamespaceScriptSettingEditParamsSettingsUsageModel = "standard"
const DispatchNamespaceScriptSettingEditParamsSettingsUsageModelBundled DispatchNamespaceScriptSettingEditParamsSettingsUsageModel = "bundled"
const DispatchNamespaceScriptSettingEditParamsSettingsUsageModelUnbound DispatchNamespaceScriptSettingEditParamsSettingsUsageModel = "unbound"
ReturnsExpand Collapse
type DispatchNamespaceScriptSettingEditResponse struct{…}

Script and version settings for Workers for Platforms namespace scripts. Same as script-and-version-settings-item but without annotations, which are not supported for namespace scripts.

Bindings []DispatchNamespaceScriptSettingEditResponseBindingOptional

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:
type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindAI struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindAIType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindAISearch struct{…}
InstanceName 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 DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindAISearchType

The kind of resource that the binding provides.

Namespace stringOptional

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

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindAISearchNamespace struct{…}
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 DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindAISearchNamespaceType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindAnalyticsEngine struct{…}
Dataset string

The name of the dataset to bind to.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindAnalyticsEngineType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindAssets struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindAssetsType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindBrowser struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindBrowserType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindD1 struct{…}
DatabaseID string

Identifier of the D1 database to bind to.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindD1Type

The kind of resource that the binding provides.

DeprecatedID stringOptional

This property has been renamed to database_id.

Identifier of the D1 database to bind to.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindDataBlob struct{…}
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 DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindDataBlobType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindDispatchNamespace struct{…}
Name string

A JavaScript variable name for the binding.

Namespace string

The name of the dispatch namespace.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindDispatchNamespaceType

The kind of resource that the binding provides.

Outbound DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindDispatchNamespaceOutboundOptional

Outbound worker.

Params []DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindDispatchNamespaceOutboundParamOptional

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

Name string

Name of the parameter.

Worker DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindDispatchNamespaceOutboundWorkerOptional

Outbound worker.

Entrypoint stringOptional

Entrypoint to invoke on the outbound worker.

Environment stringOptional

Environment of the outbound worker.

Service stringOptional

Name of the outbound worker.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindDurableObjectNamespace struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindDurableObjectNamespaceType

The kind of resource that the binding provides.

ClassName stringOptional

The exported class name of the Durable Object.

DispatchNamespace stringOptional

The dispatch namespace the Durable Object script belongs to.

Environment stringOptional

The environment of the script_name to bind to.

NamespaceID stringOptional

Namespace identifier tag.

maxLength32
ScriptName stringOptional

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

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindHyperdrive struct{…}
ID string

Identifier of the Hyperdrive connection to bind to.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindHyperdriveType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindInherit struct{…}
Name string

The name of the inherited binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindInheritType

The kind of resource that the binding provides.

OldName stringOptional

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.

VersionID stringOptional

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.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindImages struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindImagesType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindJson struct{…}
Json unknown

JSON data to use.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindJsonType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindKVNamespace struct{…}
Name string

A JavaScript variable name for the binding.

NamespaceID string

Namespace identifier tag.

maxLength32
Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindKVNamespaceType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindMedia struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindMediaType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindMTLSCertificate struct{…}
CertificateID string

Identifier of the certificate to bind to.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindMTLSCertificateType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindPlainText struct{…}
Name string

A JavaScript variable name for the binding.

Text string

The text value to use.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindPlainTextType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindPipelines struct{…}
Name string

A JavaScript variable name for the binding.

Pipeline string

Name of the Pipeline to bind to.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindPipelinesType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindQueue struct{…}
Name string

A JavaScript variable name for the binding.

QueueName string

Name of the Queue to bind to.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindQueueType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindRatelimit struct{…}
Name string

A JavaScript variable name for the binding.

NamespaceID string

Identifier of the rate limit namespace to bind to.

Simple DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindRatelimitSimple

The rate limit configuration.

Limit float64

The limit (requests per period).

Period int64

The period in seconds.

MitigationTimeout int64Optional

Duration in seconds to apply the mitigation action after the rate limit is exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400. Must be greater than or equal to the period when non-zero.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindRatelimitType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindR2Bucket struct{…}
BucketName string

R2 bucket to bind to.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindR2BucketType

The kind of resource that the binding provides.

Jurisdiction DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindR2BucketJurisdictionOptional

The jurisdiction of the R2 bucket.

One of the following:
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindR2BucketJurisdictionEu DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindR2BucketJurisdiction = "eu"
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindR2BucketJurisdictionFedramp DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindR2BucketJurisdiction = "fedramp"
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindR2BucketJurisdictionFedrampHigh DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindR2BucketJurisdiction = "fedramp-high"
type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretText struct{…}
Name string

A JavaScript variable name for the binding.

Text string

The secret value to use.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretTextType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSendEmail struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSendEmailType

The kind of resource that the binding provides.

AllowedDestinationAddresses []stringOptional

List of allowed destination addresses.

AllowedSenderAddresses []stringOptional

List of allowed sender addresses.

DestinationAddress stringOptional

Destination address for the email.

formatemail
type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindService struct{…}
Name string

A JavaScript variable name for the binding.

Service string

Name of Worker to bind to.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindServiceType

The kind of resource that the binding provides.

Entrypoint stringOptional

Entrypoint to invoke on the target Worker.

Environment stringOptional

Optional environment if the Worker utilizes one.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindTextBlob struct{…}
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 DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindTextBlobType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindVectorize struct{…}
IndexName string

Name of the Vectorize index to bind to.

Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindVectorizeType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindVersionMetadata struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindVersionMetadataType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretsStoreSecret struct{…}
Name string

A JavaScript variable name for the binding.

SecretName string

Name of the secret in the store.

StoreID string

ID of the store containing the secret.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretsStoreSecretType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindFlagship struct{…}
AppID string

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

maxLength128
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindFlagshipType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKey struct{…}
Algorithm unknown

Algorithm-specific key parameters. Learn more.

Format DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyFormat

Data format of the key. Learn more.

One of the following:
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyFormatRaw DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyFormat = "raw"
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyFormatPkcs8 DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyFormat = "pkcs8"
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyFormatSpki DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyFormat = "spki"
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyFormatJwk DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyFormat = "jwk"
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyType

The kind of resource that the binding provides.

Usages []DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsage

Allowed operations with the key. Learn more.

One of the following:
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsageEncrypt DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsage = "encrypt"
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsageDecrypt DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsage = "decrypt"
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsageSign DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsage = "sign"
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsageVerify DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsage = "verify"
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsageDeriveKey DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsage = "deriveKey"
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsageDeriveBits DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsage = "deriveBits"
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsageWrapKey DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsage = "wrapKey"
const DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsageUnwrapKey DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindSecretKeyUsage = "unwrapKey"
KeyBase64 stringOptional

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

KeyJwk unknownOptional

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

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindWorkflow struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindWorkflowType

The kind of resource that the binding provides.

WorkflowName string

Name of the Workflow to bind to.

ClassName stringOptional

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

ScriptName stringOptional

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

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindWasmModule struct{…}
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 DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindWasmModuleType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindVPCService struct{…}
Name string

A JavaScript variable name for the binding.

ServiceID string

Identifier of the VPC service to bind to.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindVPCServiceType

The kind of resource that the binding provides.

type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindVPCNetwork struct{…}
Name string

A JavaScript variable name for the binding.

Type DispatchNamespaceScriptSettingEditResponseBindingsWorkersBindingKindVPCNetworkType

The kind of resource that the binding provides.

NetworkID stringOptional

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

TunnelID stringOptional

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

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.

Limits DispatchNamespaceScriptSettingEditResponseLimitsOptional

Limits to apply for this Worker.

CPUMs int64Optional

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

Subrequests int64Optional

The number of subrequests this Worker can make per request.

Logpush boolOptional

Whether Logpush is turned on for the Worker.

Migrations DispatchNamespaceScriptSettingEditResponseMigrationsOptional

Migrations to apply for Durable Objects associated with this Worker.

One of the following:
type SingleStepMigration struct{…}

A single set of migrations to apply.

DeletedClasses []stringOptional

A list of classes to delete Durable Object namespaces from.

NewClasses []stringOptional

A list of classes to create Durable Object namespaces from.

NewSqliteClasses []stringOptional

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

NewTag stringOptional

Tag to set as the latest migration tag.

OldTag stringOptional

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

RenamedClasses []SingleStepMigrationRenamedClassOptional

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

From stringOptional
To stringOptional
TransferredClasses []SingleStepMigrationTransferredClassOptional

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

From stringOptional
FromScript stringOptional
To stringOptional
type DispatchNamespaceScriptSettingEditResponseMigrationsWorkersMultipleStepMigrations struct{…}
NewTag stringOptional

Tag to set as the latest migration tag.

OldTag stringOptional

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

Steps []MigrationStepOptional

Migrations to apply in order.

DeletedClasses []stringOptional

A list of classes to delete Durable Object namespaces from.

NewClasses []stringOptional

A list of classes to create Durable Object namespaces from.

NewSqliteClasses []stringOptional

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

RenamedClasses []MigrationStepRenamedClassOptional

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

From stringOptional
To stringOptional
TransferredClasses []MigrationStepTransferredClassOptional

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

From stringOptional
FromScript stringOptional
To stringOptional
Observability DispatchNamespaceScriptSettingEditResponseObservabilityOptional

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.

Logs DispatchNamespaceScriptSettingEditResponseObservabilityLogsOptional

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.

Traces DispatchNamespaceScriptSettingEditResponseObservabilityTracesOptional

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 DispatchNamespaceScriptSettingEditResponseObservabilityTracesPropagationPolicyOptional

Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. “authenticated” (default) 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.

One of the following:
const DispatchNamespaceScriptSettingEditResponseObservabilityTracesPropagationPolicyAuthenticated DispatchNamespaceScriptSettingEditResponseObservabilityTracesPropagationPolicy = "authenticated"
const DispatchNamespaceScriptSettingEditResponseObservabilityTracesPropagationPolicyAccept DispatchNamespaceScriptSettingEditResponseObservabilityTracesPropagationPolicy = "accept"
Placement DispatchNamespaceScriptSettingEditResponsePlacementOptional

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

One of the following:
type DispatchNamespaceScriptSettingEditResponsePlacementMode struct{…}
Mode DispatchNamespaceScriptSettingEditResponsePlacementModeMode
type DispatchNamespaceScriptSettingEditResponsePlacementRegion struct{…}
Region string

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

type DispatchNamespaceScriptSettingEditResponsePlacementHostname struct{…}
Hostname string

HTTP hostname for targeted placement.

type DispatchNamespaceScriptSettingEditResponsePlacementHost struct{…}
Host string

TCP host and port for targeted placement.

type DispatchNamespaceScriptSettingEditResponsePlacementObject struct{…}
Mode DispatchNamespaceScriptSettingEditResponsePlacementObjectMode

Targeted placement mode.

Region string

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

type DispatchNamespaceScriptSettingEditResponsePlacementObject struct{…}
Hostname string

HTTP hostname for targeted placement.

Mode DispatchNamespaceScriptSettingEditResponsePlacementObjectMode

Targeted placement mode.

type DispatchNamespaceScriptSettingEditResponsePlacementObject struct{…}
Host string

TCP host and port for targeted placement.

Mode DispatchNamespaceScriptSettingEditResponsePlacementObjectMode

Targeted placement mode.

type DispatchNamespaceScriptSettingEditResponsePlacementObject struct{…}
Mode DispatchNamespaceScriptSettingEditResponsePlacementObjectMode

Targeted placement mode.

Target []DispatchNamespaceScriptSettingEditResponsePlacementObjectTarget

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

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

Cloud region in format ‘provider:region’.

type DispatchNamespaceScriptSettingEditResponsePlacementObjectTargetHostname struct{…}
Hostname string

HTTP hostname for targeted placement.

type DispatchNamespaceScriptSettingEditResponsePlacementObjectTargetHost struct{…}
Host string

TCP host:port for targeted placement.

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 DispatchNamespaceScriptSettingEditResponseUsageModelOptional

Usage model for the Worker invocations.

One of the following:
const DispatchNamespaceScriptSettingEditResponseUsageModelStandard DispatchNamespaceScriptSettingEditResponseUsageModel = "standard"
const DispatchNamespaceScriptSettingEditResponseUsageModelBundled DispatchNamespaceScriptSettingEditResponseUsageModel = "bundled"
const DispatchNamespaceScriptSettingEditResponseUsageModelUnbound DispatchNamespaceScriptSettingEditResponseUsageModel = "unbound"

Patch Script Settings

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/workers_for_platforms"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Settings.Edit(
    context.TODO(),
    "my-dispatch-namespace",
    "this-is_my_script-01",
    workers_for_platforms.DispatchNamespaceScriptSettingEditParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Bindings)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "bindings": [
      {
        "name": "MY_ENV_VAR",
        "text": "my_data",
        "type": "plain_text"
      }
    ],
    "compatibility_date": "2021-01-01",
    "compatibility_flags": [
      "nodejs_compat"
    ],
    "limits": {
      "cpu_ms": 50,
      "subrequests": 1000
    },
    "logpush": false,
    "observability": {
      "enabled": true,
      "head_sampling_rate": 0.1,
      "logs": {
        "enabled": true,
        "invocation_logs": true,
        "destinations": [
          "cloudflare"
        ],
        "head_sampling_rate": 0.1,
        "persist": true
      },
      "traces": {
        "destinations": [
          "cloudflare"
        ],
        "enabled": true,
        "head_sampling_rate": 0.1,
        "persist": true,
        "propagation_policy": "authenticated"
      }
    },
    "placement": {
      "mode": "smart"
    },
    "tags": [
      "my-team",
      "my-public-api"
    ],
    "tail_consumers": [
      {
        "service": "my-log-consumer",
        "environment": "production",
        "namespace": "my-namespace"
      }
    ],
    "usage_model": "standard"
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "bindings": [
      {
        "name": "MY_ENV_VAR",
        "text": "my_data",
        "type": "plain_text"
      }
    ],
    "compatibility_date": "2021-01-01",
    "compatibility_flags": [
      "nodejs_compat"
    ],
    "limits": {
      "cpu_ms": 50,
      "subrequests": 1000
    },
    "logpush": false,
    "observability": {
      "enabled": true,
      "head_sampling_rate": 0.1,
      "logs": {
        "enabled": true,
        "invocation_logs": true,
        "destinations": [
          "cloudflare"
        ],
        "head_sampling_rate": 0.1,
        "persist": true
      },
      "traces": {
        "destinations": [
          "cloudflare"
        ],
        "enabled": true,
        "head_sampling_rate": 0.1,
        "persist": true,
        "propagation_policy": "authenticated"
      }
    },
    "placement": {
      "mode": "smart"
    },
    "tags": [
      "my-team",
      "my-public-api"
    ],
    "tail_consumers": [
      {
        "service": "my-log-consumer",
        "environment": "production",
        "namespace": "my-namespace"
      }
    ],
    "usage_model": "standard"
  }
}