Skip to content
Start here

Workers

ModelsExpand Collapse
type MigrationStep struct{…}
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
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 WorkerMetadata struct{…}

JSON-encoded metadata about the uploaded parts and Worker configuration.

BodyPart stringOptional

Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the fetch event). Indicates a service worker syntax Worker.

MainModule stringOptional

Name of the part in the multipart request that contains the main module (e.g. the file exporting a fetch handler). Indicates a module syntax Worker.

WorkersBeta

WorkersBetaWorkers

List Workers
client.Workers.Beta.Workers.List(ctx, params) (*V4PagePaginationArray[Worker], error)
GET/accounts/{account_id}/workers/workers
Get Worker
client.Workers.Beta.Workers.Get(ctx, workerID, query) (*Worker, error)
GET/accounts/{account_id}/workers/workers/{worker_id}
Create Worker
client.Workers.Beta.Workers.New(ctx, params) (*Worker, error)
POST/accounts/{account_id}/workers/workers
Update Worker
client.Workers.Beta.Workers.Update(ctx, workerID, params) (*Worker, error)
PUT/accounts/{account_id}/workers/workers/{worker_id}
Edit Worker
client.Workers.Beta.Workers.Edit(ctx, workerID, params) (*Worker, error)
PATCH/accounts/{account_id}/workers/workers/{worker_id}
Delete Worker
client.Workers.Beta.Workers.Delete(ctx, workerID, body) (*BetaWorkerDeleteResponse, error)
DELETE/accounts/{account_id}/workers/workers/{worker_id}
ModelsExpand Collapse
type Worker struct{…}
ID string

Immutable ID of the Worker.

CreatedOn Time

When the Worker was created.

formatdate-time
Logpush bool

Whether logpush is enabled for the Worker.

Name string

Name of the Worker.

Observability WorkerObservability

Observability settings for the Worker.

Enabled boolOptional

Whether observability is enabled for the Worker.

HeadSamplingRate float64Optional

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

Logs WorkerObservabilityLogsOptional

Log settings for the Worker.

Destinations []stringOptional

A list of destinations where logs will be exported to.

Enabled boolOptional

Whether logs are enabled for the Worker.

HeadSamplingRate float64Optional

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

InvocationLogs boolOptional

Whether invocation logs are enabled for the Worker.

Persist boolOptional

Whether log persistence is enabled for the Worker.

Traces WorkerObservabilityTracesOptional

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%).

Persist boolOptional

Whether trace persistence is enabled for the Worker.

PropagationPolicy WorkerObservabilityTracesPropagationPolicyOptional

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 WorkerObservabilityTracesPropagationPolicyAuthenticated WorkerObservabilityTracesPropagationPolicy = "authenticated"
const WorkerObservabilityTracesPropagationPolicyAccept WorkerObservabilityTracesPropagationPolicy = "accept"
References WorkerReferences

Other resources that reference the Worker and depend on it existing.

DispatchNamespaceOutbounds []WorkerReferencesDispatchNamespaceOutbound

Other Workers that reference the Worker as an outbound for a dispatch namespace.

NamespaceID string

ID of the dispatch namespace.

NamespaceName string

Name of the dispatch namespace.

WorkerID string

ID of the Worker using the dispatch namespace.

WorkerName string

Name of the Worker using the dispatch namespace.

Domains []WorkerReferencesDomain

Custom domains connected to the Worker.

ID string

ID of the custom domain.

CertificateID string

ID of the TLS certificate issued for the custom domain.

Hostname string

Full hostname of the custom domain, including the zone name.

ZoneID string

ID of the zone.

ZoneName string

Name of the zone.

DurableObjects []WorkerReferencesDurableObject

Other Workers that reference Durable Object classes implemented by the Worker.

NamespaceID string

ID of the Durable Object namespace being used.

NamespaceName string

Name of the Durable Object namespace being used.

WorkerID string

ID of the Worker using the Durable Object implementation.

WorkerName string

Name of the Worker using the Durable Object implementation.

Queues []WorkerReferencesQueue

Queues that send messages to the Worker.

QueueConsumerID string

ID of the queue consumer configuration.

QueueID string

ID of the queue.

QueueName string

Name of the queue.

Workers []WorkerReferencesWorker

Other Workers that reference the Worker using service bindings.

ID string

ID of the referencing Worker.

Name string

Name of the referencing Worker.

Subdomain WorkerSubdomain

Subdomain settings for the Worker.

Enabled boolOptional

Whether the *.workers.dev subdomain is enabled for the Worker.

PreviewsEnabled boolOptional

Whether preview URLs are enabled for the Worker.

Tags []string

Tags associated with the Worker.

TailConsumers []WorkerTailConsumer

Other Workers that should consume logs from the Worker.

Name string

Name of the consumer Worker.

UpdatedOn Time

When the Worker was most recently updated.

formatdate-time
DeployedOn TimeOptional

When the Worker’s most recent deployment was created. null if the Worker has never been deployed.

formatdate-time

WorkersBetaWorkersVersions

List Versions
client.Workers.Beta.Workers.Versions.List(ctx, workerID, params) (*V4PagePaginationArray[Version], error)
GET/accounts/{account_id}/workers/workers/{worker_id}/versions
Get Version
client.Workers.Beta.Workers.Versions.Get(ctx, workerID, versionID, params) (*Version, error)
GET/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}
Create Version
client.Workers.Beta.Workers.Versions.New(ctx, workerID, params) (*Version, error)
POST/accounts/{account_id}/workers/workers/{worker_id}/versions
Delete Version
client.Workers.Beta.Workers.Versions.Delete(ctx, workerID, versionID, body) (*BetaWorkerVersionDeleteResponse, error)
DELETE/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}
ModelsExpand Collapse
type Version struct{…}
ID string

