Tags
import { APIRequest } from "~/components";
:::note
You can set a maximum of eight tags per script. Avoid special characters like , and & when naming your tag.
:::
Add tags via dashboard
- Go to Workers for Platforms in the Cloudflare dashboard and select your namespace.
- Select a user Worker from the list.
- Go to Settings > Tags.
- Add your tags (for example,
customer-123,pro-plan,production). - Select Save.
You can also search and filter Workers by tags in the namespace view.
Tags API reference
For complete API documentation, refer to Workers for Platforms API.
Get script tags
Set script tags
Add a single tag
Add one tag to a Worker script without affecting existing tags.
Delete a single tag
Remove one tag from a Worker script.
Filter Workers by tag
List all Workers that match a tag filter. Use tag:yes to include or tag:no to exclude.
<APIRequest method="GET" path="/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts" parameters={{ tags: "production:yes" }} />
Delete Workers by tag
Delete all Workers matching a tag filter. Use this to bulk delete Workers when a customer leaves your platform.
<APIRequest method="DELETE" path="/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts" parameters={{ tags: "customer-123:yes" }} />
谢谢你的反馈!