## List Workers **get** `/accounts/{account_id}/workers/scripts` Fetch a list of uploaded workers. ### Path Parameters - `account_id: string` Identifier. ### Query Parameters - `tags: optional string` Filter scripts by tags. Format: comma-separated list of tag:allowed pairs where allowed is 'yes' or 'no'. ### Returns - `errors: array of object { code, message, documentation_url, source }` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of object { code, message, documentation_url, source }` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `result: array of object { id, cache_options, compatibility_date, 21 more }` - `id: optional string` The name used to identify the script. - `cache_options: optional object { enabled, cross_version_cache }` 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: boolean` Whether caching is enabled for this Worker. - `cross_version_cache: optional boolean` 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. - `compatibility_date: optional string` Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker. - `compatibility_flags: optional array of string` Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a `compatibility_date`. - `created_on: optional string` When the script was created. - `etag: optional string` Hashed script content, can be used in a If-None-Match header when updating. - `exports: optional map[object { type, cache, renamed_to, 4 more } ]` 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. - `type: "worker" or "durable-object"` The kind of export. - `"worker"` - `"durable-object"` - `cache: optional object { enabled }` Cache override for this entrypoint. It applies only to `type: worker` entries and overrides the Worker's global `cache_options.enabled` for that entrypoint. - `enabled: boolean` Whether caching is enabled for this entrypoint. - `renamed_to: optional string` Destination class name for a `state: renamed` tombstone. The target must appear as a live (`created`) entry in the same `exports` map. Write-only: never present in GET responses. - `state: optional "created" or "deleted" or "renamed" or 2 more` Lifecycle state of the export entry. Defaults to `created` (a normal, live export) when omitted. `deleted`, `renamed`, and `transferred` are tombstones: write-only lifecycle operations that retire, rename, or hand off a provisioned Durable Object namespace. They are applied at upload and are filtered out of GET responses, so a read only ever returns `created` or `expecting-transfer`. `expecting-transfer` is a live export whose data is being received from another script via the two-phase transfer flow; it carries `storage` and `transfer_from`. - `"created"` - `"deleted"` - `"renamed"` - `"transferred"` - `"expecting-transfer"` - `storage: optional "sqlite" or "legacy-kv"` Storage backend for a `type: durable-object` export. Required for live Durable Object entries (`created` and `expecting-transfer`). `sqlite` selects SQLite-backed storage; `legacy-kv` selects the legacy key-value storage. - `"sqlite"` - `"legacy-kv"` - `transfer_from: optional string` Source script for a `state: expecting-transfer` entry. The namespace on this script is materialised from the source script's data via the pending-transfer flow. Present on reads for `expecting-transfer` entries. - `transferred_to: optional string` Destination script for a `state: transferred` tombstone. Must reference a script in the same account; cross-dispatch-namespace transfers are rejected. Write-only: never present in GET responses. - `handlers: optional array of string` The names of handlers exported as part of the default export. - `has_assets: optional boolean` Whether a Worker contains assets. - `has_modules: optional boolean` Whether a Worker contains modules. - `last_deployed_from: optional string` The client most recently used to deploy this Worker. - `logpush: optional boolean` Whether Logpush is turned on for the Worker. - `migration_tag: optional string` The tag of the Durable Object migration that was most recently applied for this Worker. - `modified_on: optional string` When the script was last modified. - `named_handlers: optional array of object { handlers, name }` Named exports, such as Durable Object class implementations and named entrypoints. - `handlers: optional array of string` The names of handlers exported as part of the named export. - `name: optional string` The name of the export. - `observability: optional object { enabled, head_sampling_rate, logs, traces }` Observability settings for the Worker. - `enabled: boolean` Whether observability is enabled for the Worker. - `head_sampling_rate: optional number` The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. - `logs: optional object { enabled, invocation_logs, destinations, 2 more }` Log settings for the Worker. - `enabled: boolean` Whether logs are enabled for the Worker. - `invocation_logs: boolean` Whether [invocation logs](https://edgetunnel-b2h.pages.dev/workers/observability/logs/workers-logs/#invocation-logs) are enabled for the Worker. - `destinations: optional array of string` A list of destinations where logs will be exported to. - `head_sampling_rate: optional number` The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. - `persist: optional boolean` Whether log persistence is enabled for the Worker. - `traces: optional object { destinations, enabled, head_sampling_rate, 2 more }` Trace settings for the Worker. - `destinations: optional array of string` A list of destinations where traces will be exported to. - `enabled: optional boolean` Whether traces are enabled for the Worker. - `head_sampling_rate: optional number` The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. - `persist: optional boolean` Whether trace persistence is enabled for the Worker. - `propagation_policy: optional "authenticated" or "accept"` 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. - `"authenticated"` - `"accept"` - `placement: optional object { mode, last_analyzed_at, status } or object { region, last_analyzed_at, status } or object { hostname, last_analyzed_at, status } or 5 more` Configuration for [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). Specify mode='smart' for Smart Placement, or one of region/hostname/host. - `object { mode, last_analyzed_at, status }` - `mode: "smart"` Enables [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `"smart"` - `last_analyzed_at: optional string` The last time the script was analyzed for [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `object { region, last_analyzed_at, status }` - `region: string` Cloud region for targeted placement in format 'provider:region'. - `last_analyzed_at: optional string` The last time the script was analyzed for [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `object { hostname, last_analyzed_at, status }` - `hostname: string` HTTP hostname for targeted placement. - `last_analyzed_at: optional string` The last time the script was analyzed for [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `object { host, last_analyzed_at, status }` - `host: string` TCP host and port for targeted placement. - `last_analyzed_at: optional string` The last time the script was analyzed for [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `object { mode, region, last_analyzed_at, status }` - `mode: "targeted"` Targeted placement mode. - `"targeted"` - `region: string` Cloud region for targeted placement in format 'provider:region'. - `last_analyzed_at: optional string` The last time the script was analyzed for [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `object { hostname, mode, last_analyzed_at, status }` - `hostname: string` HTTP hostname for targeted placement. - `mode: "targeted"` Targeted placement mode. - `"targeted"` - `last_analyzed_at: optional string` The last time the script was analyzed for [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `object { host, mode, last_analyzed_at, status }` - `host: string` TCP host and port for targeted placement. - `mode: "targeted"` Targeted placement mode. - `"targeted"` - `last_analyzed_at: optional string` The last time the script was analyzed for [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `object { mode, target, last_analyzed_at, status }` - `mode: "targeted"` Targeted placement mode. - `"targeted"` - `target: array of object { region } or object { hostname } or object { host }` Array of placement targets (currently limited to single target). - `Region object { region }` - `region: string` Cloud region in format 'provider:region'. - `Hostname object { hostname }` - `hostname: string` HTTP hostname for targeted placement. - `Host object { host }` - `host: string` TCP host:port for targeted placement. - `last_analyzed_at: optional string` The last time the script was analyzed for [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://edgetunnel-b2h.pages.dev/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `placement_mode: optional "smart" or "targeted"` - `"smart"` - `"targeted"` - `placement_status: optional "SUCCESS" or "UNSUPPORTED_APPLICATION" or "INSUFFICIENT_INVOCATIONS"` - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `routes: optional array of object { id, pattern, script }` Routes associated with the Worker. - `id: string` Identifier. - `pattern: string` Pattern to match incoming requests against. [Learn more](https://edgetunnel-b2h.pages.dev/workers/configuration/routing/routes/#matching-behavior). - `script: optional string` Name of the script to run if the route matches. - `tag: optional string` The immutable ID of the script. - `tags: optional array of string` Tags associated with the Worker. - `tail_consumers: optional array of ConsumerScript` List of Workers that will consume logs from the attached Worker. - `service: string` Name of Worker that is to be the consumer. - `environment: optional string` Optional environment if the Worker utilizes one. - `namespace: optional string` Optional dispatch namespace the script belongs to. - `usage_model: optional "standard" or "bundled" or "unbound"` Usage model for the Worker invocations. - `"standard"` - `"bundled"` - `"unbound"` - `success: true` Whether the API call was successful. - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/workers/scripts \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "my-workers-script", "cache_options": { "enabled": true, "cross_version_cache": true }, "compatibility_date": "2021-01-01", "compatibility_flags": [ "nodejs_compat" ], "created_on": "2017-01-01T00:00:00Z", "etag": "ea95132c15732412d22c1476fa83f27a", "exports": { "Admin": { "type": "worker", "cache": { "enabled": true }, "state": "created", "storage": "sqlite", "transfer_from": "transfer_from" }, "default": { "type": "worker", "cache": { "enabled": false }, "state": "created", "storage": "sqlite", "transfer_from": "transfer_from" } }, "handlers": [ "fetch", "scheduled" ], "has_assets": false, "has_modules": false, "last_deployed_from": "wrangler", "logpush": false, "migration_tag": "v1", "modified_on": "2017-01-01T00:00:00Z", "named_handlers": [ { "handlers": [ "class" ], "name": "MyDurableObject" } ], "observability": { "enabled": true, "head_sampling_rate": 0.1, "logs": { "enabled": true, "invocation_logs": true, "destinations": [ "cloudflare" ], "head_sampling_rate": 0.1, "persist": true }, "traces": { "destinations": [ "cloudflare" ], "enabled": true, "head_sampling_rate": 0.1, "persist": true, "propagation_policy": "authenticated" } }, "placement": { "mode": "smart", "last_analyzed_at": "2025-01-01T00:00:00Z", "status": "SUCCESS" }, "placement_mode": "smart", "placement_status": "SUCCESS", "routes": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "pattern": "example.com/*", "script": "my-workers-script" } ], "tag": "e8f70fdbc8b1fb0b8ddb1af166186758", "tags": [ "my-team", "my-public-api" ], "tail_consumers": [ { "service": "my-log-consumer", "environment": "production", "namespace": "my-namespace" } ], "usage_model": "standard" } ], "success": true } ```