Version identifier.

formatuuid
CreatedOn Time

When the version was created.

formatdate-time
Number int64

The integer version number, starting from one.

URLs []string

All routable URLs that always point to this version. Does not include alias URLs, since aliases can be updated to point to a different version.

Annotations VersionAnnotationsOptional

Metadata about the version.

WorkersMessage stringOptional

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

maxLength1000
WorkersTag stringOptional

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

maxLength100
WorkersTriggeredBy stringOptional

Operation that triggered the creation of the version.

Assets VersionAssetsOptional

Configuration for assets within a Worker.

_headers and _redirects files should be included as modules named _headers and _redirects with content type text/plain.

Config VersionAssetsConfigOptional

Configuration for assets within a Worker.

HTMLHandling VersionAssetsConfigHTMLHandlingOptional

Determines the redirects and rewrites of requests for HTML content.

One of the following:
const VersionAssetsConfigHTMLHandlingAutoTrailingSlash VersionAssetsConfigHTMLHandling = "auto-trailing-slash"
const VersionAssetsConfigHTMLHandlingForceTrailingSlash VersionAssetsConfigHTMLHandling = "force-trailing-slash"
const VersionAssetsConfigHTMLHandlingDropTrailingSlash VersionAssetsConfigHTMLHandling = "drop-trailing-slash"
const VersionAssetsConfigHTMLHandlingNone VersionAssetsConfigHTMLHandling = "none"
NotFoundHandling VersionAssetsConfigNotFoundHandlingOptional

Determines the response when a request does not match a static asset, and there is no Worker script.

One of the following:
const VersionAssetsConfigNotFoundHandlingNone VersionAssetsConfigNotFoundHandling = "none"
const VersionAssetsConfigNotFoundHandling404Page VersionAssetsConfigNotFoundHandling = "404-page"
const VersionAssetsConfigNotFoundHandlingSinglePageApplication VersionAssetsConfigNotFoundHandling = "single-page-application"
RunWorkerFirst VersionAssetsConfigRunWorkerFirstUnionOptional

Contains a list path rules to control routing to either the Worker or assets. Glob (*) and negative (!) rules are supported. Rules must start with either ’/’ or ’!/’. At least one non-negative rule must be provided, and negative rules have higher precedence than non-negative rules.

One of the following:
type VersionAssetsConfigRunWorkerFirstArray []string

Contains a list path rules to control routing to either the Worker or assets. Glob (*) and negative (!) rules are supported. Rules must start with either ’/’ or ’!/’. At least one non-negative rule must be provided, and negative rules have higher precedence than non-negative rules.

UnionBool
JWT stringOptional

Token provided upon successful upload of all files from a registered manifest.

Bindings []VersionBindingOptional

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 VersionBindingsWorkersBindingKindAI struct{…}
Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindAIType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindAISearch 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 VersionBindingsWorkersBindingKindAISearchType

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 VersionBindingsWorkersBindingKindAISearchNamespace 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 VersionBindingsWorkersBindingKindAISearchNamespaceType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindMessaging struct{…}
Name string

A JavaScript variable name for the binding.

Namespace string

The Messaging namespace to bind to.

Type VersionBindingsWorkersBindingKindMessagingType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindAnalyticsEngine struct{…}
Dataset string

The name of the dataset to bind to.

Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindAnalyticsEngineType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindAssets struct{…}
Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindAssetsType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindBrowser struct{…}
Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindBrowserType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindD1 struct{…}
DatabaseID string

Identifier of the D1 database to bind to.

Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindD1Type

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 VersionBindingsWorkersBindingKindDataBlob 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 VersionBindingsWorkersBindingKindDataBlobType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindDispatchNamespace struct{…}
Name string

A JavaScript variable name for the binding.

Namespace string

The name of the dispatch namespace.

Type VersionBindingsWorkersBindingKindDispatchNamespaceType

The kind of resource that the binding provides.

Outbound VersionBindingsWorkersBindingKindDispatchNamespaceOutboundOptional

Outbound worker.

Params []VersionBindingsWorkersBindingKindDispatchNamespaceOutboundParamOptional

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

Name string

Name of the parameter.

Worker VersionBindingsWorkersBindingKindDispatchNamespaceOutboundWorkerOptional

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 VersionBindingsWorkersBindingKindDurableObjectNamespace struct{…}
Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindDurableObjectNamespaceType

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 VersionBindingsWorkersBindingKindHyperdrive struct{…}
ID string

Identifier of the Hyperdrive connection to bind to.

Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindHyperdriveType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindInherit struct{…}
Name string

The name of the inherited binding.

Type VersionBindingsWorkersBindingKindInheritType

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 VersionBindingsWorkersBindingKindImages struct{…}
Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindImagesType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindJson struct{…}
Json unknown

JSON data to use.

Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindJsonType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindKVNamespace struct{…}
Name string

A JavaScript variable name for the binding.

NamespaceID string

Namespace identifier tag.

maxLength32
Type VersionBindingsWorkersBindingKindKVNamespaceType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindMedia struct{…}
Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindMediaType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindMTLSCertificate struct{…}
CertificateID string

Identifier of the certificate to bind to.

Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindMTLSCertificateType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindPlainText struct{…}
Name string

A JavaScript variable name for the binding.

Text string

The text value to use.

