Skip to main content

account_tags

Creates, updates, deletes, gets or lists an account_tags resource.

Overview

Nameaccount_tags
TypeResource
Idcloudflare.resource_tagging.account_tags

Fields

The following fields are returned by SELECT queries:

Get tags for single resource response.

NameDatatypeDescription
idstringIdentifies the unique resource. (example: 023e105f4ecef8ad9ca31a8372d0c353)
namestringHuman-readable name of the resource. (example: my-worker-script)
access_application_idstring (uuid)Access application ID is required only for access_application_policy resources (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415)
worker_idstringWorker ID is required only for worker_version resources (example: 3f72a691-44b3-4c11-8642-c18a88ddaa5e)
zone_idstringZone ID is required only for zone-level resources (example: 023e105f4ecef8ad9ca31a8372d0c353)
etagstringETag 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)
tagsobjectContains key-value pairs of tags.
typestring (access_application)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_idresource_id, resource_type, worker_idRetrieves tags for a specific account-level resource.
updatereplaceaccount_id, resource_id, resource_typeIf-MatchCreates or updates tags for a specific account-level resource.
deletedeleteaccount_idIf-MatchRemoves all tags from a specific account-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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
If-MatchstringETag 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.
resource_idstringThe ID of the resource to retrieve tags for.
resource_typestringThe type of the resource.
worker_idstringWorker identifier. Required for worker_version resources.

SELECT examples

Retrieves tags for a specific account-level resource.

SELECT
id,
name,
access_application_id,
worker_id,
zone_id,
etag,
tags,
type
FROM cloudflare.resource_tagging.account_tags
WHERE account_id = '{{ account_id }}' -- required
AND resource_id = '{{ resource_id }}'
AND resource_type = '{{ resource_type }}'
AND worker_id = '{{ worker_id }}'
;

REPLACE examples

Creates or updates tags for a specific account-level resource.

REPLACE cloudflare.resource_tagging.account_tags
SET
resource_id = '{{ resource_id }}',
resource_type = '{{ resource_type }}',
worker_id = '{{ worker_id }}',
tags = '{{ tags }}'
WHERE
account_id = '{{ account_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

Removes all tags from a specific account-level resource.

DELETE FROM cloudflare.resource_tagging.account_tags
WHERE account_id = '{{ account_id }}' --required
AND If-Match = '{{ If-Match }}'
;