---
title: "Enable historical metrics ingestion"
method: POST
path: "/api/v2/metrics/historical-metrics-configurations"
tags: ["Metrics"]
---

# Enable historical metrics ingestion

`POST /api/v2/metrics/historical-metrics-configurations`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/metrics/historical-metrics-configurations`
- 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` scopes: `late_metrics_config_write`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/metrics/historical-metrics-configurations/post.ts> (a function with typed inputs; its response is checked against the schema)

Enable historical metrics ingestion (late data ingestion) for a metric. Idempotent:
enabling an already-enabled metric returns 200 instead of 201. Not supported for
distribution metrics, metrics with an existing tag configuration, or most standard
(non-custom) metrics.

## Request body

- HistoricalMetricsConfigurationCreateRequest: Request body for enabling historical metrics ingestion for a metric.
  - `data` HistoricalMetricsConfigurationCreateData, required: Data object for enabling historical metrics ingestion for a metric.
    - `id` string, required: The metric name, used as the resource ID.
    - `type` 'historical_metrics_configurations', required: The historical metrics configuration resource type.

## Response `200`

OK

- HistoricalMetricsConfigurationResponse: Response containing a historical metrics configuration.
  - `data` HistoricalMetricsConfigurationData: A historical metrics configuration resource object. Existence of this resource means historical metrics ingestion is enabled for the metric; there is no separate enabled attribute.
    - `attributes` HistoricalMetricsConfigurationAttributes: Attributes of a historical metrics configuration.
      - `created_at` string, date-time: Timestamp when historical metrics ingestion was enabled for the metric.
    - `id` string: The metric name, used as the resource ID.
    - `type` 'historical_metrics_configurations': The historical metrics configuration resource type.

## Other responses

- `201`: Created
- `400`: Bad Request
- `404`: Not Found
- `422`: Unprocessable Entity
- `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)