Type VersionBindingsWorkersBindingKindPlainTextType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindPipelines struct{…}
Name string

A JavaScript variable name for the binding.

Pipeline string

Name of the Pipeline to bind to.

Type VersionBindingsWorkersBindingKindPipelinesType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindQueue struct{…}
Name string

A JavaScript variable name for the binding.

QueueName string

Name of the Queue to bind to.

Type VersionBindingsWorkersBindingKindQueueType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindRatelimit struct{…}
Name string

A JavaScript variable name for the binding.

NamespaceID string

Identifier of the rate limit namespace to bind to.

Simple VersionBindingsWorkersBindingKindRatelimitSimple

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 VersionBindingsWorkersBindingKindRatelimitType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindR2Bucket struct{…}
BucketName string

R2 bucket to bind to.

Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindR2BucketType

The kind of resource that the binding provides.

Jurisdiction VersionBindingsWorkersBindingKindR2BucketJurisdictionOptional

The jurisdiction of the R2 bucket.

One of the following:
const VersionBindingsWorkersBindingKindR2BucketJurisdictionEu VersionBindingsWorkersBindingKindR2BucketJurisdiction = "eu"
const VersionBindingsWorkersBindingKindR2BucketJurisdictionFedramp VersionBindingsWorkersBindingKindR2BucketJurisdiction = "fedramp"
const VersionBindingsWorkersBindingKindR2BucketJurisdictionFedrampHigh VersionBindingsWorkersBindingKindR2BucketJurisdiction = "fedramp-high"
type VersionBindingsWorkersBindingKindSecretText struct{…}
Name string

A JavaScript variable name for the binding.

Text string

The secret value to use.

Type VersionBindingsWorkersBindingKindSecretTextType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindSendEmail struct{…}
Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindSendEmailType

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 VersionBindingsWorkersBindingKindService struct{…}
Name string

A JavaScript variable name for the binding.

Service string

Name of Worker to bind to.

Type VersionBindingsWorkersBindingKindServiceType

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 VersionBindingsWorkersBindingKindTextBlob 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 VersionBindingsWorkersBindingKindTextBlobType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindVectorize struct{…}
IndexName string

Name of the Vectorize index to bind to.

Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindVectorizeType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindVersionMetadata struct{…}
Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindVersionMetadataType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindSecretsStoreSecret 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 VersionBindingsWorkersBindingKindSecretsStoreSecretType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindFlagship 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 VersionBindingsWorkersBindingKindFlagshipType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindSecretKey struct{…}
Algorithm unknown

Algorithm-specific key parameters. Learn more.

Format VersionBindingsWorkersBindingKindSecretKeyFormat

Data format of the key. Learn more.

One of the following:
const VersionBindingsWorkersBindingKindSecretKeyFormatRaw VersionBindingsWorkersBindingKindSecretKeyFormat = "raw"
const VersionBindingsWorkersBindingKindSecretKeyFormatPkcs8 VersionBindingsWorkersBindingKindSecretKeyFormat = "pkcs8"
const VersionBindingsWorkersBindingKindSecretKeyFormatSpki VersionBindingsWorkersBindingKindSecretKeyFormat = "spki"
const VersionBindingsWorkersBindingKindSecretKeyFormatJwk VersionBindingsWorkersBindingKindSecretKeyFormat = "jwk"
Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindSecretKeyType

The kind of resource that the binding provides.

Usages []VersionBindingsWorkersBindingKindSecretKeyUsage

Allowed operations with the key. Learn more.

One of the following:
const VersionBindingsWorkersBindingKindSecretKeyUsageEncrypt VersionBindingsWorkersBindingKindSecretKeyUsage = "encrypt"
const VersionBindingsWorkersBindingKindSecretKeyUsageDecrypt VersionBindingsWorkersBindingKindSecretKeyUsage = "decrypt"
const VersionBindingsWorkersBindingKindSecretKeyUsageSign VersionBindingsWorkersBindingKindSecretKeyUsage = "sign"
const VersionBindingsWorkersBindingKindSecretKeyUsageVerify VersionBindingsWorkersBindingKindSecretKeyUsage = "verify"
const VersionBindingsWorkersBindingKindSecretKeyUsageDeriveKey VersionBindingsWorkersBindingKindSecretKeyUsage = "deriveKey"
const VersionBindingsWorkersBindingKindSecretKeyUsageDeriveBits VersionBindingsWorkersBindingKindSecretKeyUsage = "deriveBits"
const VersionBindingsWorkersBindingKindSecretKeyUsageWrapKey VersionBindingsWorkersBindingKindSecretKeyUsage = "wrapKey"
const VersionBindingsWorkersBindingKindSecretKeyUsageUnwrapKey VersionBindingsWorkersBindingKindSecretKeyUsage = "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 VersionBindingsWorkersBindingKindWorkflow struct{…}
Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindWorkflowType

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 VersionBindingsWorkersBindingKindWasmModule 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 VersionBindingsWorkersBindingKindWasmModuleType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindVPCService struct{…}
Name string

A JavaScript variable name for the binding.

ServiceID string

Identifier of the VPC service to bind to.

Type VersionBindingsWorkersBindingKindVPCServiceType

The kind of resource that the binding provides.

type VersionBindingsWorkersBindingKindVPCNetwork struct{…}
Name string

A JavaScript variable name for the binding.

Type VersionBindingsWorkersBindingKindVPCNetworkType

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.

CacheOptions VersionCacheOptionsOptional

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.

Containers []VersionContainerOptional

List of containers attached to a Worker. Containers can only be attached to Durable Object classes of this Worker script.

