account_tags
Creates, updates, deletes, gets or lists an account_tags resource.
Overview
| Name | account_tags |
| Type | Resource |
| Id | cloudflare.resource_tagging.account_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 | account_id | resource_id, resource_type, worker_id | Retrieves tags for a specific account-level resource. |
update | replace | account_id, resource_id, resource_type | If-Match | Creates or updates tags for a specific account-level resource. |
delete | delete | account_id | If-Match | Removes 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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account 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. |
resource_id | string | The ID of the resource to retrieve tags for. |
resource_type | string | The type of the resource. |
worker_id | string | Worker identifier. Required for worker_version resources. |
SELECT examples
- list
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
- update
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
- delete
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 }}'
;