Skip to content
Start here

Put Script Tags

client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Tags.Update(ctx, dispatchNamespace, scriptName, params) (*SinglePage[string], error)
PUT/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/tags

Put script tags for a script uploaded to a Workers for Platforms namespace.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Workers Scripts Write
ParametersExpand Collapse
dispatchNamespace string

Name of the Workers for Platforms dispatch namespace.

scriptName string

Name of the script, used in URLs and route configuration.

params DispatchNamespaceScriptTagUpdateParams
AccountID param.Field[string]

Path param: Identifier.

maxLength32
Body param.Field[[]string]

Body param: Tags associated with the Worker.

ReturnsExpand Collapse
type DispatchNamespaceScriptTagUpdateResponseEnvelopeResult string

Put Script Tags

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/workers_for_platforms"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Tags.Update(
    context.TODO(),
    "my-dispatch-namespace",
    "this-is_my_script-01",
    workers_for_platforms.DispatchNamespaceScriptTagUpdateParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
      Body: []string{"my-team", "my-public-api"},
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "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": [
    "my-tag"
  ],
  "success": true
}
Returns Examples
{
  "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": [
    "my-tag"
  ],
  "success": true
}