Is AI recommending you? Ask Contentstack Canoe for free
Is AI recommending your brand? Find out with Contentstack Canoe for free
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs

Platform

  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing

Solutions

  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases

Resources

  • Academy
  • Docs
  • Contentstack for Developers
  • Agents Start Here
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • The Forrester Wave™: Digital Experience Platforms, Q4 2025
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP

Customers

  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support

Partners

  • Overview
  • Find a partner
  • Login

Company

  • About us
  • News
  • Customer support portal
  • Contact

Social

  • Facebook
  • LinkedIn
  • Instagram
  • GitHub
  • YouTube
  • Discord
  • X
LegalTermsPrivacyTrust Center

Cookie settings

Copyright © 2026 Contentstack Inc. All rights reserved.
/
  1. Home
  2. APIs
  3. Lytics API
  4. Metrics

Metrics

markdownView as Markdown

Query time series metrics for segments, streams, experiences, and other Lytics resources.

Query metrics (GET)

GEThttps://api.lytics.io/v2/metric

Query one or more metrics via query parameters. The Metric API provides access to time series data for segments, streams, experiences, and other Lytics resources.

Sample Response
Status|200 OK
1234567891011121314151617181920212223242526272829303132333435
{
  "_meta": {},
  "data": [
    {
      "aggregation": "string",
      "create_time": "2019-08-24T14:15:22Z",
      "dimension": "string",
      "dimension_id": "string",
      "dimension_type": "string",
      "end_date": "string",
      "errors": [
        "string"
      ],
      "include_empty_rows": true,
      "include_sum_of_buckets": true,
      "interval": "string",
      "is_cached": true,
      "name": "string",
      "range": "string",
      "refresh_cache": true,
      "round_dates": true,
      "smooth": true,
      "start_date": "string",
      "sum": 0,
      "values": [
        {
          "ts": "1285891200000",
          "value": 0
        }
      ]
    }
  ],
  "request_id": "string",
  "status": 0
}

Query metrics (POST)

POSThttps://api.lytics.io/v2/metric

Query one or more metrics by posting a JSON array of metric requests. The Metric API provides access to time series data for segments, streams, experiences, and other Lytics resources.

Sample Response
Status|200 OK
1234567891011121314151617181920212223242526272829303132333435
{
  "_meta": {},
  "data": [
    {
      "aggregation": "string",
      "create_time": "2019-08-24T14:15:22Z",
      "dimension": "string",
      "dimension_id": "string",
      "dimension_type": "string",
      "end_date": "string",
      "errors": [
        "string"
      ],
      "include_empty_rows": true,
      "include_sum_of_buckets": true,
      "interval": "string",
      "is_cached": true,
      "name": "string",
      "range": "string",
      "refresh_cache": true,
      "round_dates": true,
      "smooth": true,
      "start_date": "string",
      "sum": 0,
      "values": [
        {
          "ts": "1285891200000",
          "value": 0
        }
      ]
    }
  ],
  "request_id": "string",
  "status": 0
}
Hide Parameters

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

nameoptionalstring

Friendly name to identify this metric request

dimensionrequiredstring

The dimension to query

dimension_idrequiredstring

The ID of the specific resource within the dimension (e.g. segment ID)

dimension_typerequiredstring

The metric type to retrieve (e.g. size, converted, conversionrate)

aggregationrequiredstring

Comma-separated aggregation methods to apply

start_dateoptionalstring

Start of the query range. Supports friendly times (e.g. now-7d). Required if end_date is set; cannot be used with range.

end_dateoptionalstring

End of the query range. Supports friendly times (e.g. now). Required if start_date is set.

rangeoptionalstring

Time range from now (e.g. 7d for last 7 days). Cannot be used with start_date or end_date.

intervaloptionalstring

Bucket size for time series grouping (e.g. 1d, 2h). Defaults to 2h.

smoothoptionalstring

Apply smoothing to the resulting metrics

round_datesoptionalstring

Round start and end dates down to the nearest day

include_empty_rowsoptionalstring

Include zero-value buckets in the response

include_sum_of_bucketsoptionalstring

Include a sum of all bucket values in the response

refresh_cacheoptionalstring

Bypass the cache and read fresh from the time-series store

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Body Parameters

[].aggregationoptionalstring
[].dimensionoptionalstring
[].dimension_idoptionalstring
[].dimension_typeoptionalstring
[].end_dateoptionalstring
[].include_empty_rowsoptionalboolean
[].include_sum_of_bucketsoptionalboolean
[].intervaloptionalstring
[].nameoptionalstring
[].rangeoptionalstring
[].refresh_cacheoptionalboolean
[].round_datesoptionalboolean
[].smoothoptionalboolean
[].start_dateoptionalstring