ClassName string

Select which Durable Object class should get this container attached.

Exports map[string, VersionExport]Optional

Declarative exports for the version, including Durable Object classes (with their storage backend) and named Worker entrypoints. On reads, tombstoned lifecycle entries are omitted, so only live exports (created and expecting-transfer) are returned. exports and migrations are mutually exclusive on upload.

One of the following:
type VersionExportsWorkersWorkerExport 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 VersionExportsWorkersWorkerExportType

Marks this entry as a Worker entrypoint export.

Cache VersionExportsWorkersWorkerExportCacheOptional

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 VersionExportsWorkersWorkerExportStateOptional

Live export. May be omitted; defaults to created.

type VersionExportsWorkersDurableObjectExport 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 VersionExportsWorkersDurableObjectExportStorage

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 VersionExportsWorkersDurableObjectExportStorageSqlite VersionExportsWorkersDurableObjectExportStorage = "sqlite"
const VersionExportsWorkersDurableObjectExportStorageLegacyKV VersionExportsWorkersDurableObjectExportStorage = "legacy-kv"
Type VersionExportsWorkersDurableObjectExportType

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 VersionExportsWorkersDurableObjectExportStateOptional

Live export. May be omitted; defaults to created.

type VersionExportsWorkersDurableObjectDeletedExport 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 VersionExportsWorkersDurableObjectDeletedExportState

Tombstone that deletes the namespace.

Type VersionExportsWorkersDurableObjectDeletedExportType

Marks this entry as a Durable Object export.

type VersionExportsWorkersDurableObjectRenamedExport 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 VersionExportsWorkersDurableObjectRenamedExportState

Tombstone that renames the namespace’s class.

Type VersionExportsWorkersDurableObjectRenamedExportType

Marks this entry as a Durable Object export.

type VersionExportsWorkersDurableObjectTransferredExport 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 VersionExportsWorkersDurableObjectTransferredExportState

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 VersionExportsWorkersDurableObjectTransferredExportType

Marks this entry as a Durable Object export.

type VersionExportsWorkersDurableObjectExpectingTransferExport 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 VersionExportsWorkersDurableObjectExpectingTransferExportState

Target side of a two-phase transfer.

Storage VersionExportsWorkersDurableObjectExpectingTransferExportStorage

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 VersionExportsWorkersDurableObjectExpectingTransferExportStorageSqlite VersionExportsWorkersDurableObjectExpectingTransferExportStorage = "sqlite"
const VersionExportsWorkersDurableObjectExpectingTransferExportStorageLegacyKV VersionExportsWorkersDurableObjectExpectingTransferExportStorage = "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 VersionExportsWorkersDurableObjectExpectingTransferExportType

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
ExportsReconciliation VersionExportsReconciliationOptional

Summary of the declarative exports reconciliation that ran on this upload. Populated only when the uploaded metadata included an exports block. Durable Object entries drive reconciliation; type: worker entries do not contribute to this summary.

Created []string

Class names for which a new namespace was provisioned.

Deleted []string

Class names whose namespace was deleted by a deleted tombstone.

Info []VersionExportsReconciliationInfo

Non-blocking info entries (stale tombstones, tombstone applied with class still in code). See exports_reconciliation_info.

Class string

The class name the info entry is about.

Message string

Human-readable explanation.

Scenario VersionExportsReconciliationInfoScenario

Stable, machine-readable tag identifying which reconciliation scenario produced an error, warning, or info entry. Clients may branch on this value instead of parsing message.

