Filter resources by tag

Last updated Apr 29, 2026 The GET /accounts/{account_id}/tags/resources endpoint supports tag filtering via the tag query parameter. Multiple tag parameters combine with AND logic. For the full endpoint specification, refer to the Resource Tagging API reference ↗︎.

Caution

Use = as the separator in tag filters (for example, tag=key=value), not :. The API error message references : but the implementation uses =.

Filter types

Key-only filter

Match resources that have a specific tag key, regardless of value.

# All resources with an "environment" tag (any value)
curl -X GET "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/tags/resources?tag=environment" \
  -H "Authorization: Bearer $API_TOKEN"

Key-value filter

Match resources where a tag key has a specific value.

# All resources with environment=production
curl -X GET "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/tags/resources?tag=environment=production" \
  -H "Authorization: Bearer $API_TOKEN"

Multiple values (OR)

Match resources where a tag key has any of the specified values. Separate values with commas.

# environment=production OR environment=staging
curl -X GET "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/tags/resources?tag=environment=production,staging" \
  -H "Authorization: Bearer $API_TOKEN"

Maximum of 10 OR values per filter (error code 1013 if exceeded).

Negate key

Match resources that do not have a specific tag key.

# All resources without an "archived" tag
curl -X GET "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/tags/resources?tag=!archived" \
  -H "Authorization: Bearer $API_TOKEN"

Negate key-value

Match resources where a tag key does not have a specific value.

# All resources where region is NOT us-west-1
curl -X GET "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/tags/resources?tag=region!=us-west-1" \
  -H "Authorization: Bearer $API_TOKEN"

Combining filters

Multiple tag parameters combine with AND logic. All conditions must match.

# Production resources in US regions, excluding archived
curl -X GET "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/tags/resources?tag=environment=production&tag=region=us-west-1,us-east-1&tag=!archived" \
  -H "Authorization: Bearer $API_TOKEN"

Maximum of 20 tag filters per query (error code 1010 if exceeded).

Discover available tags

List all tag keys

curl -X GET "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/tags/keys" \
  -H "Authorization: Bearer $API_TOKEN"

List values for a key

curl -X GET "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/tags/values/environment" \
  -H "Authorization: Bearer $API_TOKEN"

Optionally filter by resource type:

curl -X GET "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/tags/values/environment?type=worker" \
  -H "Authorization: Bearer $API_TOKEN"

Pagination

All list endpoints use cursor-based pagination with a fixed page size of 100 results.

When the response includes a non-null result_info.cursor, pass it as a query parameter to get the next page:

curl -X GET "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/tags/resources?tag=environment=production&cursor=$CURSOR" \
  -H "Authorization: Bearer $API_TOKEN"

When cursor is null, you have reached the last page. Pagination works seamlessly with tag filters.

Was this helpful?

YesNo

On this page

Filter resources by tag - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/resource-tagging/how-to/filter-resources/#page","headline":"Filter resources by tag","description":"Query tagged resources using the tag filtering syntax.","url":"https://developers.cloudflare.com/resource-tagging/how-to/filter-resources/","inLanguage":"en","image":"https://developers.cloudflare.com/resource-tagging/how-to/filter-resources/og.png?v=c89eb0aa466701a3","dateModified":"2026-04-29","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Create, update, and delete tags on Cloudflare resources. title: Manage tags image: https://developers.cloudflare.com/resource-tagging/how-to/manage-tags/og.png?v=c580bd9b3dc21fb9


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/resource-tagging/llms.txt
Use this file to discover all available pages before exploring further.