Workers

Workers

Domain types

MigrationStep{…}
SingleStepMigration{…}

A single set of migrations to apply.

WorkerMetadata{…}

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

Workers

Account Settings

Workers.AccountSettings

Methods

get(, ):
get/accounts/{account_id}/workers/account-settings

Fetches Worker account settings for an account.

update(, ):
put/accounts/{account_id}/workers/account-settings

Creates Worker account settings for an account.

Workers

Assets

Workers.Assets

Workers.Assets.Upload

Methods

create(, ):
post/accounts/{account_id}/workers/assets/upload

Upload assets ahead of creating a Worker version. To learn more about the direct uploads of assets, see https://developers.cloudflare.com/workers/static-assets/direct-upload/.

Workers.Beta

Workers.Beta.Workers

Methods

list(, ): <>
get/accounts/{account_id}/workers/workers

List all Workers for an account.

get(, , ):
get/accounts/{account_id}/workers/workers/{worker_id}

Get details about a specific Worker.

create(, ):
post/accounts/{account_id}/workers/workers

Create a new Worker.

update(, , ):
put/accounts/{account_id}/workers/workers/{worker_id}

Perform a complete replacement of a Worker, where omitted properties are set to their default values. This is the exact same as the Create Worker endpoint, but operates on an existing Worker. To perform a partial update instead, use the Edit Worker endpoint.

edit(, , ):
patch/accounts/{account_id}/workers/workers/{worker_id}

Perform a partial update on a Worker, where omitted properties are left unchanged from their current values.

delete(, , ):
delete/accounts/{account_id}/workers/workers/{worker_id}

Delete a Worker and all its associated resources (versions, deployments, etc.).

Domain types

Worker{…}

Workers.Beta.Workers.Versions

Methods

list(, , ): <>
get/accounts/{account_id}/workers/workers/{worker_id}/versions

List all versions for a Worker.

get(, , , ):
get/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}

Get details about a specific version.

create(, , ):
post/accounts/{account_id}/workers/workers/{worker_id}/versions

Create a new version.

delete(, , , ):
delete/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}

Delete a version.

Domain types

Version{…}
Workers

Domains

Workers.Domains

Methods

list(, ): <>
get/accounts/{account_id}/workers/domains

Lists all Worker Domains for an account.

get(, , ):
get/accounts/{account_id}/workers/domains/{domain_id}

Gets a Worker domain.

update(, ):
put/accounts/{account_id}/workers/domains

Attaches a Worker to a zone and hostname.

delete(, , ): void
delete/accounts/{account_id}/workers/domains/{domain_id}

Detaches a Worker from a zone and hostname.

Domain types

Domain{…}
Workers

Observability

Workers.Observability

Workers.Observability.Telemetry

Methods

keys(, ): <>
post/accounts/{account_id}/workers/observability/telemetry/keys

List all the keys in your telemetry events.

query(, ):
post/accounts/{account_id}/workers/observability/telemetry/query

Runs a temporary or saved query

values(, ): <>
post/accounts/{account_id}/workers/observability/telemetry/values

List unique values found in your events

Workers

Routes

Workers.Routes

Methods

list(, ): <>
get/zones/{zone_id}/workers/routes

Returns routes for a zone.

get(, , ):
get/zones/{zone_id}/workers/routes/{route_id}

Returns information about a route, including URL pattern and Worker.

create(, ):
post/zones/{zone_id}/workers/routes

Creates a route that maps a URL pattern to a Worker.

update(, , ):
put/zones/{zone_id}/workers/routes/{route_id}

Updates the URL pattern or Worker associated with a route.

delete(, , ):
delete/zones/{zone_id}/workers/routes/{route_id}

Deletes a route.

Workers

Scripts

Workers.Scripts

Methods

list(, ): <>
get/accounts/{account_id}/workers/scripts

Fetch a list of uploaded workers.

search(, ):
get/accounts/{account_id}/workers/scripts-search

Search for Workers in an account.

get(, , ):
get/accounts/{account_id}/workers/scripts/{script_name}

Fetch raw script content for your worker. Note this is the original script content, not JSON encoded.

update(, , ):
put/accounts/{account_id}/workers/scripts/{script_name}

Upload a worker module. You can find more about the multipart metadata on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.

delete(, , ): | null
delete/accounts/{account_id}/workers/scripts/{script_name}

Delete your worker. This call has no response body on a successful delete.

Domain types

Script{…}
ScriptSetting{…}

Workers.Scripts.Assets

Workers.Scripts.Assets.Upload

Methods

create(, , ):
post/accounts/{account_id}/workers/scripts/{script_name}/assets-upload-session