One of the following:
const VersionExportsReconciliationInfoScenarioCodeClassNotInExports VersionExportsReconciliationInfoScenario = "code_class_not_in_exports"
const VersionExportsReconciliationInfoScenarioProvisionedClassMissingFromConfig VersionExportsReconciliationInfoScenario = "provisioned_class_missing_from_config"
const VersionExportsReconciliationInfoScenarioConfigExportNotInCode VersionExportsReconciliationInfoScenario = "config_export_not_in_code"
const VersionExportsReconciliationInfoScenarioConfigReferencesNonexistentClass VersionExportsReconciliationInfoScenario = "config_references_nonexistent_class"
const VersionExportsReconciliationInfoScenarioOrphanedProvisionedNamespace VersionExportsReconciliationInfoScenario = "orphaned_provisioned_namespace"
const VersionExportsReconciliationInfoScenarioStorageTypeMismatch VersionExportsReconciliationInfoScenario = "storage_type_mismatch"
const VersionExportsReconciliationInfoScenarioFreeTierRequiresSqlite VersionExportsReconciliationInfoScenario = "free_tier_requires_sqlite"
const VersionExportsReconciliationInfoScenarioInvalidExport VersionExportsReconciliationInfoScenario = "invalid_export"
const VersionExportsReconciliationInfoScenarioTombstoneDeleteClassStillInCode VersionExportsReconciliationInfoScenario = "tombstone_delete_class_still_in_code"
const VersionExportsReconciliationInfoScenarioTombstoneDeleteBlockedByExternalBindings VersionExportsReconciliationInfoScenario = "tombstone_delete_blocked_by_external_bindings"
const VersionExportsReconciliationInfoScenarioTombstoneRenamedToOccupied VersionExportsReconciliationInfoScenario = "tombstone_renamed_to_occupied"
const VersionExportsReconciliationInfoScenarioTransferredPendingNotFound VersionExportsReconciliationInfoScenario = "transferred_pending_not_found"
const VersionExportsReconciliationInfoScenarioTransferredTargetMissing VersionExportsReconciliationInfoScenario = "transferred_target_missing"
const VersionExportsReconciliationInfoScenarioTransferredTargetMismatch VersionExportsReconciliationInfoScenario = "transferred_target_mismatch"
const VersionExportsReconciliationInfoScenarioPhaseOneTransferSourceMissing VersionExportsReconciliationInfoScenario = "phase_one_transfer_source_missing"
const VersionExportsReconciliationInfoScenarioPhaseOneTransferSourceNamespaceMissing VersionExportsReconciliationInfoScenario = "phase_one_transfer_source_namespace_missing"
const VersionExportsReconciliationInfoScenarioPhaseOneTransferTargetClassProvisioned VersionExportsReconciliationInfoScenario = "phase_one_transfer_target_class_provisioned"
const VersionExportsReconciliationInfoScenarioPhaseOneTransferAfterCommitMismatch VersionExportsReconciliationInfoScenario = "phase_one_transfer_after_commit_mismatch"
const VersionExportsReconciliationInfoScenarioPhaseOneTransferDuplicate VersionExportsReconciliationInfoScenario = "phase_one_transfer_duplicate"
const VersionExportsReconciliationInfoScenarioPhaseOneTransferTargetInDispatchNamespace VersionExportsReconciliationInfoScenario = "phase_one_transfer_target_in_dispatch_namespace"
const VersionExportsReconciliationInfoScenarioPhaseOneTransferSourceInDispatchNamespace VersionExportsReconciliationInfoScenario = "phase_one_transfer_source_in_dispatch_namespace"
const VersionExportsReconciliationInfoScenarioTransferredSourceInDispatchNamespace VersionExportsReconciliationInfoScenario = "transferred_source_in_dispatch_namespace"
const VersionExportsReconciliationInfoScenarioTransferredTargetInDispatchNamespace VersionExportsReconciliationInfoScenario = "transferred_target_in_dispatch_namespace"
const VersionExportsReconciliationInfoScenarioContainerUndeclaredReference VersionExportsReconciliationInfoScenario = "container_undeclared_reference"
const VersionExportsReconciliationInfoScenarioContainerClassNotDurableObject VersionExportsReconciliationInfoScenario = "container_class_not_durable_object"
const VersionExportsReconciliationInfoScenarioContainerWiringInconsistent VersionExportsReconciliationInfoScenario = "container_wiring_inconsistent"
const VersionExportsReconciliationInfoScenarioContainerMultipleDurableObjects VersionExportsReconciliationInfoScenario = "container_multiple_durable_objects"
const VersionExportsReconciliationInfoScenarioTransferContainerParityMismatch VersionExportsReconciliationInfoScenario = "transfer_container_parity_mismatch"
const VersionExportsReconciliationInfoScenarioTransferContainerParityMismatchOnCommit VersionExportsReconciliationInfoScenario = "transfer_container_parity_mismatch_on_commit"
const VersionExportsReconciliationInfoScenarioTombstoneClassStillInCode VersionExportsReconciliationInfoScenario = "tombstone_class_still_in_code"
const VersionExportsReconciliationInfoScenarioStaleTombstone VersionExportsReconciliationInfoScenario = "stale_tombstone"
const VersionExportsReconciliationInfoScenarioTransferReceiveAlreadyApplied VersionExportsReconciliationInfoScenario = "transfer_receive_already_applied"
const VersionExportsReconciliationInfoScenarioTransferReceiveCleanupComplete VersionExportsReconciliationInfoScenario = "transfer_receive_cleanup_complete"
NamespaceID stringOptional

The provisioned namespace the entry relates to, when applicable.

formatuuid
ReferencingScripts []stringOptional

Other Workers in the account that still bind to the affected class. Advisory: while non-empty the tombstone is not yet safe to remove — redeploy these Workers with bindings re-pointed first.

RemovableEntries []string

Source class names whose tombstone entry is now stale and safe to delete from exports (no remaining referencing scripts).

Renamed []VersionExportsReconciliationRenamed

Applied renamed tombstones.

From string

The original (source) class name.

To string

The new class name (renamed_to).

TransferPending []VersionExportsReconciliationTransferPending

Phase-1 transfer hints recorded on the target side.

Class string

The target-side class name awaiting transfer.

From string

The source script the namespace will be transferred from.

Transferred []VersionExportsReconciliationTransferred

Committed transferred tombstones (phase-2).

Class string

The source class name that was transferred.

Phase VersionExportsReconciliationTransferredPhase

The transfer phase. Currently always committed.

To string

The destination script that now owns the namespace.

Updated []string

Class names whose provisioned namespace was mutated in place.

Warnings []VersionExportsReconciliationWarning

Non-blocking warnings. See exports_reconciliation_warning.

Class string

The class name the warning is about.

Message string

Human-readable explanation of the warning.

Scenario VersionExportsReconciliationWarningsScenario

Stable, machine-readable tag identifying which reconciliation scenario produced an error, warning, or info entry. Clients may branch on this value instead of parsing message.

