zone_tags
Creates, updates, deletes, gets or lists a zone_tags resource.
Overview
| Name | zone_tags |
| Type | Resource |
| Id | cloudflare.resource_tagging.zone_tags |
Fields
The following fields are returned by SELECT queries:
- list
Get tags for single resource response.
| Name | Datatype | Description |
|---|---|---|
id | string | Identifies the unique resource. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | Human-readable name of the resource. (example: my-worker-script) |
access_application_id | string (uuid) | Access application ID is required only for access_application_policy resources (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
worker_id | string | Worker ID is required only for worker_version resources (example: 3f72a691-44b3-4c11-8642-c18a88ddaa5e) |
zone_id | string | Zone ID is required only for zone-level resources (example: 023e105f4ecef8ad9ca31a8372d0c353) |
etag | string | ETag identifier for optimistic concurrency control. Formatted as "v1:<hash>" where the hash is the base64url-encoded SHA-256 (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON Canonicalization Scheme). Clients should treat ETags as opaque strings and pass them back via the If-Match header on write operations. (example: v1:RBNvo1WzZ4oRRq0W9-hkng) |
tags | object | Contains key-value pairs of tags. |
type | string | (access_application) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | zone_id | resource_id, resource_type, access_application_id | Retrieves tags for a specific zone-level resource. |
update | replace | zone_id, resource_id, resource_type | If-Match | Creates or updates tags for a specific zone-level resource. Replaces all existing tags for the resource. |
delete | delete | zone_id | If-Match | Removes all tags from a specific zone-level resource. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
zone_id | string | The Cloudflare zone ID. |
If-Match | string | ETag value for optimistic concurrency control. When provided, the server will verify the current resource ETag matches before applying the write. Returns 412 Precondition Failed if the resource has been modified since the ETag was obtained. Omit this header for unconditional writes. |
access_application_id | string (uuid) | Access application ID identifier. Required for access_application_policy resources. |
resource_id | string | The ID of the resource to retrieve tags for. |
resource_type | string | The type of the resource. |
SELECT examples
- list
Retrieves tags for a specific zone-level resource.
SELECT
id,
name,
access_application_id,
worker_id,
zone_id,
etag,
tags,
type
FROM cloudflare.resource_tagging.zone_tags
WHERE zone_id = '{{ zone_id }}' -- required
AND resource_id = '{{ resource_id }}'
AND resource_type = '{{ resource_type }}'
AND access_application_id = '{{ access_application_id }}'
;
REPLACE examples
- update
Creates or updates tags for a specific zone-level resource. Replaces all existing tags for the resource.
REPLACE cloudflare.resource_tagging.zone_tags
SET
resource_id = '{{ resource_id }}',
resource_type = '{{ resource_type }}',
tags = '{{ tags }}',
access_application_id = '{{ access_application_id }}'
WHERE
zone_id = '{{ zone_id }}' --required
AND resource_id = '{{ resource_id }}' --required
AND resource_type = '{{ resource_type }}' --required
AND If-Match = '{{ If-Match}}'
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Removes all tags from a specific zone-level resource.
DELETE FROM cloudflare.resource_tagging.zone_tags
WHERE zone_id = '{{ zone_id }}' --required
AND If-Match = '{{ If-Match }}'
;