POST /accounts/{account_id}/workers/workers/{worker_id}/versions

Create a new version.

Servers

Path parameters

Name Type Required Description
worker_id String Yes
account_id String Yes

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Query parameters

Name Type Required Description
deploy Boolean No

Request body fields

Name Type Required Description
source String No

The client used to create the version.

compatibility_flags[] Array No

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.

placement Object No

Placement settings for the version.

placement.mode String No

Placement mode for the version.

Valid values:

  • "smart"
main_module String No

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

number Integer Yes

The integer version number, starting from one.

assets Object No

Configuration for assets within a Worker.

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

assets.config Object No

Configuration for assets within a Worker.

assets.config.not_found_handling String No

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

Valid values:

  • "single-page-application"
  • "404-page"
  • "none"

Default value: "none"

assets.config.html_handling String No

Determines the redirects and rewrites of requests for HTML content.

Valid values:

  • "auto-trailing-slash"
  • "force-trailing-slash"
  • "drop-trailing-slash"
  • "none"

Default value: "auto-trailing-slash"

assets.config.run_worker_first No

Default value: false

assets.jwt String No

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

created_on String Yes

When the version was created.

bindings[] Array No

List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings.

migrations No

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

limits Object No

Resource limits enforced at runtime.

limits.cpu_ms Integer Yes

CPU time limit in milliseconds.

id String Yes

Version identifier.

usage_model String No

Usage model for the version.

Valid values:

  • "standard"
  • "unbound"
  • "bundled"

Default value: "standard"

annotations Object No

Metadata about the version.

annotations.workers/message String No

Human-readable message about the version.

annotations.workers/tag String No

User-provided identifier for the version.

annotations.workers/triggered_by String No

Operation that triggered the creation of the version.

modules[] Array No

Code, sourcemaps, and other content used at runtime.

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

modules[].content_type String Yes

The content type of the module.

modules[].name String Yes

The name of the module.

modules[].content_base64 String Yes

The base64-encoded module content.

compatibility_date String No

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

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.