Skip to content
Start here

Get tags for a zone-level resource

client.ResourceTagging.ZoneTags.Get(ctx, params) (*ZoneTagGetResponse, error)
GET/zones/{zone_id}/tags

Retrieves tags for a specific zone-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 ZoneTagGetParams
ZoneID param.Field[string]

Path param: Zone ID is required only for zone-level resources

maxLength32
minLength32
ResourceID param.Field[string]

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

ResourceType param.Field[ZoneTagGetParamsResourceType]

Query param: The type of the resource.

const ZoneTagGetParamsResourceTypeAccessApplicationPolicy ZoneTagGetParamsResourceType = "access_application_policy"
const ZoneTagGetParamsResourceTypeAPIGatewayOperation ZoneTagGetParamsResourceType = "api_gateway_operation"
const ZoneTagGetParamsResourceTypeCustomCertificate ZoneTagGetParamsResourceType = "custom_certificate"
const ZoneTagGetParamsResourceTypeCustomHostname ZoneTagGetParamsResourceType = "custom_hostname"
const ZoneTagGetParamsResourceTypeDNSRecord ZoneTagGetParamsResourceType = "dns_record"
const ZoneTagGetParamsResourceTypeManagedClientCertificate ZoneTagGetParamsResourceType = "managed_client_certificate"
const ZoneTagGetParamsResourceTypeZone ZoneTagGetParamsResourceType = "zone"
AccessApplicationID param.Field[string]Optional

Query param: Access application ID identifier. Required for access_application_policy resources.

formatuuid
ReturnsExpand Collapse
type ZoneTagGetResponse interface{…}

Response for access_application resources

One of the following:
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectAccessApplication 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectAccessApplicationType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectAccessApplicationPolicy 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectAccessApplicationPolicyType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectAccessGroup 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectAccessGroupType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectAccount 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectAccountType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectAIGateway 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectAIGatewayType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectAlertingPolicy 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectAlertingPolicyType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectAlertingWebhook 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectAlertingWebhookType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectAPIGatewayOperation 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectAPIGatewayOperationType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectCloudflaredTunnel 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectCloudflaredTunnelType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectCustomCertificate 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectCustomCertificateType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectCustomHostname 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectCustomHostnameType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectD1Database 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectD1DatabaseType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectDNSRecord 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectDNSRecordType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectDurableObjectNamespace 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectDurableObjectNamespaceType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectGatewayList 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectGatewayListType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectGatewayRule 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectGatewayRuleType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectImage 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectImageType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectKVNamespace 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectKVNamespaceType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectManagedClientCertificate 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectManagedClientCertificateType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectQueue 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectQueueType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectR2Bucket 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectR2BucketType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectResourceShare 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectResourceShareType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectStreamLiveInput 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectStreamLiveInputType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectStreamVideo 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectStreamVideoType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectWorker 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectWorkerType
type ZoneTagGetResponseResourceTaggingTaggedResourceObjectWorkerVersion 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectWorkerVersionType
WorkerID string

Worker ID is required only for worker_version resources

type ZoneTagGetResponseResourceTaggingTaggedResourceObjectZone 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 ZoneTagGetResponseResourceTaggingTaggedResourceObjectZoneType
ZoneID string

Zone ID is required only for zone-level resources

maxLength32
minLength32

Get tags for a zone-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"),
  )
  zoneTag, err := client.ResourceTagging.ZoneTags.Get(context.TODO(), resource_tagging.ZoneTagGetParams{
    ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    ResourceID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    ResourceType: cloudflare.F(resource_tagging.ZoneTagGetParamsResourceTypeZone),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", zoneTag)
}
{
  "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"
  }
}