APIs.io Engineering Platform Worker Script API

The Worker Script API from APIs.io Engineering Platform — 7 operation(s) for worker script.

Operations 12

GET /accounts/{account_id}/workers/scripts APIs.io Engineering Platform List Workers #
DELETE /accounts/{account_id}/workers/scripts/{script_name} APIs.io Engineering Platform Delete Worker #
GET /accounts/{account_id}/workers/scripts/{script_name} APIs.io Engineering Platform Download Worker #
PUT /accounts/{account_id}/workers/scripts/{script_name} APIs.io Engineering Platform Upload Worker Module #
PUT /accounts/{account_id}/workers/scripts/{script_name}/content APIs.io Engineering Platform Put script content #
GET /accounts/{account_id}/workers/scripts/{script_name}/content/v2 APIs.io Engineering Platform Get script content #
GET /accounts/{account_id}/workers/scripts/{script_name}/script-settings APIs.io Engineering Platform Get Script Settings #
PATCH /accounts/{account_id}/workers/scripts/{script_name}/script-settings APIs.io Engineering Platform Patch Script Settings #
GET /accounts/{account_id}/workers/scripts/{script_name}/settings APIs.io Engineering Platform Get Settings #
PATCH /accounts/{account_id}/workers/scripts/{script_name}/settings APIs.io Engineering Platform Patch Settings #
GET /accounts/{account_id}/workers/scripts/{script_name}/usage-model APIs.io Engineering Platform Fetch Usage Model #
PUT /accounts/{account_id}/workers/scripts/{script_name}/usage-model APIs.io Engineering Platform Update Usage Model #

Documentation

Specifications

Other Resources

🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-1ab188a6-cc1f-490d-9413-9c6da20918d0?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-0e94f581-cbc1-48e0-b594-1f6b3d07a328?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-4517d93a-e7f7-4dc2-b572-06762bbe14de?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-88f9ddbb-3115-47dc-b6e5-7fc6f1d2a190?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-3a12caae-4945-4df4-8ab9-bb6219ba7a9f?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-863b18f0-c2f2-4e32-a5fa-0d1e6ccf77a9?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-189876d1-f207-49a2-a4bc-5c67ae78cd19?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-c1e74fd9-3f84-4d95-943d-d645d6cb82f7?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-b002164d-6e8a-4b6d-b409-4929476e7818?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-508660fd-30b8-4c9c-aede-8edbac8a514d?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-da35e0ba-f1a9-42fe-a77a-56ff0a47e341?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-1d4df7d0-9c92-4fa8-946f-2110c2b3b48d?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-2af6f54f-d259-46c0-8f86-78856f5885cd?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-cc203f31-e7f6-42ec-ad34-c5c4cde58904?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-f19285da-48dd-4691-bbdf-f7d6bec157a3?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-aa69cacc-4bbf-4724-a1d4-78cdad57fee8?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-a5858f86-04d3-4e15-ae11-b42c7516688b?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-c2052341-766c-43c7-b1dc-ed4985e4606b?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-aa777c90-8271-4809-8eac-3ec39a9a899c?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-4d5957dc-df05-4216-a5fc-d46b3ba811d8?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-28d97617-fdba-46a5-ac3e-40f3d2e0fa57?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-7429b451-d812-4abc-b497-b763372cf5c5?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-b0eafdd0-adaa-48a2-a855-6a31beb86d83?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-209f34ef-13c1-400c-bca8-fcddb304aff5?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-fb2bbbb8-d4cc-48b1-a660-c8e158bfbbea?action=share&creator=35240

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/engineering-platform-worker-script-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

