---
title: "Compute journey timeseries analytics"
method: POST
path: "/api/v2/product-analytics/journey/timeseries"
tags: ["Product Analytics"]
---

# Compute journey timeseries analytics

`POST /api/v2/product-analytics/journey/timeseries`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/product-analytics/journey/timeseries`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/product-analytics/journey/timeseries/post.ts> (a function with typed inputs; its response is checked against the schema)

Compute timeseries results for a journey query.
Returns one series per group-by combination, bucketed by the requested interval.

## Request body

- ProductAnalyticsFormulaJourneyRequest: Request body for a journey timeseries query.
  - `data` ProductAnalyticsFormulaJourneyRequestData, required: The single JSON:API resource carrying a journey timeseries query. Its attributes hold the time window, the bucket interval that splits it, and the journey metric to compute per bucket.
    - `attributes` ProductAnalyticsFormulaJourneyRequestAttributes, required: Attributes of a journey timeseries request.
      - `from` integer, required: Start of the query window, in epoch milliseconds.
      - `interval` integer: Time bucket interval in milliseconds.
      - `query` ProductAnalyticsFormulaJourneyQuery, required: Query definition for a journey timeseries request.
        - `compute` ProductAnalyticsGraphQueryCompute, required: Defines the metric computed over the journey.
          - `aggregation` string, required: Aggregation function: `count`, `cardinality`, `avg`, `median`, `min`, `max`, `sum`, or a percentile of the form `pc<N>` such as `pc95`. Defaults to `cardinality`.
          - `interval` integer: Time bucket interval in milliseconds, used by timeseries queries.
          - `metric` string: Metric to aggregate on. Use a facet path such as `@view.time_spent`, or one of the journey metrics `__dd.conversion`, `__dd.conversion_rate`, `__dd.time_to_convert`, or `__dd.dropoff_rate`. Defaults to `__dd.conversion`.
          - `target` union: A reference to a step, or a range of steps, in the journey. Use a `node` target to name a single step, or a `path` target to name the range between two steps.
            - ProductAnalyticsJourneyNodeTarget: A reference to a single step of the journey.
              - …
            - ProductAnalyticsJourneyPathTarget: A reference to the range of steps between two nodes of the journey.
              - …
        - `group_by` ProductAnalyticsGraphQueryGroupBy[]: Segments the results by the values of one or more facets.
          - `facet` string, required: Attribute path to group by.
          - `limit` integer: Maximum number of groups to return. Omit it to let the service choose.
          - `should_exclude_missing` boolean: Whether to exclude entities that have no value for this facet.
          - `sort` ProductAnalyticsGroupBySort: Sort configuration for group-by results.
            - `aggregation` string: The aggregation function to sort by.
            - `metric` string: The metric to sort by.
            - `order` 'asc' | 'desc': Direction of sort.
          - `source` 'product_analytics_audience_filters.users' | 'product_analytics_audience_filters.accounts': Audience dimension to group by, instead of an event facet.
          - `target` union: A reference to a step, or a range of steps, in the journey. Use a `node` target to name a single step, or a `path` target to name the range between two steps.
            - ProductAnalyticsJourneyNodeTarget: A reference to a single step of the journey.
              - …
            - ProductAnalyticsJourneyPathTarget: A reference to the range of steps between two nodes of the journey.
              - …
          - `value_filters` string[]: Restricts the results to these facet values.
        - `query_id` string: Caller-defined identifier echoed back in the results.
        - `search` ProductAnalyticsJourneySearch, required: Defines the steps of the journey and the filters applied to it.
          - `expression` string, required: Expression combining the node aliases in order, for example `A -> B -> C`.
          - `filters` ProductAnalyticsJourneySearchFilters: Filters applied on top of the journey step expression.
            - `audience_filters` ProductAnalyticsJourneyAudienceFilters: Restricts the journey to an audience built from named sub-queries. Sub-query names must be unique across `users`, `segments`, and `accounts`.
              - …
            - `graph_filters` ProductAnalyticsJourneySearchGraphFilter[]: Filters on journey-level metrics such as time to convert.
              - …
            - `string_filter` string: Free-text search query applied to the whole journey.
          - `join_keys` ProductAnalyticsJoinKeys: Identity join keys used to stitch events belonging to the same user or session.
            - `primary` string: Primary identity join key. Defaults to `@session.id`.
            - `secondary` string[]: Additional identity join keys.
          - `node_objects` object, required: Map of node alias to the query matching that step of the journey. Every alias used in `expression` must have an entry here.
      - `to` integer, required: End of the query window, in epoch milliseconds.
    - `type` 'formula_journey_request', required: The resource type identifier for a journey timeseries or scalar request.

## Response `200`

OK

- ProductAnalyticsJourneyTimeseriesResponse: Response for a journey timeseries query.
  - `data` ProductAnalyticsJourneyTimeseriesResponseData, required: The single JSON:API resource holding journey timeseries results. Its attributes contain one series per group along with the timestamps the points fall on.
    - `attributes` ProductAnalyticsTimeseriesResponseAttributes, required: Attributes of a timeseries analytics response, containing series data, timestamps, and interval definitions.
      - `intervals` ProductAnalyticsInterval[]: Interval definitions describing the time buckets used in the response.
        - `milliseconds` integer: The duration of each time bucket in milliseconds.
        - `start_time` integer: The start of this interval as an epoch timestamp in milliseconds.
        - `times` integer[]: Epoch timestamps (in milliseconds) for each bucket in this interval.
        - `type` string: The interval type (e.g., fixed or auto-computed bucket size).
      - `series` ProductAnalyticsSerie[]: The list of series, each corresponding to a query or group-by combination.
        - `group_tags` string[]: The group-by tag values that identify this series.
        - `query_index` integer: The index of the query that produced this series.
        - `unit` ProductAnalyticsUnit[]: Unit definitions for the series values.
          - `family` string: The unit family (e.g., time, bytes).
          - `id` integer: Numeric identifier for the unit.
          - `name` string: The full name of the unit (e.g., nanosecond).
          - `plural` string: Plural form of the unit name (e.g., nanoseconds).
          - `scale_factor` number, double: Conversion factor relative to the base unit of the family.
          - `short_name` string: Abbreviated unit name (e.g., ns).
      - `times` integer[]: Timestamps for each data point (epoch milliseconds).
      - `values` array[]: Values for each series at each time point.
        - number[]: Array of numeric values for a single series across all time points.
    - `id` string, required: Identifier of this result.
    - `type` 'journey_timeseries_response', required: The resource type identifier for a journey timeseries response.

## Other responses

- `400`: Bad Request
- `403`: Not Authorized
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
