For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/es/api/latest/product-analytics/compute-retention-timeseries.md. A documentation index is available at /llms.txt.
Language
Datadog site

Compute retention timeseries

ADVERTENCIANote: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
POSThttps://api.datadoghq.com/api/v2/product-analytics/retention/timeserieshttps://api.us3.datadoghq.com/api/v2/product-analytics/retention/timeserieshttps://api.us5.datadoghq.com/api/v2/product-analytics/retention/timeserieshttps://api.datadoghq.eu/api/v2/product-analytics/retention/timeserieshttps://api.ap1.datadoghq.com/api/v2/product-analytics/retention/timeserieshttps://api.ap2.datadoghq.com/api/v2/product-analytics/retention/timeserieshttps://api.uk1.datadoghq.com/api/v2/product-analytics/retention/timeserieshttps://api.ddog-gov.com/api/v2/product-analytics/retention/timeserieshttps://api.us2.ddog-gov.com/api/v2/product-analytics/retention/timeseries

Descripción general

Compute retention as a series of values over time, using the same query definition as the retention grid.

This endpoint requires the rum_apps_read permission.

Solicitud

Body Data (required)

The retention timeseries query.

Campo
Type
Descripción
data [required]
object

The single JSON:API resource carrying a retention scalar or timeseries query. Its attributes hold the time window to query and the retention query definition to evaluate.

Respuesta

OK

Response for a timeseries analytics query.

Campo
Type
Descripción
data
object

Data object for a timeseries analytics response.

meta
object

Metadata for a Product Analytics query response.

Ejemplo de código

Compute retention timeseries
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/product-analytics/retention/timeseries" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "from": 1756425600000,
      "query": {
        "compute": {
          "aggregation": "count",
          "metric": "__dd.retention_rate"
        },
        "search": {
          "cohort_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view @view.name:Signup"
              }
            },
            "time_interval": {
              "type": "calendar",
              "value": {
                "alignment": "monday",
                "quantity": 1,
                "timezone": "UTC",
                "type": "week"
              }
            }
          },
          "retention_entity": "@usr.id",
          "return_condition": "conversion_on_or_after",
          "return_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view"
              }
            }
          }
        }
      },
      "to": 1756857600000
    },
    "type": "formula_retention_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/product-analytics/retention/timeseries" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "from": 1756425600000,
      "query": {
        "compute": {
          "aggregation": "count",
          "metric": "__dd.retention_rate"
        },
        "search": {
          "cohort_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view @view.name:Signup"
              }
            },
            "time_interval": {
              "type": "calendar",
              "value": {
                "alignment": "monday",
                "quantity": 1,
                "timezone": "UTC",
                "type": "week"
              }
            }
          },
          "retention_entity": "@usr.id",
          "return_condition": "conversion_on_or_after",
          "return_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view"
              }
            }
          }
        }
      },
      "to": 1756857600000
    },
    "type": "formula_retention_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/product-analytics/retention/timeseries" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "from": 1756425600000,
      "query": {
        "compute": {
          "aggregation": "count",
          "metric": "__dd.retention_rate"
        },
        "search": {
          "cohort_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view @view.name:Signup"
              }
            },
            "time_interval": {
              "type": "calendar",
              "value": {
                "alignment": "monday",
                "quantity": 1,
                "timezone": "UTC",
                "type": "week"
              }
            }
          },
          "retention_entity": "@usr.id",
          "return_condition": "conversion_on_or_after",
          "return_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view"
              }
            }
          }
        }
      },
      "to": 1756857600000
    },
    "type": "formula_retention_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/product-analytics/retention/timeseries" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "from": 1756425600000,
      "query": {
        "compute": {
          "aggregation": "count",
          "metric": "__dd.retention_rate"
        },
        "search": {
          "cohort_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view @view.name:Signup"
              }
            },
            "time_interval": {
              "type": "calendar",
              "value": {
                "alignment": "monday",
                "quantity": 1,
                "timezone": "UTC",
                "type": "week"
              }
            }
          },
          "retention_entity": "@usr.id",
          "return_condition": "conversion_on_or_after",
          "return_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view"
              }
            }
          }
        }
      },
      "to": 1756857600000
    },
    "type": "formula_retention_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/product-analytics/retention/timeseries" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "from": 1756425600000,
      "query": {
        "compute": {
          "aggregation": "count",
          "metric": "__dd.retention_rate"
        },
        "search": {
          "cohort_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view @view.name:Signup"
              }
            },
            "time_interval": {
              "type": "calendar",
              "value": {
                "alignment": "monday",
                "quantity": 1,
                "timezone": "UTC",
                "type": "week"
              }
            }
          },
          "retention_entity": "@usr.id",
          "return_condition": "conversion_on_or_after",
          "return_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view"
              }
            }
          }
        }
      },
      "to": 1756857600000
    },
    "type": "formula_retention_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/product-analytics/retention/timeseries" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "from": 1756425600000,
      "query": {
        "compute": {
          "aggregation": "count",
          "metric": "__dd.retention_rate"
        },
        "search": {
          "cohort_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view @view.name:Signup"
              }
            },
            "time_interval": {
              "type": "calendar",
              "value": {
                "alignment": "monday",
                "quantity": 1,
                "timezone": "UTC",
                "type": "week"
              }
            }
          },
          "retention_entity": "@usr.id",
          "return_condition": "conversion_on_or_after",
          "return_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view"
              }
            }
          }
        }
      },
      "to": 1756857600000
    },
    "type": "formula_retention_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/product-analytics/retention/timeseries" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "from": 1756425600000,
      "query": {
        "compute": {
          "aggregation": "count",
          "metric": "__dd.retention_rate"
        },
        "search": {
          "cohort_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view @view.name:Signup"
              }
            },
            "time_interval": {
              "type": "calendar",
              "value": {
                "alignment": "monday",
                "quantity": 1,
                "timezone": "UTC",
                "type": "week"
              }
            }
          },
          "retention_entity": "@usr.id",
          "return_condition": "conversion_on_or_after",
          "return_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view"
              }
            }
          }
        }
      },
      "to": 1756857600000
    },
    "type": "formula_retention_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/product-analytics/retention/timeseries" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "from": 1756425600000,
      "query": {
        "compute": {
          "aggregation": "count",
          "metric": "__dd.retention_rate"
        },
        "search": {
          "cohort_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view @view.name:Signup"
              }
            },
            "time_interval": {
              "type": "calendar",
              "value": {
                "alignment": "monday",
                "quantity": 1,
                "timezone": "UTC",
                "type": "week"
              }
            }
          },
          "retention_entity": "@usr.id",
          "return_condition": "conversion_on_or_after",
          "return_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view"
              }
            }
          }
        }
      },
      "to": 1756857600000
    },
    "type": "formula_retention_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/product-analytics/retention/timeseries" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "from": 1756425600000,
      "query": {
        "compute": {
          "aggregation": "count",
          "metric": "__dd.retention_rate"
        },
        "search": {
          "cohort_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view @view.name:Signup"
              }
            },
            "time_interval": {
              "type": "calendar",
              "value": {
                "alignment": "monday",
                "quantity": 1,
                "timezone": "UTC",
                "type": "week"
              }
            }
          },
          "retention_entity": "@usr.id",
          "return_condition": "conversion_on_or_after",
          "return_criteria": {
            "base_query": {
              "data_source": "product_analytics",
              "search": {
                "query": "@type:view"
              }
            }
          }
        }
      },
      "to": 1756857600000
    },
    "type": "formula_retention_request"
  }
}
EOF