---
title: "Delete metrics records"
method: POST
path: "/unit-cost/v1/telemetry/metric/{metric_name}/delete"
tags: ["telemetry"]
---

# Delete metrics records

`POST /unit-cost/v1/telemetry/metric/{metric_name}/delete`

This endpoint will delete any data within the appropriate stream that matches the supplied properties (timestamp is minimally required).

**Note:** The unit metric must already exist when using this endpoint and "value" is an invalid field.

## Path parameters

- `metric_name` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `records` DeleteMetricTelemetryRecord[], required — A batch of telemetry records to submit to CloudZero.
    - `timestamp` string, required — ISO formatted timestamp of when the usage occurred.
    - `granularity` 'DAILY' | 'MONTHLY' — The sample frequency over time.
    - `associated_cost` AssociatedCost — A definition of the portion of your infrastructure to which this metric telemetry corresponds. When filtering on the dimensions specified here via the CloudZero platform, the corresponding unit metric's value will also be filtered. Defined as a mapping from CloudZero Dimensions to string values, where dimensions are identified similarly to how they would be in the `partitions` parameter of a CloudZero Explorer URL (https://app.cloudzero.com/explorer). For example, - custom:<the name of your CloudZero Custom Dimension> (as defined in CostFormation via the Name parameter) - tag:<your cloud provider tag key> - k8s_label:<your Kubernetes label key> - accounts, services, product_family, ... - k8s_cluster, k8s_namespace, ...

## Response `201`

Telemetry accepted

## Other responses

- `400` — Invalid request, specific responses for: - Invalid JSON - Invalid Schema: Unrecognized filter keys - Invalid Schema: Missing required fields - Timestamp too far into the future - Telemetry stream must exist in order to update telemetry records - All records in a stream must contain the same filter keys - All records in a stream must contain the same granularity as the stream's granularity
- `403` — Not authorized, make sure you're using a valid API key in the header `Authorization`
- `404` — The telemetry stream does not exist. Streams must be created (via sum, replace, or the UI) before records can be deleted.
- `429` — Rate limit exceeded. The API enforces rate limiting on incoming requests. Retry after a short delay.
- `503` — Service temporarily unavailable due to downstream capacity constraints. Retry after a short delay with exponential backoff.

---

[API](https://skmtc.dev/cloudzero/apis/cloudzero-api-v2-resources.md) · [All operations](https://skmtc.dev/cloudzero/apis/cloudzero-api-v2-resources/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cloudzero/cloudzero-api-v2-resources/revisions/fd805a0e75e5/schema)