One of the following:
const VersionExportsReconciliationWarningsScenarioCodeClassNotInExports VersionExportsReconciliationWarningsScenario = "code_class_not_in_exports"
const VersionExportsReconciliationWarningsScenarioProvisionedClassMissingFromConfig VersionExportsReconciliationWarningsScenario = "provisioned_class_missing_from_config"
const VersionExportsReconciliationWarningsScenarioConfigExportNotInCode VersionExportsReconciliationWarningsScenario = "config_export_not_in_code"
const VersionExportsReconciliationWarningsScenarioConfigReferencesNonexistentClass VersionExportsReconciliationWarningsScenario = "config_references_nonexistent_class"
const VersionExportsReconciliationWarningsScenarioOrphanedProvisionedNamespace VersionExportsReconciliationWarningsScenario = "orphaned_provisioned_namespace"
const VersionExportsReconciliationWarningsScenarioStorageTypeMismatch VersionExportsReconciliationWarningsScenario = "storage_type_mismatch"
const VersionExportsReconciliationWarningsScenarioFreeTierRequiresSqlite VersionExportsReconciliationWarningsScenario = "free_tier_requires_sqlite"
const VersionExportsReconciliationWarningsScenarioInvalidExport VersionExportsReconciliationWarningsScenario = "invalid_export"
const VersionExportsReconciliationWarningsScenarioTombstoneDeleteClassStillInCode VersionExportsReconciliationWarningsScenario = "tombstone_delete_class_still_in_code"
const VersionExportsReconciliationWarningsScenarioTombstoneDeleteBlockedByExternalBindings VersionExportsReconciliationWarningsScenario = "tombstone_delete_blocked_by_external_bindings"
const VersionExportsReconciliationWarningsScenarioTombstoneRenamedToOccupied VersionExportsReconciliationWarningsScenario = "tombstone_renamed_to_occupied"
const VersionExportsReconciliationWarningsScenarioTransferredPendingNotFound VersionExportsReconciliationWarningsScenario = "transferred_pending_not_found"
const VersionExportsReconciliationWarningsScenarioTransferredTargetMissing VersionExportsReconciliationWarningsScenario = "transferred_target_missing"
const VersionExportsReconciliationWarningsScenarioTransferredTargetMismatch VersionExportsReconciliationWarningsScenario = "transferred_target_mismatch"
const VersionExportsReconciliationWarningsScenarioPhaseOneTransferSourceMissing VersionExportsReconciliationWarningsScenario = "phase_one_transfer_source_missing"
const VersionExportsReconciliationWarningsScenarioPhaseOneTransferSourceNamespaceMissing VersionExportsReconciliationWarningsScenario = "phase_one_transfer_source_namespace_missing"
const VersionExportsReconciliationWarningsScenarioPhaseOneTransferTargetClassProvisioned VersionExportsReconciliationWarningsScenario = "phase_one_transfer_target_class_provisioned"
const VersionExportsReconciliationWarningsScenarioPhaseOneTransferAfterCommitMismatch VersionExportsReconciliationWarningsScenario = "phase_one_transfer_after_commit_mismatch"
const VersionExportsReconciliationWarningsScenarioPhaseOneTransferDuplicate VersionExportsReconciliationWarningsScenario = "phase_one_transfer_duplicate"
const VersionExportsReconciliationWarningsScenarioPhaseOneTransferTargetInDispatchNamespace VersionExportsReconciliationWarningsScenario = "phase_one_transfer_target_in_dispatch_namespace"
const VersionExportsReconciliationWarningsScenarioPhaseOneTransferSourceInDispatchNamespace VersionExportsReconciliationWarningsScenario = "phase_one_transfer_source_in_dispatch_namespace"
const VersionExportsReconciliationWarningsScenarioTransferredSourceInDispatchNamespace VersionExportsReconciliationWarningsScenario = "transferred_source_in_dispatch_namespace"
const VersionExportsReconciliationWarningsScenarioTransferredTargetInDispatchNamespace VersionExportsReconciliationWarningsScenario = "transferred_target_in_dispatch_namespace"
const VersionExportsReconciliationWarningsScenarioContainerUndeclaredReference VersionExportsReconciliationWarningsScenario = "container_undeclared_reference"
const VersionExportsReconciliationWarningsScenarioContainerClassNotDurableObject VersionExportsReconciliationWarningsScenario = "container_class_not_durable_object"
const VersionExportsReconciliationWarningsScenarioContainerWiringInconsistent VersionExportsReconciliationWarningsScenario = "container_wiring_inconsistent"
const VersionExportsReconciliationWarningsScenarioContainerMultipleDurableObjects VersionExportsReconciliationWarningsScenario = "container_multiple_durable_objects"
const VersionExportsReconciliationWarningsScenarioTransferContainerParityMismatch VersionExportsReconciliationWarningsScenario = "transfer_container_parity_mismatch"
const VersionExportsReconciliationWarningsScenarioTransferContainerParityMismatchOnCommit VersionExportsReconciliationWarningsScenario = "transfer_container_parity_mismatch_on_commit"
const VersionExportsReconciliationWarningsScenarioTombstoneClassStillInCode VersionExportsReconciliationWarningsScenario = "tombstone_class_still_in_code"
const VersionExportsReconciliationWarningsScenarioStaleTombstone VersionExportsReconciliationWarningsScenario = "stale_tombstone"
const VersionExportsReconciliationWarningsScenarioTransferReceiveAlreadyApplied VersionExportsReconciliationWarningsScenario = "transfer_receive_already_applied"
const VersionExportsReconciliationWarningsScenarioTransferReceiveCleanupComplete VersionExportsReconciliationWarningsScenario = "transfer_receive_cleanup_complete"
NamespaceID stringOptional

The provisioned namespace the warning relates to, when applicable.

formatuuid
Limits VersionLimitsOptional

Resource limits enforced at runtime.

CPUMs int64Optional

CPU time limit in milliseconds.

Subrequests int64Optional

Subrequest limit per request.

MainModule stringOptional