Start uploading a collection of assets for use in a Worker version. To learn more about the direct uploads of assets, see https://developers.cloudflare.com/workers/static-assets/direct-upload/.

Workers.Scripts.Content

Methods

get(, , ):
get/accounts/{account_id}/workers/scripts/{script_name}/content/v2

Fetch script content only.

update(, , ):
put/accounts/{account_id}/workers/scripts/{script_name}/content

Put script content without touching config or metadata.

WorkersScripts

Deployments

Workers.Scripts.Deployments

Methods

list(, , ):
get/accounts/{account_id}/workers/scripts/{script_name}/deployments

List of Worker Deployments. The first deployment in the list is the latest deployment actively serving traffic.

create(, , ):
post/accounts/{account_id}/workers/scripts/{script_name}/deployments

Deployments configure how Worker Versions are deployed to traffic. A deployment can consist of one or two versions of a Worker.

get(, , , ):
get/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}

Get information about a Worker Deployment.

delete(, , , ):
delete/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}

Delete a Worker Deployment. The latest deployment, which is actively serving traffic, cannot be deleted. All other deployments can be deleted.

Domain types

Deployment{…}

Workers.Scripts.Schedules

Methods

get(, , ):
get/accounts/{account_id}/workers/scripts/{script_name}/schedules

Fetches Cron Triggers for a Worker.

update(, , ):
put/accounts/{account_id}/workers/scripts/{script_name}/schedules

Updates Cron Triggers for a Worker.

WorkersScripts

Script And Version Settings

Workers.Scripts.ScriptAndVersionSettings

Methods

get(, , ):
get/accounts/{account_id}/workers/scripts/{script_name}/settings

Get metadata and config, such as bindings or usage model.

edit(, , ):
patch/accounts/{account_id}/workers/scripts/{script_name}/settings

Patch metadata or config, such as bindings or usage model.

Workers.Scripts.Secrets

Methods

list(, , ): <>
get/accounts/{account_id}/workers/scripts/{script_name}/secrets

List secrets bound to a script.

get(, , , ):
get/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}

Get a given secret binding (value omitted) on a script.

update(, , ):
put/accounts/{account_id}/workers/scripts/{script_name}/secrets

Add a secret to a script.

delete(, , , ): | null
delete/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}

Remove a secret from a script.

Workers.Scripts.Settings

Methods

get(, , ):
get/accounts/{account_id}/workers/scripts/{script_name}/script-settings

Get script-level settings when using Worker Versions. Includes Logpush and Tail Consumers.

edit(, , ):
patch/accounts/{account_id}/workers/scripts/{script_name}/script-settings

Patch script-level settings when using Worker Versions. Including but not limited to Logpush and Tail Consumers.

Workers.Scripts.Subdomain

Methods

get(, , ):
get/accounts/{account_id}/workers/scripts/{script_name}/subdomain

Get if the Worker is available on the workers.dev subdomain.

create(, , ):
post/accounts/{account_id}/workers/scripts/{script_name}/subdomain

Enable or disable the Worker on the workers.dev subdomain.

delete(, , ):
delete/accounts/{account_id}/workers/scripts/{script_name}/subdomain

Disable all workers.dev subdomains for a Worker.

Workers.Scripts.Tail

Methods

get(, , ):
get/accounts/{account_id}/workers/scripts/{script_name}/tails

Get list of tails currently deployed on a Worker.

create(, , ):
post/accounts/{account_id}/workers/scripts/{script_name}/tails

Starts a tail that receives logs and exception from a Worker.

delete(, , , ):
delete/accounts/{account_id}/workers/scripts/{script_name}/tails/{id}

Deletes a tail from a Worker.

Domain types

ConsumerScript{…}

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

Workers.Scripts.Versions

Methods

list(, , ): <>
get/accounts/{account_id}/workers/scripts/{script_name}/versions

List of Worker Versions. The first version in the list is the latest version.

get(, , , ):
get/accounts/{account_id}/workers/scripts/{script_name}/versions/{version_id}

Get Version Detail

create(, , ):
post/accounts/{account_id}/workers/scripts/{script_name}/versions

Upload a Worker Version without deploying to Cloudflare's network. You can find more about the multipart metadata on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.

Workers

Subdomains

Workers.Subdomains

Methods

get(, ):
get/accounts/{account_id}/workers/subdomain

Returns a Workers subdomain for an account.

update(, ):
put/accounts/{account_id}/workers/subdomain

Creates a Workers subdomain for an account.

delete(, ): void
delete/accounts/{account_id}/workers/subdomain

Deletes a Workers subdomain for an account.