Skip to content
Start here

List tag values

GET/accounts/{account_id}/tags/values/{tag_key}

Lists all distinct values for a given tag key, optionally filtered by resource type.

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
Path ParametersExpand Collapse
account_id: string

Identifier.

maxLength32
minLength32
tag_key: string
Query ParametersExpand Collapse
cursor: optional string

Cursor for pagination.

type: optional "access_application" or "access_application_policy" or "access_group" or 24 more

Filter by resource type.

One of the following:
"access_application"
"access_application_policy"
"access_group"
"account"
"ai_gateway"
"alerting_policy"
"alerting_webhook"
"api_gateway_operation"
"cloudflared_tunnel"
"custom_certificate"
"custom_hostname"
"d1_database"
"dns_record"
"durable_object_namespace"
"gateway_list"
"gateway_rule"
"image"
"kv_namespace"
"managed_client_certificate"
"queue"
"r2_bucket"
"resource_share"
"stream_live_input"
"stream_video"
"worker"
"worker_version"
"zone"
ReturnsExpand Collapse
errors: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
messages: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
success: true

Whether the API call was successful.

result: optional array of string
result_info: optional object { count, cursor }
count: optional number

Indicates the number of results returned in the current page.

cursor: optional string

Provides a cursor for the next page of results. Include this value in the next request to continue pagination.

List tag values

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/tags/values/$TAG_KEY \
    -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \
    -H "X-Auth-Key: $CLOUDFLARE_API_KEY"
{
  "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": [
    "production",
    "staging"
  ],
  "result_info": {
    "count": 20,
    "cursor": "eyJhY2NvdW50X2lkIjoxMjM0NTY3ODkwfQ"
  }
}
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": [
    "production",
    "staging"
  ],
  "result_info": {
    "count": 20,
    "cursor": "eyJhY2NvdW50X2lkIjoxMjM0NTY3ODkwfQ"
  }
}