The name of the main module in the modules array (e.g. the name of the module that exports a fetch handler).

MigrationTag stringOptional

Durable Object migration tag. Set when the version is deployed. Omitted if the version has not been deployed or the Worker does not use Durable Objects.

Migrations VersionMigrationsOptional

Migrations for Durable Objects associated with the version. Migrations are applied when the version is deployed.

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 VersionMigrationsWorkersMultipleStepMigrations 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
Modules []VersionModuleOptional

Code, sourcemaps, and other content used at runtime.

This includes _headers and _redirects files used to configure Static Assets. _headers and _redirects files should be included as modules named _headers and _redirects with content type text/plain.

ContentBase64 string

The base64-encoded module content.

formatbyte
ContentType string

The content type of the module.

Name string

The name of the module.

PackageDependencies []VersionPackageDependencyOptional

The list of npm packages that were installed and used when this Worker version was built.

InstalledVersion string

The exact version that was resolved and installed by the package manager.

Name string

The npm package name.

PackageJsonVersion string

The version constraint as written in package.json.

Placement VersionPlacementOptional

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

One of the following:
type VersionPlacementMode struct{…}
Mode VersionPlacementModeMode
type VersionPlacementRegion struct{…}
Region string

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

type VersionPlacementHostname struct{…}
Hostname string

HTTP hostname for targeted placement.

type VersionPlacementHost struct{…}
Host string

TCP host and port for targeted placement.

type VersionPlacementObject struct{…}
Mode VersionPlacementObjectMode

Targeted placement mode.

Region string

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

type VersionPlacementObject struct{…}
Hostname string

HTTP hostname for targeted placement.

Mode VersionPlacementObjectMode

Targeted placement mode.

type VersionPlacementObject struct{…}
Host string

TCP host and port for targeted placement.

Mode VersionPlacementObjectMode

Targeted placement mode.

type VersionPlacementObject struct{…}
Mode VersionPlacementObjectMode

Targeted placement mode.

Target []VersionPlacementObjectTarget

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

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

Cloud region in format ‘provider:region’.

type VersionPlacementObjectTargetHostname struct{…}
Hostname string

HTTP hostname for targeted placement.

type VersionPlacementObjectTargetHost struct{…}
Host string

TCP host:port for targeted placement.

Source stringOptional

The client used to create the version.

StartupTimeMs int64Optional

Time in milliseconds spent on Worker startup.

DeprecatedUsageModel VersionUsageModelOptional

Usage model for the version.

One of the following:
const VersionUsageModelStandard VersionUsageModel = "standard"
const VersionUsageModelBundled VersionUsageModel = "bundled"
const VersionUsageModelUnbound VersionUsageModel = "unbound"

WorkersRoutes

List Routes
client.Workers.Routes.List(ctx, query) (*SinglePage[RouteListResponse], error)
GET/zones/{zone_id}/workers/routes
Get Route
client.Workers.Routes.Get(ctx, routeID, query) (*RouteGetResponse, error)
GET/zones/{zone_id}/workers/routes/{route_id}
Create Route
client.Workers.Routes.New(ctx, params) (*RouteNewResponse, error)
POST/zones/{zone_id}/workers/routes
Update Route
client.Workers.Routes.Update(ctx, routeID, params) (*RouteUpdateResponse, error)
PUT/zones/{zone_id}/workers/routes/{route_id}
Delete Route
client.Workers.Routes.Delete(ctx, routeID, body) (*RouteDeleteResponse, error)
DELETE/zones/{zone_id}/workers/routes/{route_id}

WorkersAssets

WorkersAssetsUpload

Upload Assets
client.Workers.Assets.Upload.New(ctx, params) (*AssetUploadNewResponse, error)
POST/accounts/{account_id}/workers/assets/upload

WorkersScripts

