Skip to content
Start here

Get tags for an account-level resource

client.ResourceTagging.AccountTags.Get(ctx, params) (*AccountTagGetResponse, error)
GET/accounts/{account_id}/tags

Retrieves tags for a specific account-level resource.

Security

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
ParametersExpand Collapse
params AccountTagGetParams
AccountID param.Field[string]

Path param: Identifier.

maxLength32
minLength32
ResourceID param.Field[string]

Query param: The ID of the resource to retrieve tags for.

ResourceType param.Field[AccountTagGetParamsResourceType]

Query param: The type of the resource.

const AccountTagGetParamsResourceTypeAccessApplication AccountTagGetParamsResourceType = "access_application"
const AccountTagGetParamsResourceTypeAccessGroup AccountTagGetParamsResourceType = "access_group"
const AccountTagGetParamsResourceTypeAccount AccountTagGetParamsResourceType = "account"
const AccountTagGetParamsResourceTypeAIGateway AccountTagGetParamsResourceType = "ai_gateway"
const AccountTagGetParamsResourceTypeAlertingPolicy AccountTagGetParamsResourceType = "alerting_policy"
const AccountTagGetParamsResourceTypeAlertingWebhook AccountTagGetParamsResourceType = "alerting_webhook"
const AccountTagGetParamsResourceTypeCloudflaredTunnel AccountTagGetParamsResourceType = "cloudflared_tunnel"
const AccountTagGetParamsResourceTypeD1Database AccountTagGetParamsResourceType = "d1_database"
const AccountTagGetParamsResourceTypeDurableObjectNamespace AccountTagGetParamsResourceType = "durable_object_namespace"
const AccountTagGetParamsResourceTypeGatewayList AccountTagGetParamsResourceType = "gateway_list"
const AccountTagGetParamsResourceTypeGatewayRule AccountTagGetParamsResourceType = "gateway_rule"
const AccountTagGetParamsResourceTypeImage AccountTagGetParamsResourceType = "image"
const AccountTagGetParamsResourceTypeKVNamespace AccountTagGetParamsResourceType = "kv_namespace"
const AccountTagGetParamsResourceTypeQueue AccountTagGetParamsResourceType = "queue"
const AccountTagGetParamsResourceTypeR2Bucket AccountTagGetParamsResourceType = "r2_bucket"
const AccountTagGetParamsResourceTypeResourceShare AccountTagGetParamsResourceType = "resource_share"
const AccountTagGetParamsResourceTypeStreamLiveInput AccountTagGetParamsResourceType = "stream_live_input"
const AccountTagGetParamsResourceTypeStreamVideo AccountTagGetParamsResourceType = "stream_video"
const AccountTagGetParamsResourceTypeWorker AccountTagGetParamsResourceType = "worker"
const AccountTagGetParamsResourceTypeWorkerVersion AccountTagGetParamsResourceType = "worker_version"
WorkerID param.Field[string]Optional

Query param: Worker identifier. Required for worker_version resources.

ReturnsExpand Collapse
type AccountTagGetResponse interface{…}

Response for access_application resources

One of the following:
type AccountTagGetResponseResourceTaggingTaggedResourceObjectAccessApplication struct{…}

Response for access_application resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectAccessApplicationType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectAccessApplicationPolicy struct{…}

Response for access_application_policy resources

ID string

Identifies the unique resource.

AccessApplicationID string

Access application ID is required only for access_application_policy resources

formatuuid
Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectAccessApplicationPolicyType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32
type AccountTagGetResponseResourceTaggingTaggedResourceObjectAccessGroup struct{…}

Response for access_group resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectAccessGroupType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectAccount struct{…}

Response for account resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectAccountType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectAIGateway struct{…}

Response for ai_gateway resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectAIGatewayType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectAlertingPolicy struct{…}

Response for alerting_policy resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectAlertingPolicyType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectAlertingWebhook struct{…}

Response for alerting_webhook resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectAlertingWebhookType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectAPIGatewayOperation struct{…}

Response for api_gateway_operation resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectAPIGatewayOperationType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32
type AccountTagGetResponseResourceTaggingTaggedResourceObjectCloudflaredTunnel struct{…}

Response for cloudflared_tunnel resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectCloudflaredTunnelType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectCustomCertificate struct{…}

Response for custom_certificate resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectCustomCertificateType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32
type AccountTagGetResponseResourceTaggingTaggedResourceObjectCustomHostname struct{…}

Response for custom_hostname resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectCustomHostnameType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32
type AccountTagGetResponseResourceTaggingTaggedResourceObjectD1Database struct{…}

Response for d1_database resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectD1DatabaseType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectDNSRecord struct{…}

Response for dns_record resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectDNSRecordType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32
type AccountTagGetResponseResourceTaggingTaggedResourceObjectDurableObjectNamespace struct{…}

Response for durable_object_namespace resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectDurableObjectNamespaceType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectGatewayList struct{…}

Response for gateway_list resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectGatewayListType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectGatewayRule struct{…}

Response for gateway_rule resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectGatewayRuleType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectImage struct{…}

Response for image resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectImageType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectKVNamespace struct{…}

Response for kv_namespace resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectKVNamespaceType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectManagedClientCertificate struct{…}

Response for managed_client_certificate resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectManagedClientCertificateType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32
type AccountTagGetResponseResourceTaggingTaggedResourceObjectQueue struct{…}

Response for queue resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectQueueType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectR2Bucket struct{…}

Response for r2_bucket resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectR2BucketType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectResourceShare struct{…}

Response for resource_share resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectResourceShareType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectStreamLiveInput struct{…}

Response for stream_live_input resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectStreamLiveInputType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectStreamVideo struct{…}

Response for stream_video resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectStreamVideoType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectWorker struct{…}

Response for worker resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectWorkerType
type AccountTagGetResponseResourceTaggingTaggedResourceObjectWorkerVersion struct{…}

Response for worker_version resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectWorkerVersionType
WorkerID string

Worker ID is required only for worker_version resources

type AccountTagGetResponseResourceTaggingTaggedResourceObjectZone struct{…}

Response for zone resources

ID string

Identifies the unique resource.

Etag string

ETag identifier for optimistic concurrency control. Formatted as “v1:” 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.

Name string

Human-readable name of the resource.

Tags map[string, string]

Contains key-value pairs of tags.

Type AccountTagGetResponseResourceTaggingTaggedResourceObjectZoneType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32

Get tags for an account-level resource

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
    option.WithAPIEmail("user@example.com"),
  )
  accountTag, err := client.ResourceTagging.AccountTags.Get(context.TODO(), resource_tagging.AccountTagGetParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    ResourceID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    ResourceType: cloudflare.F(resource_tagging.AccountTagGetParamsResourceTypeWorker),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", accountTag)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "id": "023e105f4ecef8ad9ca31a8372d0c353",
    "etag": "v1:RBNvo1WzZ4oRRq0W9-hkng",
    "name": "my-worker-script",
    "tags": {
      "environment": "production",
      "team": "engineering"
    },
    "type": "access_application"
  }
}
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"
      }
    }
  ],
  "success": true,
  "result": {
    "id": "023e105f4ecef8ad9ca31a8372d0c353",
    "etag": "v1:RBNvo1WzZ4oRRq0W9-hkng",
    "name": "my-worker-script",
    "tags": {
      "environment": "production",
      "team": "engineering"
    },
    "type": "access_application"
  }
}