engineering-platform-worker-script-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: 'To get started using Cloudflare''s products and services via the API, refer to [how to interact with Cloudflare](https://developers.cloudflare.com/fundamentals/basic-tasks/interact-with-cloudflare/), which covers using tools like [Terraform](https://developers.cloudflare.com/terraform/#cloudflare-terraform) and the [official SDKs](https://developers.cloudflare.com/fundamentals/api/reference/sdks/) to maintain your Cloudflare resources.


    Using the Cloudflare API requires authentication so that Cloudflare knows who is making requests and what permissions you have. Create an API token to grant access to the API to perform actions.


    To create an API token, from the Cloudflare dashboard, go to My Profile > API Tokens and select Create Token. For more information on how to create and troubleshoot API tokens, refer to

    our [API fundamentals](https://developers.cloudflare.com/fundamentals/api/).


    Totally new to Cloudflare? [Start here](https://developers.cloudflare.com/fundamentals/get-started/).'
  license:
    name: BSD-3-Clause
    url: https://opensource.org/licenses/BSD-3-Clause
  title: APIs.io Engineering Platform Cloudflare Worker Script API
  version: 4.0.0
tags:
- name: Worker Script
paths:
  /accounts/{account_id}/workers/scripts:
    get:
      description: Fetch a list of uploaded workers.
      operationId: worker-script-list-workers
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/workers_identifier'
      responses:
        4XX:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/workers_script-response-collection'
                - $ref: '#/components/schemas/workers_api-response-common-failure'
          description: List Workers response failure
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_script-response-collection'
          description: List Workers response
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform List Workers
      tags:
      - Worker Script
      x-api-token-group:
      - Workers Tail Read
      - Workers Scripts Write
      - Workers Scripts Read
      x-cfPermissionsRequired:
        enum:
        - com.cloudflare.edge.worker.script.list
  /accounts/{account_id}/workers/scripts/{script_name}:
    delete:
      description: Delete your worker. This call has no response body on a successful delete.
      operationId: worker-script-delete-worker
      parameters:
      - in: path
        name: script_name
        required: true
        schema:
          $ref: '#/components/schemas/workers_script_name'
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/workers_identifier'
      - description: If set to true, delete will not be stopped by associated service binding, durable object, or other binding. Any of these associated bindings/durable objects will be deleted along with the script.
        in: query
        name: force
        schema:
          type: boolean
      requestBody:
        content:
          application/json: {}
        required: true
      responses:
        4XX:
          content:
            application/json: {}
          description: Delete Worker response failure
        '200':
          content:
            application/json: {}
          description: Delete Worker response
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Delete Worker
      tags:
      - Worker Script
      x-api-token-group:
      - Workers Scripts Write
      x-cfPermissionsRequired:
        enum:
        - com.cloudflare.edge.worker.script.delete
    get:
      description: Fetch raw script content for your worker. Note this is the original script content, not JSON encoded.
      operationId: worker-script-download-worker
      parameters:
      - in: path
        name: script_name
        required: true
        schema:
          $ref: '#/components/schemas/workers_script_name'
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/workers_identifier'
      responses:
        4XX:
          content:
            undefined:
              schema:
                example: addEventListener('fetch', event => { event.respondWith(fetch(event.request)) })
          description: Download Worker response failure
        '200':
          content:
            undefined:
              schema:
                example: addEventListener('fetch', event => { event.respondWith(fetch(event.request)) })
          description: Download Worker response
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Download Worker
      tags:
      - Worker Script
      x-api-token-group:
      - Workers Tail Read
      - Workers Scripts Write
      - Workers Scripts Read
      x-cfPermissionsRequired:
        enum:
        - com.cloudflare.edge.worker.script.read
    put:
      description: 'Upload a worker module. You can find more about the multipart metadata on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.'
      operationId: worker-script-upload-worker-module
      parameters:
      - in: path
        name: script_name
        required: true
        schema:
          $ref: '#/components/schemas/workers_script_name'
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/workers_identifier'
      - description: Rollback to provided deployment based on deployment ID. Request body will only parse a "message" part. You can learn more about deployments [here](https://developers.cloudflare.com/workers/platform/deployments/).
        in: query
        name: rollback_to
        schema:
          $ref: '#/components/schemas/workers_uuid'
      requestBody:
        $ref: '#/components/requestBodies/workers_script_upload'
      responses:
        4XX:
          content:
            application/json:
              schema:
                allOf:
                - example:
                    errors: []
                    messages: []
                    result:
                      created_on: '2022-05-05T05:15:11.602148Z'
                      etag: 777f24a43bef5f69174aa69ceaf1dea67968d510a31d1vw3e49d34a0187c06d1
                      handlers:
                      - fetch
                      id: this-is_my_script-01
                      logpush: false
                      modified_on: '2022-05-20T19:02:56.446492Z'
                      tail_consumers:
                      - environment: production
                        service: my-log-consumer
                      usage_model: bundled
                    success: true
                - $ref: '#/components/schemas/workers_api-response-common-failure'
          description: Upload Worker Module response failure
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/workers_script-response-upload-single'
                - example:
                    errors: []
                    messages: []
                    result:
                      created_on: '2022-05-05T05:15:11.602148Z'
                      etag: 777f24a43bef5f69174aa69ceaf1dea67968d510a31d1vw3e49d34a0187c06d1
                      handlers:
                      - fetch
                      id: this-is_my_script-01
                      logpush: false
                      modified_on: '2022-05-20T19:02:56.446492Z'
                      placement_mode: smart
                      startup_time_ms: 10
                      tail_consumers:
                      - environment: production
                        service: my-log-consumer
                      usage_model: bundled
                    success: true
          description: Upload Worker Module response
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Upload Worker Module
      tags:
      - Worker Script
      x-api-token-group:
      - Workers Scripts Write
      x-cfPermissionsRequired:
        enum:
        - com.cloudflare.edge.worker.script.create
  /accounts/{account_id}/workers/scripts/{script_name}/content:
    put:
      description: Put script content without touching config or metadata
      operationId: worker-script-put-content
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/workers_identifier'
      - in: path
        name: script_name
        required: true
        schema:
          $ref: '#/components/schemas/workers_script_name'
      - description: The multipart name of a script upload part containing script content in service worker format. Alternative to including in a metadata part.
        in: header
        name: CF-WORKER-BODY-PART
        schema:
          type: string
      - description: The multipart name of a script upload part containing script content in es module format. Alternative to including in a metadata part.
        in: header
        name: CF-WORKER-MAIN-MODULE-PART
        schema:
          type: string
      requestBody:
        content:
          multipart/form-data:
            encoding:
              <any part name>:
                contentType: application/javascript+module, text/javascript+module, application/javascript, text/javascript, application/wasm, text/plain, application/octet-stream, application/source-map
            schema:
              properties:
                <any part name>:
                  description: A module comprising a Worker script, often a javascript file. Multiple modules may be provided as separate named parts, but at least one module must be present. This should be referenced either in the metadata as `main_module` (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also be included using the `application/source-map` content type.
                  items:
                    format: binary
                    type: string
                  type: array
                metadata:
                  description: JSON encoded metadata about the uploaded parts and Worker configuration.
                  properties:
                    body_part:
                      description: Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the `fetch` event). Indicates a `service worker syntax` Worker.
                      example: worker.js
                      type: string
                    main_module:
                      description: Name of the part in the multipart request that contains the main module (e.g. the file exporting a `fetch` handler). Indicates a `module syntax` Worker.
                      example: worker.js
                      type: string
                  type: object
              type: object
        required: true
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_api-response-common-failure'
          description: Put script content failure
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_script-response-single'
          description: Put script content
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Put script content
      tags:
      - Worker Script
      x-api-token-group:
      - Workers Scripts Write
      x-cfPermissionsRequired:
        enum:
        - com.cloudflare.edge.worker.script.create
  /accounts/{account_id}/workers/scripts/{script_name}/content/v2:
    get:
      description: Fetch script content only
      operationId: worker-script-get-content
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/workers_identifier'
      - in: path
        name: script_name
        required: true
        schema:
          $ref: '#/components/schemas/workers_script_name'
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_api-response-common'
          description: Fetch script content failure
        '200':
          content:
            string:
              schema:
                example: addEventListener('fetch', event => { event.respondWith(fetch(event.request)) })
          description: Fetch script content
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Get script content
      tags:
      - Worker Script
      x-cfPermissionsRequired:
        enum:
        - com.cloudflare.edge.worker.script.read
  /accounts/{account_id}/workers/scripts/{script_name}/script-settings:
    get:
      description: Get script-level settings when using [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions). Includes Logpush and Tail Consumers.
      operationId: worker-script-settings-get-settings
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/workers_identifier'
      - in: path
        name: script_name
        required: true
        schema:
          $ref: '#/components/schemas/workers_script_name'
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_api-response-common'
          description: Fetch script settings failure
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_script-settings-response'
          description: Fetch script settings
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Get Script Settings
      tags:
      - Worker Script
      x-api-token-group:
      - Workers Tail Read
      - Workers Scripts Write
      - Workers Scripts Read
      x-cfPermissionsRequired:
        enum:
        - com.cloudflare.edge.worker.script.read
    patch:
      description: Patch script-level settings when using [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions). Includes Logpush and Tail Consumers.
      operationId: worker-script-settings-patch-settings
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/workers_identifier'
      - in: path
        name: script_name
        required: true
        schema:
          $ref: '#/components/schemas/workers_script_name'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/workers_script-settings-item'
        required: true
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_api-response-common'
          description: Patch script settings failure
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_script-settings-response'
          description: Patch script settings
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Patch Script Settings
      tags:
      - Worker Script
      x-api-token-group:
      - Workers Scripts Write
      x-cfPermissionsRequired:
        enum:
        - com.cloudflare.edge.worker.script.create
  /accounts/{account_id}/workers/scripts/{script_name}/settings:
    get:
      description: Get metadata and config, such as bindings or usage model
      operationId: worker-script-get-settings
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/workers_identifier'
      - in: path
        name: script_name
        required: true
        schema:
          $ref: '#/components/schemas/workers_script_name'
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_api-response-common'
          description: Fetch settings failure
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_script-and-version-settings-response'
          description: Fetch settings
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Get Settings
      tags:
      - Worker Script
      x-api-token-group:
      - Workers Tail Read
      - Workers Scripts Write
      - Workers Scripts Read
      x-cfPermissionsRequired:
        enum:
        - com.cloudflare.edge.worker.script.read
    patch:
      description: Patch metadata or config, such as bindings or usage model
      operationId: worker-script-patch-settings
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/workers_identifier'
      - in: path
        name: script_name
        required: true
        schema:
          $ref: '#/components/schemas/workers_script_name'
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                settings:
                  $ref: '#/components/schemas/workers_script-and-version-settings-item'
              type: object
        required: true
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_api-response-common'
          description: Patch settings failure
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_script-and-version-settings-response'
          description: Patch settings
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Patch Settings
      tags:
      - Worker Script
      x-api-token-group:
      - Workers Scripts Write
      x-cfPermissionsRequired:
        enum:
        - com.cloudflare.edge.worker.script.create
  /accounts/{account_id}/workers/scripts/{script_name}/usage-model:
    get:
      description: Fetches the Usage Model for a given Worker.
      operationId: worker-script-fetch-usage-model
      parameters:
      - in: path
        name: script_name
        required: true
        schema:
          $ref: '#/components/schemas/workers_script_name'
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/workers_identifier'
      responses:
        4XX:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/workers_usage-model-response'
                - $ref: '#/components/schemas/workers_api-response-common-failure'
          description: Fetch Usage Model response failure
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_usage-model-response'
          description: Fetch Usage Model response
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Fetch Usage Model
      tags:
      - Worker Script
      x-api-token-group:
      - Workers Tail Read
      - Workers Scripts Write
      - Workers Scripts Read
      x-cfPermissionsRequired:
        enum:
        - com.cloudflare.edge.worker.script.read
    put:
      description: Updates the Usage Model for a given Worker. Requires a Workers Paid subscription.
      operationId: worker-script-update-usage-model
      parameters:
      - in: path
        name: script_name
        required: true
        schema:
          $ref: '#/components/schemas/workers_script_name'
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/workers_identifier'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/workers_usage-model-object'
        required: true
      responses:
        4XX:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/workers_usage-model-response'
                - $ref: '#/components/schemas/workers_api-response-common-failure'
          description: Update Usage Model response failure
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workers_usage-model-response'
          description: Update Usage Model response
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Update Usage Model
      tags:
      - Worker Script
      x-api-token-group:
      - Workers Scripts Write
      x-cfPermissionsRequired:
        enum:
        - com.cloudflare.edge.worker.script.create
components:
  schemas:
    workers_kv_namespace_binding:
      properties:
        name:
          $ref: '#/components/schemas/workers_binding_name'
        namespace_id:
          $ref: '#/components/schemas/workers_namespace_identifier'
        type:
          description: The class of resource that the binding provides.
          enum:
          - kv_namespace
          example: kv_namespace
          type: string
      required:
      - name
      - type
      - namespace_id
      type: object
    workers_script-settings-response:
      allOf:
      - $ref: '#/components/schemas/workers_api-response-common'
      - properties:
          result:
            $ref: '#/components/schemas/workers_script-settings-item'
    workers_script-and-version-settings-response:
      allOf:
      - $ref: '#/components/schemas/workers_api-response-common'
      - properties:
          result:
            $ref: '#/components/schemas/workers_script-and-version-settings-item'
    workers_queue_binding:
      properties:
        name:
          $ref: '#/components/schemas/workers_binding_name'
        queue_name:
          description: Name of the Queue to bind to
          example: my-queue
          type: string
        type:
          description: The class of resource that the binding provides.
          enum:
          - queue
          example: queue
          type: string
      required:
      - name
      - type
      - queue_name
      type: object
    workers_script-response-collection:
      allOf:
      - $ref: '#/components/schemas/workers_api-response-common'
      - properties:
          result:
            items:
              $ref: '#/components/schemas/workers_script-response'
            type: array
    workers_api-response-common:
      properties:
        errors:
          $ref: '#/components/schemas/workers_messages'
        messages:
          $ref: '#/components/schemas/workers_messages'
        success:
          description: Whether the API call was successful
          enum:
          - true
          example: true
          type: boolean
      required:
      - success
      - errors
      - messages
      type: object
    workers_bindings:
      description: List of bindings attached to this Worker
      items:
        $ref: '#/components/schemas/workers_binding'
      type: array
    workers_identifier:
      description: Identifier
      example: 023e105f4ecef8ad9ca31a8372d0c353
      maxLength: 32
      type: string
    workers_modified_on:
      description: When the script was last modified.
      example: '2017-01-01T00:00:00Z'
      format: date-time
      readOnly: true
      type: string
    workers_usage-model-response:
      allOf:
      - $ref: '#/components/schemas/workers_api-response-common'
      - properties:
          result:
            $ref: '#/components/schemas/workers_usage-model-object'
    workers_namespace_identifier:
      description: Namespace identifier tag.
      example: 0f2ac74b498b48028cb68387c421e279
      maxLength: 32
      readOnly: true
      type: string
    workers_messages:
      example: []
      items:
        properties:
          code:
            minimum: 1000
            type: integer
          message:
            type: string
        required:
        - code
        - message
        type: object
        uniqueItems: true
      type: array
    workers_tags:
      description: Tags to help you manage your Workers
      items:
        $ref: '#/components/schemas/workers_tag'
      type: array
    workers_script-and-version-settings-item:
      properties:
        bindings:
          $ref: '#/components/schemas/workers_bindings'
        compatibility_date:
          $ref: '#/components/schemas/workers_compatibility_date'
        compatibility_flags:
          $ref: '#/components/schemas/workers_compatibility_flags'
        limits:
          $ref: '#/components/schemas/workers_limits'
        logpush:
          $ref: '#/components/schemas/workers_logpush'
        migrations:
          description: 'Migrations to apply for Durable Objects associated with this Worker.

            '
          oneOf:
          - $ref: '#/components/schemas/workers_single_step_migrations'
          - $ref: '#/components/schemas/workers_stepped_migrations'
        placement:
          $ref: '#/components/schemas/workers_placement_config'
        tags:
          $ref: '#/components/schemas/workers_tags'
        tail_consumers:
          $ref: '#/components/schemas/workers_tail_consumers'
        usage_model:
          $ref: '#/components/schemas/workers_usage_model'
      type: object
    workers_usage_model:
      description: Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').
      example: unbound
      pattern: ^(bundled|unbound)$
      type: string
    workers_tail_consumers_script:
      description: A reference to a script that will consume logs from the attached Worker.
      properties:
        environment:
          description: Optional environment if the Worker utilizes one.
          example: production
          type: string
        namespace:
          description: Optional dispatch namespace the script belongs to.
          example: my-namespace
          type: string
        service:
          description: Name of Worker that is to be the consumer.
          example: my-log-consumer
          type: string
      required:
      - service
      type: object
    workers_api-response-common-failure:
      properties:
        errors:
          allOf:
          - $ref: '#/components/schemas/workers_messages'
          example:
          - code: 7003
            message: No route for the URI
          minLength: 1
        messages:
          allOf:
          - $ref: '#/components/schemas/workers_messages'
          example: []
        result:
          enum:
          - null
          type:
          - object
          - 'null'
        success:
          description: Whether the API call was successful
          enum:
          - false
          example: false
          type: boolean
      required:
      - success
      - errors
      - messages
      - result
      type: object
    workers_limits:
      description: Limits to apply for this Worker.
      properties:
        cpu_ms:
          description: The amount of CPU time this Worker can use in milliseconds.
          example: 50
          type: integer
      type: object
    workers_api-response-single:
      allOf:
      - $ref: '#/components/schemas/workers_api-response-common'
      type: object
    workers_compatibility_flags:
      description: Opt your Worker into specific changes
      items:
        $ref: '#/components/schemas/workers_compatibility_flag'
      type: array
    workers_script-settings-item:
      properties:
        logpush:
          $ref: '#/components/schemas/workers_logpush'
        tail_consumers:
          $ref: '#/components/schemas/workers_tail_consumers'
      type: object
    workers_d1_binding:
      properties:
        binding:
          $ref: '#/components/schemas/workers_binding_name'
        id:
          description: ID of the D1 database to bind to
          example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
          type: string
        name:
          description: The name of the D1 database associated with the 'id' provided.
          example: prod-database-auth
          type: string
        type:
          description: The class of resource that the binding provides.
          enum:
          - d1
          example: d1
          type: string
      required:
      - id
      - name
      - type
      - binding
      type: object
    workers_script-response-upload-single:
      allOf:
      - $ref: '#/components/schemas/workers_api-response-single'
      - properties:
          result:
            $ref: '#/components/schemas/workers_script-response-upload'
        x-cfLinkErrors:
          '10001': Unsupported or unexpected Content Type
          '10002': Unexpected internal server error
          '10003': Missing required URL parameter
          '10004': Malformed URL parameter
          '10006': Unparseable script body
          '10007': Resource not found (similar to HTTP 404)
          '10014': Internal error while attempting authorization checks
          '10015': The current account is not authorized to use workers
          '10018': Attempted to update a script where the e-tag does not match
          '10021': Script content failed validation checks, but was otherwise parseable
          '10023': Unauthorized access attempt
          '10027': Script body was too large
          '10075': Requires a Workers Paid plan
    workers_migration_tag_conditions:
      properties:
        new_tag:
          description: Tag to set as the latest migration tag.
          example: v2
          type: string
        old_tag:
          description: Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.
          example: v1
          type: string
      type: object
    workers_tag:
      description: Tag to help you manage your Worker
      example: my-tag
      type: string
    workers_compatibility_date:
      description: Opt your Worker into changes after this date
      example: '2022-04-05'
      type: string
    workers_script-response-single:
      allOf:
      - $ref: '#/components/schemas/workers_api-response-single'
      - properties:
          result:
            $ref: '#/components/schemas/workers_script-response'
        x-cfLinkErrors:
          '10001': Unsupported or unexpected Content Type
          '10002': Unexpected internal server error
          '10003': Missing required URL parameter
          '10004': Malformed URL parameter
          '10006': Unparseable script body
          '10007': Resource not found (similar to HTTP 404)
          '10014': Internal error while attempting authorization checks
          '10015': The current account is not authorized to use workers
          '10018': Attempted to update a script where the e-tag does not match
          '10021': Script content failed validation checks, but was otherwise parseable
          '10023': Unauthorized access attempt
          '10027': Script body was too large
          '10075': Requires a Workers Paid plan
    workers_usage-model-object:
      properties:
        usage_model:
          type: string
      type: object
    workers_logpush:
      description: Whether Logpush is turned on for the Worker.
      example: false
      type: boolean
    workers_do_binding:
      properties:
        class_name:
          description: The exported class name of the Durable Object
          example: M

# --- truncated at 32 KB (46 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/engineering-platform/refs/heads/main/openapi/engineering-platform-worker-script-api-openapi.yml