List Workers
client.Workers.Scripts.List(ctx, params) (*SinglePage[ScriptListResponse], error)
GET/accounts/{account_id}/workers/scripts
Search Workers
client.Workers.Scripts.Search(ctx, params) (*[]ScriptSearchResponse, error)
GET/accounts/{account_id}/workers/scripts-search
Download Worker
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.

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.

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” (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 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.

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.

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” (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 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.

WorkersScriptsAssets

WorkersScriptsAssetsUpload

Create 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

WorkersScriptsSubdomain

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

WorkersScriptsSchedules

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

WorkersScriptsTail

List Tails
client.Workers.Scripts.Tail.Get(ctx, scriptName, query) (*ScriptTailGetResponse, error)
GET/accounts/{account_id}/workers/scripts/{script_name}/tails
Start Tail
client.Workers.Scripts.Tail.New(ctx, scriptName, params) (*ScriptTailNewResponse, error)
POST/accounts/{account_id}/workers/scripts/{script_name}/tails
Delete 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.

WorkersScriptsContent

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

WorkersScriptsSettings

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

WorkersScriptsDeployments

List Deployments
client.Workers.Scripts.Deployments.List(ctx, scriptName, query) (*ScriptDeploymentListResponse, error)
GET/accounts/{account_id}/workers/scripts/{script_name}/deployments
Create Deployment
client.Workers.Scripts.Deployments.New(ctx, scriptName, params) (*Deployment, error)
POST/accounts/{account_id}/workers/scripts/{script_name}/deployments
Get Deployment
client.Workers.Scripts.Deployments.Get(ctx, scriptName, deploymentID, query) (*Deployment, error)
GET/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}
Delete 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
Percentage float64
maximum100
minimum0.01
VersionID string
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

WorkersScriptsVersions

List Versions
client.Workers.Scripts.Versions.List(ctx, scriptName, params) (*V4PagePagination[ScriptVersionListResponse], error)
GET/accounts/{account_id}/workers/scripts/{script_name}/versions
Get Version Detail
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

WorkersScriptsSecrets

List script secrets
client.Workers.Scripts.Secrets.List(ctx, scriptName, query) (*SinglePage[ScriptSecretListResponse], error)
GET/accounts/{account_id}/workers/scripts/{script_name}/secrets
Get 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 script secret
client.Workers.Scripts.Secrets.Update(ctx, scriptName, params) (*ScriptSecretUpdateResponse, error)
PUT/accounts/{account_id}/workers/scripts/{script_name}/secrets
Delete 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 script secrets
client.Workers.Scripts.Secrets.BulkUpdate(ctx, scriptName, params) (*ScriptSecretBulkUpdateResponse, error)
PATCH/accounts/{account_id}/workers/scripts/{script_name}/secrets-bulk

WorkersScriptsScript And Version Settings

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

WorkersAccount Settings

Fetch Worker Account Settings
client.Workers.AccountSettings.Get(ctx, query) (*AccountSettingGetResponse, error)
GET/accounts/{account_id}/workers/account-settings
Create Worker Account Settings
client.Workers.AccountSettings.Update(ctx, params) (*AccountSettingUpdateResponse, error)
PUT/accounts/{account_id}/workers/account-settings

WorkersDomains

List Domains
client.Workers.Domains.List(ctx, params) (*SinglePage[DomainListResponse], error)
GET/accounts/{account_id}/workers/domains
Get Domain
client.Workers.Domains.Get(ctx, domainID, query) (*DomainGetResponse, error)
GET/accounts/{account_id}/workers/domains/{domain_id}
Attach Domain
client.Workers.Domains.Update(ctx, params) (*DomainUpdateResponse, error)
PUT/accounts/{account_id}/workers/domains
Detach Domain
client.Workers.Domains.Delete(ctx, domainID, body) (*DomainDeleteResponse, error)
DELETE/accounts/{account_id}/workers/domains/{domain_id}

WorkersSubdomains

Get Subdomain
client.Workers.Subdomains.Get(ctx, query) (*SubdomainGetResponse, error)
GET/accounts/{account_id}/workers/subdomain
Create Subdomain
client.Workers.Subdomains.Update(ctx, params) (*SubdomainUpdateResponse, error)
PUT/accounts/{account_id}/workers/subdomain
Delete Subdomain
client.Workers.Subdomains.Delete(ctx, body) error
DELETE/accounts/{account_id}/workers/subdomain

WorkersObservability

WorkersObservabilityTelemetry

List keys
client.Workers.Observability.Telemetry.Keys(ctx, params) (*SinglePage[ObservabilityTelemetryKeysResponse], error)
POST/accounts/{account_id}/workers/observability/telemetry/keys
Run a query
client.Workers.Observability.Telemetry.Query(ctx, params) (*ObservabilityTelemetryQueryResponse, error)
POST/accounts/{account_id}/workers/observability/telemetry/query
List values
client.Workers.Observability.Telemetry.Values(ctx, params) (*SinglePage[ObservabilityTelemetryValuesResponse], error)
POST/accounts/{account_id}/workers/observability/telemetry/values
Prepare live tail
client.Workers.Observability.Telemetry.LiveTail(ctx, params) (*ObservabilityTelemetryLiveTailResponse, error)
POST/accounts/{account_id}/workers/observability/telemetry/live-tail
Live tail heartbeat
client.Workers.Observability.Telemetry.LiveTailHeartbeat(ctx, params) (*ObservabilityTelemetryLiveTailHeartbeatResponse, error)
POST/accounts/{account_id}/workers/observability/telemetry/live-tail/heartbeat

WorkersObservabilityDestinations

Get Destinations
client.Workers.Observability.Destinations.List(ctx, params) (*SinglePage[ObservabilityDestinationListResponse], error)
GET/accounts/{account_id}/workers/observability/destinations
Create Destination
client.Workers.Observability.Destinations.New(ctx, params) (*ObservabilityDestinationNewResponse, error)
POST/accounts/{account_id}/workers/observability/destinations
Update Destination
client.Workers.Observability.Destinations.Update(ctx, slug, params) (*ObservabilityDestinationUpdateResponse, error)
PATCH/accounts/{account_id}/workers/observability/destinations/{slug}
Delete Destination
client.Workers.Observability.Destinations.Delete(ctx, slug, body) (*ObservabilityDestinationDeleteResponse, error)
DELETE/accounts/{account_id}/workers/observability/destinations/{slug}

WorkersObservabilityQueries

Save query
client.Workers.Observability.Queries.New(ctx, params) (*ObservabilityQueryNewResponse, error)
POST/accounts/{account_id}/workers/observability/queries
List queries
client.Workers.Observability.Queries.List(ctx, params) (*SinglePage[ObservabilityQueryListResponse], error)
GET/accounts/{account_id}/workers/observability/queries

WorkersObservabilityShared Queries

Create a sharable link to a query result
client.Workers.Observability.SharedQueries.New(ctx, params) (*ObservabilitySharedQueryNewResponse, error)
POST/accounts/{account_id}/workers/observability/shared/query
View a query that has been shared
client.Workers.Observability.SharedQueries.Get(ctx, id, params) (*ObservabilitySharedQueryGetResponse, error)
GET/accounts/{account_id}/workers/observability/shared/query/{id}