---
title: Scripts
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[Workers](https://developers.cloudflare.com/api/go/resources/workers)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Scripts

##### [List Worker Scripts](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/methods/list)

client.Workers.Scripts.List(ctx, params) (\*SinglePage\[[ScriptListResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts%20%3E%20(model)%20ScriptListResponse%20%3E%20(schema)>)], error)

GET/accounts/{account\_id}/workers/scripts

##### [Search Worker Scripts](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/methods/search)

client.Workers.Scripts.Search(ctx, params) (\*\[] [ScriptSearchResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts%20%3E%20(model)%20ScriptSearchResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/workers/scripts-search

##### [Download Worker Script](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/methods/get)

client.Workers.Scripts.Get(ctx, scriptName, query) (\*string, error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}

##### [Upload Worker Module](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/methods/update)

client.Workers.Scripts.Update(ctx, scriptName, params) (\*[ScriptUpdateResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts%20%3E%20(model)%20ScriptUpdateResponse%20%3E%20(schema)>), error)

PUT/accounts/{account\_id}/workers/scripts/{script\_name}

##### [Delete Worker](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/methods/delete)

client.Workers.Scripts.Delete(ctx, scriptName, params) (\*[ScriptDeleteResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts%20%3E%20(model)%20ScriptDeleteResponse%20%3E%20(schema)>), error)

DELETE/accounts/{account\_id}/workers/scripts/{script\_name}

##### ModelsExpand Collapse

<details>

<summary>

type Script struct{…}

</summary>

ID stringOptional

The name used to identify the script.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

CacheOptions ScriptCacheOptionsOptional

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

</summary>

Enabled bool

Whether caching is enabled for this Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20cache_options%20%3E%20(property)%20enabled">Link to this property</a>

CrossVersionCache boolOptional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20cache_options%20%3E%20(property)%20cross_version_cache">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20cache_options">Link to this property</a>

CompatibilityDate stringOptional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20compatibility_date">Link to this property</a>

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 <code>compatibility_date</code>.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20compatibility_flags">Link to this property</a>

CreatedOn TimeOptional

When the script was created.

formatdate-time

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20created_on">Link to this property</a>

Etag stringOptional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20etag">Link to this property</a>

<details>

<summary>

Exports map\[string, ScriptExport]Optional

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

</summary>

One of the following:

<details>

<summary>

type ScriptExportsWorkersWorkerExport struct{…}

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

</summary>

Type ScriptExportsWorkersWorkerExportType

Marks this entry as a Worker entrypoint export.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%200%20%3E%20(property)%20type">Link to this property</a>

<details>

<summary>

Cache ScriptExportsWorkersWorkerExportCacheOptional

Cache override for this entrypoint. Overrides the Worker’s global <code>cache_options.enabled</code> for this entrypoint only.

</summary>

Enabled bool

Whether caching is enabled for this entrypoint.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%200%20%3E%20(property)%20cache%20%3E%20(property)%20enabled">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%200%20%3E%20(property)%20cache">Link to this property</a>

State ScriptExportsWorkersWorkerExportStateOptional

Live export. May be omitted; defaults to <code>created</code>.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%200%20%3E%20(property)%20state">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

type ScriptExportsWorkersDurableObjectExport struct{…}

A live Durable Object export (<code>state: created</code>, 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. <code>storage</code> is required; <code>renamed_to</code>, <code>transferred_to</code> and <code>transfer_from</code> are not allowed on a live entry.

</summary>

<details>

<summary>

Storage ScriptExportsWorkersDurableObjectExportStorage

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

</summary>

One of the following:

const ScriptExportsWorkersDurableObjectExportStorageSqlite ScriptExportsWorkersDurableObjectExportStorage = "sqlite"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20storage%20%3E%20(member)%200">Link to this property</a>

const ScriptExportsWorkersDurableObjectExportStorageLegacyKV ScriptExportsWorkersDurableObjectExportStorage = "legacy-kv"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20storage%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20storage">Link to this property</a>

Type ScriptExportsWorkersDurableObjectExportType

Marks this entry as a Durable Object export.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20type">Link to this property</a>

Container stringOptional

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

maxLength128

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20container">Link to this property</a>

State ScriptExportsWorkersDurableObjectExportStateOptional

Live export. May be omitted; defaults to <code>created</code>.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20state">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%201">Link to this property</a>

<details>

<summary>

type ScriptExportsWorkersDurableObjectDeletedExport struct{…}

A <code>deleted</code> 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.

</summary>

State ScriptExportsWorkersDurableObjectDeletedExportState

Tombstone that deletes the namespace.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%202%20%3E%20(property)%20state">Link to this property</a>

Type ScriptExportsWorkersDurableObjectDeletedExportType

Marks this entry as a Durable Object export.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%202%20%3E%20(property)%20type">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%202">Link to this property</a>

<details>

<summary>

type ScriptExportsWorkersDurableObjectRenamedExport struct{…}

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

</summary>

RenamedTo string

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

maxLength128

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%203%20%3E%20(property)%20renamed_to">Link to this property</a>

State ScriptExportsWorkersDurableObjectRenamedExportState

Tombstone that renames the namespace’s class.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%203%20%3E%20(property)%20state">Link to this property</a>

Type ScriptExportsWorkersDurableObjectRenamedExportType

Marks this entry as a Durable Object export.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%203%20%3E%20(property)%20type">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%203">Link to this property</a>

<details>

<summary>

type ScriptExportsWorkersDurableObjectTransferredExport struct{…}

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

</summary>

State ScriptExportsWorkersDurableObjectTransferredExportState

Tombstone that transfers the namespace to another script.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%204%20%3E%20(property)%20state">Link to this property</a>

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%204%20%3E%20(property)%20transferred_to">Link to this property</a>

Type ScriptExportsWorkersDurableObjectTransferredExportType

Marks this entry as a Durable Object export.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%204%20%3E%20(property)%20type">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%204">Link to this property</a>

<details>

<summary>

type ScriptExportsWorkersDurableObjectExpectingTransferExport struct{…}

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

</summary>

State ScriptExportsWorkersDurableObjectExpectingTransferExportState

Target side of a two-phase transfer.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%205%20%3E%20(property)%20state">Link to this property</a>

<details>

<summary>

Storage ScriptExportsWorkersDurableObjectExpectingTransferExportStorage

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

</summary>

One of the following:

const ScriptExportsWorkersDurableObjectExpectingTransferExportStorageSqlite ScriptExportsWorkersDurableObjectExpectingTransferExportStorage = "sqlite"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%205%20%3E%20(property)%20storage%20%3E%20(member)%200">Link to this property</a>

const ScriptExportsWorkersDurableObjectExpectingTransferExportStorageLegacyKV ScriptExportsWorkersDurableObjectExpectingTransferExportStorage = "legacy-kv"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%205%20%3E%20(property)%20storage%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%205%20%3E%20(property)%20storage">Link to this property</a>

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 <code>expecting-transfer</code> entries.

maxLength128

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%205%20%3E%20(property)%20transfer_from">Link to this property</a>

Type ScriptExportsWorkersDurableObjectExpectingTransferExportType

Marks this entry as a Durable Object export.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%205%20%3E%20(property)%20type">Link to this property</a>

Container stringOptional

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

maxLength128

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%205%20%3E%20(property)%20container">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports%20%3E%20(items)%20%3E%20(variant)%205">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20exports">Link to this property</a>

Handlers \[]stringOptional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20handlers">Link to this property</a>

HasAssets boolOptional

Whether a Worker contains assets.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20has_assets">Link to this property</a>

HasModules boolOptional

Whether a Worker contains modules.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20has_modules">Link to this property</a>

LastDeployedFrom stringOptional

The client most recently used to deploy this Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20last_deployed_from">Link to this property</a>

Logpush boolOptional

Whether Logpush is turned on for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20logpush">Link to this property</a>

MigrationTag stringOptional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20migration_tag">Link to this property</a>

ModifiedOn TimeOptional

When the script was last modified.

formatdate-time

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20modified_on">Link to this property</a>

<details>

<summary>

NamedHandlers \[]ScriptNamedHandlerOptional

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

</summary>

Handlers \[]stringOptional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20named_handlers%20%3E%20(items)%20%3E%20(property)%20handlers">Link to this property</a>

Name stringOptional

The name of the export.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20named_handlers%20%3E%20(items)%20%3E%20(property)%20name">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20named_handlers">Link to this property</a>

<details>

<summary>

Observability ScriptObservabilityOptional

Observability settings for the Worker.

</summary>

Enabled bool

Whether observability is enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20enabled">Link to this property</a>

HeadSamplingRate float64Optional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20head_sampling_rate">Link to this property</a>

<details>

<summary>

Issues ScriptObservabilityIssuesOptional

Real-time Issues settings for the Worker.

</summary>

Enabled boolOptional

Whether real-time Issues are enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20issues%20%3E%20(property)%20enabled">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20issues">Link to this property</a>

<details>

<summary>

Logs ScriptObservabilityLogsOptional

Log settings for the Worker.

</summary>

Enabled bool

Whether logs are enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20logs%20%3E%20(property)%20enabled">Link to this property</a>

InvocationLogs bool

Whether <a href="https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs">invocation logs</a> are enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20logs%20%3E%20(property)%20invocation_logs">Link to this property</a>

Destinations \[]stringOptional

A list of destinations where logs will be exported to.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20logs%20%3E%20(property)%20destinations">Link to this property</a>

HeadSamplingRate float64Optional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20logs%20%3E%20(property)%20head_sampling_rate">Link to this property</a>

Persist boolOptional

Whether log persistence is enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20logs%20%3E%20(property)%20persist">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20logs">Link to this property</a>

RedactQueryString boolOptional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20redact_query_string">Link to this property</a>

<details>

<summary>

Traces ScriptObservabilityTracesOptional

Trace settings for the Worker.

</summary>

Destinations \[]stringOptional

A list of destinations where traces will be exported to.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20destinations">Link to this property</a>

Enabled boolOptional

Whether traces are enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20enabled">Link to this property</a>

HeadSamplingRate float64Optional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20head_sampling_rate">Link to this property</a>

Persist boolOptional

Whether trace persistence is enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20persist">Link to this property</a>

<details>

<summary>

PropagationPolicy ScriptObservabilityTracesPropagationPolicyOptional

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

</summary>

One of the following:

const ScriptObservabilityTracesPropagationPolicyAuthenticated ScriptObservabilityTracesPropagationPolicy = "authenticated"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20propagation_policy%20%3E%20(member)%200">Link to this property</a>

const ScriptObservabilityTracesPropagationPolicyAccept ScriptObservabilityTracesPropagationPolicy = "accept"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20propagation_policy%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20propagation_policy">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20observability">Link to this property</a>

<details>

<summary>

Placement ScriptPlacementOptional

Configuration for <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.

</summary>

One of the following:

<details>

<summary>

type ScriptPlacementObject struct{…}

</summary>

Mode ScriptPlacementObjectMode

Enables <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%200%20%3E%20(property)%20mode">Link to this property</a>

LastAnalyzedAt TimeOptional

The last time the script was analyzed for <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

formatdate-time

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%200%20%3E%20(property)%20last_analyzed_at">Link to this property</a>

<details>

<summary>

Status ScriptPlacementObjectStatusOptional

Status of <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

</summary>

One of the following:

const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%200%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED\_APPLICATION"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%200%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT\_INVOCATIONS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%200%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%200%20%3E%20(property)%20status">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

type ScriptPlacementObject struct{…}

</summary>

Region string

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%201%20%3E%20(property)%20region">Link to this property</a>

LastAnalyzedAt TimeOptional

The last time the script was analyzed for <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

formatdate-time

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%201%20%3E%20(property)%20last_analyzed_at">Link to this property</a>

<details>

<summary>

Status ScriptPlacementObjectStatusOptional

Status of <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

</summary>

One of the following:

const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%201%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED\_APPLICATION"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%201%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT\_INVOCATIONS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%201%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%201%20%3E%20(property)%20status">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%201">Link to this property</a>

<details>

<summary>

type ScriptPlacementObject struct{…}

</summary>

Hostname string

HTTP hostname for targeted placement.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%202%20%3E%20(property)%20hostname">Link to this property</a>

LastAnalyzedAt TimeOptional

The last time the script was analyzed for <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

formatdate-time

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%202%20%3E%20(property)%20last_analyzed_at">Link to this property</a>

<details>

<summary>

Status ScriptPlacementObjectStatusOptional

Status of <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

</summary>

One of the following:

const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%202%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED\_APPLICATION"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%202%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT\_INVOCATIONS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%202%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%202%20%3E%20(property)%20status">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%202">Link to this property</a>

<details>

<summary>

type ScriptPlacementObject struct{…}

</summary>

Host string

TCP host and port for targeted placement.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%203%20%3E%20(property)%20host">Link to this property</a>

LastAnalyzedAt TimeOptional

The last time the script was analyzed for <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

formatdate-time

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%203%20%3E%20(property)%20last_analyzed_at">Link to this property</a>

<details>

<summary>

Status ScriptPlacementObjectStatusOptional

Status of <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

</summary>

One of the following:

const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%203%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED\_APPLICATION"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%203%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT\_INVOCATIONS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%203%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%203%20%3E%20(property)%20status">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%203">Link to this property</a>

<details>

<summary>

type ScriptPlacementObject struct{…}

</summary>

Mode ScriptPlacementObjectMode

Targeted placement mode.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%204%20%3E%20(property)%20mode">Link to this property</a>

Region string

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%204%20%3E%20(property)%20region">Link to this property</a>

LastAnalyzedAt TimeOptional

The last time the script was analyzed for <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

formatdate-time

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%204%20%3E%20(property)%20last_analyzed_at">Link to this property</a>

<details>

<summary>

Status ScriptPlacementObjectStatusOptional

Status of <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

</summary>

One of the following:

const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%204%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED\_APPLICATION"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%204%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT\_INVOCATIONS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%204%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%204%20%3E%20(property)%20status">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%204">Link to this property</a>

<details>

<summary>

type ScriptPlacementObject struct{…}

</summary>

Hostname string

HTTP hostname for targeted placement.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%205%20%3E%20(property)%20hostname">Link to this property</a>

Mode ScriptPlacementObjectMode

Targeted placement mode.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%205%20%3E%20(property)%20mode">Link to this property</a>

LastAnalyzedAt TimeOptional

The last time the script was analyzed for <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

formatdate-time

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%205%20%3E%20(property)%20last_analyzed_at">Link to this property</a>

<details>

<summary>

Status ScriptPlacementObjectStatusOptional

Status of <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

</summary>

One of the following:

const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%205%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED\_APPLICATION"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%205%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT\_INVOCATIONS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%205%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%205%20%3E%20(property)%20status">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%205">Link to this property</a>

<details>

<summary>

type ScriptPlacementObject struct{…}

</summary>

Host string

TCP host and port for targeted placement.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%206%20%3E%20(property)%20host">Link to this property</a>

Mode ScriptPlacementObjectMode

Targeted placement mode.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%206%20%3E%20(property)%20mode">Link to this property</a>

LastAnalyzedAt TimeOptional

The last time the script was analyzed for <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

formatdate-time

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%206%20%3E%20(property)%20last_analyzed_at">Link to this property</a>

<details>

<summary>

Status ScriptPlacementObjectStatusOptional

Status of <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

</summary>

One of the following:

const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%206%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED\_APPLICATION"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%206%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT\_INVOCATIONS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%206%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%206%20%3E%20(property)%20status">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%206">Link to this property</a>

<details>

<summary>

type ScriptPlacementObject struct{…}

</summary>

Mode ScriptPlacementObjectMode

Targeted placement mode.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20mode">Link to this property</a>

<details>

<summary>

Target \[]ScriptPlacementObjectTarget

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

</summary>

One of the following:

<details>

<summary>

type ScriptPlacementObjectTargetRegion struct{…}

</summary>

Region string

Cloud region in format ‘provider:region’.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20target%20%3E%20(items)%20%3E%20(variant)%200%20%3E%20(property)%20region">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20target%20%3E%20(items)%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

type ScriptPlacementObjectTargetHostname struct{…}

</summary>

Hostname string

HTTP hostname for targeted placement.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20target%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20hostname">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20target%20%3E%20(items)%20%3E%20(variant)%201">Link to this property</a>

<details>

<summary>

type ScriptPlacementObjectTargetHost struct{…}

</summary>

Host string

TCP host:port for targeted placement.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20target%20%3E%20(items)%20%3E%20(variant)%202%20%3E%20(property)%20host">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20target%20%3E%20(items)%20%3E%20(variant)%202">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20target">Link to this property</a>

LastAnalyzedAt TimeOptional

The last time the script was analyzed for <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

formatdate-time

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20last_analyzed_at">Link to this property</a>

<details>

<summary>

Status ScriptPlacementObjectStatusOptional

Status of <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

</summary>

One of the following:

const ScriptPlacementObjectStatusSuccess ScriptPlacementObjectStatus = "SUCCESS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const ScriptPlacementObjectStatusUnsupportedApplication ScriptPlacementObjectStatus = "UNSUPPORTED\_APPLICATION"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

const ScriptPlacementObjectStatusInsufficientInvocations ScriptPlacementObjectStatus = "INSUFFICIENT\_INVOCATIONS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207%20%3E%20(property)%20status">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement%20%3E%20(variant)%207">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement">Link to this property</a>

<details>

<summary>

DeprecatedPlacementMode ScriptPlacementModeOptional

Configuration for <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.

</summary>

One of the following:

const ScriptPlacementModeSmart ScriptPlacementMode = "smart"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement_mode%20%3E%20(member)%200">Link to this property</a>

const ScriptPlacementModeTargeted ScriptPlacementMode = "targeted"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement_mode%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement_mode">Link to this property</a>

<details>

<summary>

DeprecatedPlacementStatus ScriptPlacementStatusOptional

Status of <a href="https://developers.cloudflare.com/workers/configuration/smart-placement">Smart Placement</a>.

</summary>

One of the following:

const ScriptPlacementStatusSuccess ScriptPlacementStatus = "SUCCESS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement_status%20%3E%20(member)%200">Link to this property</a>

const ScriptPlacementStatusUnsupportedApplication ScriptPlacementStatus = "UNSUPPORTED\_APPLICATION"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement_status%20%3E%20(member)%201">Link to this property</a>

const ScriptPlacementStatusInsufficientInvocations ScriptPlacementStatus = "INSUFFICIENT\_INVOCATIONS"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement_status%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20placement_status">Link to this property</a>

Tag stringOptional

The immutable ID of the script.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20tag">Link to this property</a>

Tags \[]stringOptional

Tags associated with the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20tags">Link to this property</a>

<details>

<summary>

TailConsumers \[]<a href="https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.tail%20%3E%20(model)%20consumer_script%20%3E%20(schema)">ConsumerScript</a>Optional

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

</summary>

Service string

Name of Worker that is to be the consumer.

<a href="#(resource)%20workers.scripts.tail%20%3E%20(model)%20consumer_script%20%3E%20(schema)%20%3E%20(property)%20service">Link to this property</a>

Environment stringOptional

Optional environment if the Worker utilizes one.

<a href="#(resource)%20workers.scripts.tail%20%3E%20(model)%20consumer_script%20%3E%20(schema)%20%3E%20(property)%20environment">Link to this property</a>

Namespace stringOptional

Optional dispatch namespace the script belongs to.

<a href="#(resource)%20workers.scripts.tail%20%3E%20(model)%20consumer_script%20%3E%20(schema)%20%3E%20(property)%20namespace">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20tail_consumers">Link to this property</a>

<details>

<summary>

UsageModel ScriptUsageModelOptional

Usage model for the Worker invocations.

</summary>

One of the following:

const ScriptUsageModelStandard ScriptUsageModel = "standard"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20usage_model%20%3E%20(member)%200">Link to this property</a>

const ScriptUsageModelBundled ScriptUsageModel = "bundled"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20usage_model%20%3E%20(member)%201">Link to this property</a>

const ScriptUsageModelUnbound ScriptUsageModel = "unbound"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20usage_model%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)%20%3E%20(property)%20usage_model">Link to this property</a>

</details>

[Link to this property](<#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)>)

<details>

<summary>

type ScriptSetting struct{…}

</summary>

Logpush boolOptional

Whether Logpush is turned on for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20logpush">Link to this property</a>

<details>

<summary>

Observability ScriptSettingObservabilityOptional

Observability settings for the Worker.

</summary>

Enabled bool

Whether observability is enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20enabled">Link to this property</a>

HeadSamplingRate float64Optional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20head_sampling_rate">Link to this property</a>

<details>

<summary>

Issues ScriptSettingObservabilityIssuesOptional

Real-time Issues settings for the Worker.

</summary>

Enabled boolOptional

Whether real-time Issues are enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20issues%20%3E%20(property)%20enabled">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20issues">Link to this property</a>

<details>

<summary>

Logs ScriptSettingObservabilityLogsOptional

Log settings for the Worker.

</summary>

Enabled bool

Whether logs are enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20logs%20%3E%20(property)%20enabled">Link to this property</a>

InvocationLogs bool

Whether <a href="https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs">invocation logs</a> are enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20logs%20%3E%20(property)%20invocation_logs">Link to this property</a>

Destinations \[]stringOptional

A list of destinations where logs will be exported to.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20logs%20%3E%20(property)%20destinations">Link to this property</a>

HeadSamplingRate float64Optional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20logs%20%3E%20(property)%20head_sampling_rate">Link to this property</a>

Persist boolOptional

Whether log persistence is enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20logs%20%3E%20(property)%20persist">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20logs">Link to this property</a>

RedactQueryString boolOptional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20redact_query_string">Link to this property</a>

<details>

<summary>

Traces ScriptSettingObservabilityTracesOptional

Trace settings for the Worker.

</summary>

Destinations \[]stringOptional

A list of destinations where traces will be exported to.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20destinations">Link to this property</a>

Enabled boolOptional

Whether traces are enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20enabled">Link to this property</a>

HeadSamplingRate float64Optional

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

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20head_sampling_rate">Link to this property</a>

Persist boolOptional

Whether trace persistence is enabled for the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20persist">Link to this property</a>

<details>

<summary>

PropagationPolicy ScriptSettingObservabilityTracesPropagationPolicyOptional

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

</summary>

One of the following:

const ScriptSettingObservabilityTracesPropagationPolicyAuthenticated ScriptSettingObservabilityTracesPropagationPolicy = "authenticated"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20propagation_policy%20%3E%20(member)%200">Link to this property</a>

const ScriptSettingObservabilityTracesPropagationPolicyAccept ScriptSettingObservabilityTracesPropagationPolicy = "accept"

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20propagation_policy%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces%20%3E%20(property)%20propagation_policy">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability%20%3E%20(property)%20traces">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20observability">Link to this property</a>

Tags \[]stringOptional

Tags associated with the Worker.

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20tags">Link to this property</a>

<details>

<summary>

TailConsumers \[]<a href="https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.tail%20%3E%20(model)%20consumer_script%20%3E%20(schema)">ConsumerScript</a>Optional

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

</summary>

Service string

Name of Worker that is to be the consumer.

<a href="#(resource)%20workers.scripts.tail%20%3E%20(model)%20consumer_script%20%3E%20(schema)%20%3E%20(property)%20service">Link to this property</a>

Environment stringOptional

Optional environment if the Worker utilizes one.

<a href="#(resource)%20workers.scripts.tail%20%3E%20(model)%20consumer_script%20%3E%20(schema)%20%3E%20(property)%20environment">Link to this property</a>

Namespace stringOptional

Optional dispatch namespace the script belongs to.

<a href="#(resource)%20workers.scripts.tail%20%3E%20(model)%20consumer_script%20%3E%20(schema)%20%3E%20(property)%20namespace">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)%20%3E%20(property)%20tail_consumers">Link to this property</a>

</details>

[Link to this property](<#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)>)

#### ScriptsAssets

#### ScriptsAssetsUpload

##### [Create Worker Assets Upload Session](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/assets/subresources/upload/methods/create)

client.Workers.Scripts.Assets.Upload.New(ctx, scriptName, params) (\*[ScriptAssetUploadNewResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.assets.upload%20%3E%20(model)%20ScriptAssetUploadNewResponse%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/workers/scripts/{script\_name}/assets-upload-session

#### ScriptsSubdomain

##### [Get Worker Script Subdomain](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/subdomain/methods/get)

client.Workers.Scripts.Subdomain.Get(ctx, scriptName, query) (\*[ScriptSubdomainGetResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.subdomain%20%3E%20(model)%20ScriptSubdomainGetResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}/subdomain

##### [Update Worker Script Subdomain](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/subdomain/methods/create)

client.Workers.Scripts.Subdomain.New(ctx, scriptName, params) (\*[ScriptSubdomainNewResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.subdomain%20%3E%20(model)%20ScriptSubdomainNewResponse%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/workers/scripts/{script\_name}/subdomain

##### [Delete Worker Script Subdomain](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/subdomain/methods/delete)

client.Workers.Scripts.Subdomain.Delete(ctx, scriptName, body) (\*[ScriptSubdomainDeleteResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.subdomain%20%3E%20(model)%20ScriptSubdomainDeleteResponse%20%3E%20(schema)>), error)

DELETE/accounts/{account\_id}/workers/scripts/{script\_name}/subdomain

#### ScriptsSchedules

##### [Get Worker Script Schedules (Cron Triggers)](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/schedules/methods/get)

client.Workers.Scripts.Schedules.Get(ctx, scriptName, query) (\*[ScriptScheduleGetResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.schedules%20%3E%20(model)%20ScriptScheduleGetResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}/schedules

##### [Update Worker Script Schedules (Cron Triggers)](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/schedules/methods/update)

client.Workers.Scripts.Schedules.Update(ctx, scriptName, params) (\*[ScriptScheduleUpdateResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.schedules%20%3E%20(model)%20ScriptScheduleUpdateResponse%20%3E%20(schema)>), error)

PUT/accounts/{account\_id}/workers/scripts/{script\_name}/schedules

#### ScriptsTail

##### [List Worker Tails](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/tail/methods/get)

client.Workers.Scripts.Tail.Get(ctx, scriptName, query) (\*[ScriptTailGetResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.tail%20%3E%20(model)%20ScriptTailGetResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}/tails

##### [Start Worker Tail](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/tail/methods/create)

client.Workers.Scripts.Tail.New(ctx, scriptName, body) (\*[ScriptTailNewResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.tail%20%3E%20(model)%20ScriptTailNewResponse%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/workers/scripts/{script\_name}/tails

##### [Delete Worker Tail](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/tail/methods/delete)

client.Workers.Scripts.Tail.Delete(ctx, scriptName, id, body) (\*[ScriptTailDeleteResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.tail%20%3E%20(model)%20ScriptTailDeleteResponse%20%3E%20(schema)>), error)

DELETE/accounts/{account\_id}/workers/scripts/{script\_name}/tails/{id}

##### ModelsExpand Collapse

<details>

<summary>

type ConsumerScript struct{…}

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

</summary>

Service string

Name of Worker that is to be the consumer.

<a href="#(resource)%20workers.scripts.tail%20%3E%20(model)%20consumer_script%20%3E%20(schema)%20%3E%20(property)%20service">Link to this property</a>

Environment stringOptional

Optional environment if the Worker utilizes one.

<a href="#(resource)%20workers.scripts.tail%20%3E%20(model)%20consumer_script%20%3E%20(schema)%20%3E%20(property)%20environment">Link to this property</a>

Namespace stringOptional

Optional dispatch namespace the script belongs to.

<a href="#(resource)%20workers.scripts.tail%20%3E%20(model)%20consumer_script%20%3E%20(schema)%20%3E%20(property)%20namespace">Link to this property</a>

</details>

[Link to this property](<#(resource)%20workers.scripts.tail%20%3E%20(model)%20consumer_script%20%3E%20(schema)>)

#### ScriptsContent

##### [Get Worker Script Content](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/content/methods/get)

client.Workers.Scripts.Content.Get(ctx, scriptName, query) (\*Response, error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}/content/v2

##### [Replace Worker Script Content](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/content/methods/update)

client.Workers.Scripts.Content.Update(ctx, scriptName, params) (\*[Script](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts%20%3E%20(model)%20script%20%3E%20(schema)>), error)

PUT/accounts/{account\_id}/workers/scripts/{script\_name}/content

#### ScriptsSettings

##### [Get Worker Script Settings](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/settings/methods/get)

client.Workers.Scripts.Settings.Get(ctx, scriptName, query) (\*[ScriptSetting](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}/script-settings

##### [Patch Worker Script Settings](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/settings/methods/edit)

client.Workers.Scripts.Settings.Edit(ctx, scriptName, params) (\*[ScriptSetting](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts%20%3E%20(model)%20script_setting%20%3E%20(schema)>), error)

PATCH/accounts/{account\_id}/workers/scripts/{script\_name}/script-settings

#### ScriptsDeployments

##### [List Worker Deployments](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/deployments/methods/list)

client.Workers.Scripts.Deployments.List(ctx, scriptName, params) (\*V4PagePagination\[[ScriptDeploymentListResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.deployments%20%3E%20(model)%20ScriptDeploymentListResponse%20%3E%20(schema)>)], error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}/deployments

##### [Create Worker Deployment](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/deployments/methods/create)

client.Workers.Scripts.Deployments.New(ctx, scriptName, params) (\*[Deployment](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/workers/scripts/{script\_name}/deployments

##### [Get Worker Deployment](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/deployments/methods/get)

client.Workers.Scripts.Deployments.Get(ctx, scriptName, deploymentID, query) (\*[Deployment](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}/deployments/{deployment\_id}

##### [Delete Worker Deployment](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/deployments/methods/delete)

client.Workers.Scripts.Deployments.Delete(ctx, scriptName, deploymentID, body) (\*[ScriptDeploymentDeleteResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.deployments%20%3E%20(model)%20ScriptDeploymentDeleteResponse%20%3E%20(schema)>), error)

DELETE/accounts/{account\_id}/workers/scripts/{script\_name}/deployments/{deployment\_id}

##### ModelsExpand Collapse

<details>

<summary>

type Deployment struct{…}

</summary>

ID string

formatuuid

<a href="#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

CreatedOn Time

formatdate-time

<a href="#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20created_on">Link to this property</a>

Source string

<a href="#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20source">Link to this property</a>

Strategy DeploymentStrategy

<a href="#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20strategy">Link to this property</a>

<details>

<summary>

Versions \[]DeploymentVersion

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

</summary>

Percentage float64

Percentage of traffic served by this version.

maximum100

minimum0.01

<a href="#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20versions%20%3E%20(items)%20%3E%20(property)%20percentage">Link to this property</a>

VersionID string

Identifier of the Worker Version.

formatuuid

<a href="#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20versions%20%3E%20(items)%20%3E%20(property)%20version_id">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20versions">Link to this property</a>

<details>

<summary>

Annotations DeploymentAnnotationsOptional

</summary>

WorkersMessage stringOptional

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

maxLength1000

<a href="#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20annotations%20%3E%20(property)%20workers%2Fmessage">Link to this property</a>

WorkersTriggeredBy stringOptional

Operation that triggered the creation of the deployment.

<a href="#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20annotations%20%3E%20(property)%20workers%2Ftriggered_by">Link to this property</a>

</details>

<a href="#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20annotations">Link to this property</a>

AuthorEmail stringOptional

formatemail

<a href="#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)%20%3E%20(property)%20author_email">Link to this property</a>

</details>

[Link to this property](<#(resource)%20workers.scripts.deployments%20%3E%20(model)%20deployment%20%3E%20(schema)>)

#### ScriptsVersions

##### [List Versions](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/versions/methods/list)

client.Workers.Scripts.Versions.List(ctx, scriptName, params) (\*V4PagePagination\[[ScriptVersionListResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.versions%20%3E%20(model)%20ScriptVersionListResponse%20%3E%20(schema)>)], error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}/versions

##### [Get Worker Script Version](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/versions/methods/get)

client.Workers.Scripts.Versions.Get(ctx, scriptName, versionID, query) (\*[ScriptVersionGetResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.versions%20%3E%20(model)%20ScriptVersionGetResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}/versions/{version\_id}

##### [Upload Version](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/versions/methods/create)

client.Workers.Scripts.Versions.New(ctx, scriptName, params) (\*[ScriptVersionNewResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.versions%20%3E%20(model)%20ScriptVersionNewResponse%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/workers/scripts/{script\_name}/versions

#### ScriptsSecrets

##### [List secrets bound to a Worker script](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/secrets/methods/list)

client.Workers.Scripts.Secrets.List(ctx, scriptName, query) (\*SinglePage\[[ScriptSecretListResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.secrets%20%3E%20(model)%20ScriptSecretListResponse%20%3E%20(schema)>)], error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}/secrets

##### [Get a secret binding](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/secrets/methods/get)

client.Workers.Scripts.Secrets.Get(ctx, scriptName, secretName, params) (\*[ScriptSecretGetResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.secrets%20%3E%20(model)%20ScriptSecretGetResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}/secrets/{secret\_name}

##### [Add a secret to a Worker script](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/secrets/methods/update)

client.Workers.Scripts.Secrets.Update(ctx, scriptName, params) (\*[ScriptSecretUpdateResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.secrets%20%3E%20(model)%20ScriptSecretUpdateResponse%20%3E%20(schema)>), error)

PUT/accounts/{account\_id}/workers/scripts/{script\_name}/secrets

##### [Delete Worker script secret](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/secrets/methods/delete)

client.Workers.Scripts.Secrets.Delete(ctx, scriptName, secretName, params) (\*[ScriptSecretDeleteResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.secrets%20%3E%20(model)%20ScriptSecretDeleteResponse%20%3E%20(schema)>), error)

DELETE/accounts/{account\_id}/workers/scripts/{script\_name}/secrets/{secret\_name}

##### [Patch multiple Worker script secrets](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/secrets/methods/bulk_update)

client.Workers.Scripts.Secrets.BulkUpdate(ctx, scriptName, params) (\*[ScriptSecretBulkUpdateResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.secrets%20%3E%20(model)%20ScriptSecretBulkUpdateResponse%20%3E%20(schema)>), error)

PATCH/accounts/{account\_id}/workers/scripts/{script\_name}/secrets-bulk

#### ScriptsScript And Version Settings

##### [Get Worker Script and Version Settings](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/script_and_version_settings/methods/get)

client.Workers.Scripts.ScriptAndVersionSettings.Get(ctx, scriptName, query) (\*[ScriptScriptAndVersionSettingGetResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.script_and_version_settings%20%3E%20(model)%20ScriptScriptAndVersionSettingGetResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/workers/scripts/{script\_name}/settings

##### [Patch Worker Script and Version Settings](https://developers.cloudflare.com/api/go/resources/workers/subresources/scripts/subresources/script_and_version_settings/methods/edit)

client.Workers.Scripts.ScriptAndVersionSettings.Edit(ctx, scriptName, params) (\*[ScriptScriptAndVersionSettingEditResponse](<https://developers.cloudflare.com/api/go/resources/workers#(resource)%20workers.scripts.script_and_version_settings%20%3E%20(model)%20ScriptScriptAndVersionSettingEditResponse%20%3E%20(schema)>), error)

PATCH/accounts/{account\_id}/workers/scripts/{script\_name}/settings