Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change Site Theme
Sanity logo

Documentation

    • Overview
    • Platform introduction
    • Next.js quickstart
    • Nuxt.js quickstart
    • Astro quickstart
    • React Router quickstart
    • Studio quickstart
    • Build with AI
    • Content Lake
    • Functions
    • APIs and SDKs
    • Visual Editing
    • Blueprints
    • Platform management
    • Dashboard
    • Studio
    • Canvas
    • Media Library
    • App SDK
    • Content Agent
    • HTTP API
    • CLI
    • Libraries
    • Specifications
    • Changelog
    • User guides
    • Developer guides
    • Courses and certifications
    • Join the community
    • Templates
Platform management
Overview

  • Plans and billing

    Platform terminology
    Plans and payments
    Projects, organizations, and billing
    Pricing
    Understanding the Growth plan trial
    Extending the Growth plan with paid add-ons
    Sanity's non-profit plan
    How AI Credits work

  • Auditing

    Activity Feed
    Request logs
    Request tags
    Request logs data reference

On this page

Previous

Request logs

Next

Request logs data reference

Was this page helpful?

On this page

  • SDK Support
  • Code example
Platform managementLast updated January 9, 2026

Request tags

Request tags in Sanity Log Delivery can be added to API and CDN requests for filtering and aggregating log data, supported by @sanity/client.

Request tags are values assigned to API and CDN requests that can be used to filter and aggregate log data within request logs from your Sanity Content Lake. The tagging can be achieved by adding the tag query parameter to the request URL, typically in the format:

GET /data/query/<dataset>?query=<GROQ-query>&tag=<custom-defined-tag>

SDK Support

@sanity/client has out-of-the-box support for tagging every API and CDN request on two levels:

  • Globally: Using the requestTagPrefix client configuration parameter
  • Per Request: Pass the tag option to the SDK’s Request method.

This provides a flexible method for tagging requests:

requestTagPrefixtagresult
---
-landing-pagetag=landing-page
website-tag=website
websitelanding-pagetag=website.landing-page

Code example

The following example will result in a query with tag=website.landing-page.

const client = createClient({
  projectId: "<project>",
  dataset: "<dataset>",
  token: "",
  useCdn: false, 
  apiVersion: "2024-01-24",
  requestTagPrefix: "website" // Added to every request
});

const posts = await client.fetch('*[_type == "post"]', {
  tag: `landing-page`, // Appended to requestTagPrefix for this individual request
});
const client = createClient({
  projectId: "<project>",
  dataset: "<dataset>",
  token: "",
  useCdn: false, 
  apiVersion: "2024-01-24",
  requestTagPrefix: "website" // Added to every request
});

const posts = await client.fetch('*[_type == "post"]', {
  tag: `landing-page`, // Appended to requestTagPrefix for this individual request
});