---
title: "PUT /api/v1/config/recording-rules/{slug}"
method: PUT
path: "/api/v1/config/recording-rules/{slug}"
tags: ["RecordingRule"]
---

# PUT /api/v1/config/recording-rules/{slug}

`PUT /api/v1/config/recording-rules/{slug}`

## Path parameters

- `slug` string, required

## Request body

- ConfigV1UpdateRecordingRuleBody
  - `recording_rule` Configv1RecordingRule
    - `slug` string — Unique identifier of the RecordingRule. If a `slug` isn't provided, one will be generated based of the `name` field. You can't modify this field after the RecordingRule is created.
    - `name` string — Required. Name of the RecordingRule. You can modify this value after the RecordingRule is created.
    - `created_at` string, date-time — Timestamp of when the RecordingRule was created. Cannot be set by clients.
    - `updated_at` string, date-time — Timestamp of when the RecordingRule was last updated. Cannot be set by clients.
    - `bucket_slug` string — Optional slug of the bucket the RecordingRule belongs to.
    - `label_policy` Configv1RecordingRuleLabelPolicy
      - `add` object — Labels to add or overwrite before storing the result.
    - `interval_secs` integer — Optional interval for evaluating the recording rule.
    - `metric_name` string — The name of the time series to use for output, which must be a valid metric name.
    - `prometheus_expr` string — The PromQL expression to evaluate at the time of each evaluation cycle. The result is recorded as a new time series with its metric name defined by the metric_name (or name) field.
    - `execution_group` string — Optional execution_group in which this rule is to be evaluated. At least one of bucket_slug and execution_group must be set. If both are set, then they are expected to match.
  - `create_if_missing` boolean — If true, the RecordingRule will be created if it does not already exist, identified by slug. If false, an error will be returned if the RecordingRule does not already exist.
  - `dry_run` boolean — If true, the RecordingRule isn't created or updated, and no response RecordingRule will be returned. The response will return an error if the given RecordingRule is invalid.

## Response `200`

A successful response containing the updated RecordingRule.

- Configv1UpdateRecordingRuleResponse
  - `recording_rule` Configv1RecordingRule
    - `slug` string — Unique identifier of the RecordingRule. If a `slug` isn't provided, one will be generated based of the `name` field. You can't modify this field after the RecordingRule is created.
    - `name` string — Required. Name of the RecordingRule. You can modify this value after the RecordingRule is created.
    - `created_at` string, date-time — Timestamp of when the RecordingRule was created. Cannot be set by clients.
    - `updated_at` string, date-time — Timestamp of when the RecordingRule was last updated. Cannot be set by clients.
    - `bucket_slug` string — Optional slug of the bucket the RecordingRule belongs to.
    - `label_policy` Configv1RecordingRuleLabelPolicy
      - `add` object — Labels to add or overwrite before storing the result.
    - `interval_secs` integer — Optional interval for evaluating the recording rule.
    - `metric_name` string — The name of the time series to use for output, which must be a valid metric name.
    - `prometheus_expr` string — The PromQL expression to evaluate at the time of each evaluation cycle. The result is recorded as a new time series with its metric name defined by the metric_name (or name) field.
    - `execution_group` string — Optional execution_group in which this rule is to be evaluated. At least one of bucket_slug and execution_group must be set. If both are set, then they are expected to match.

## Other responses

- `400` — Cannot update the RecordingRule because the request is invalid.
- `404` — Cannot update the RecordingRule because the slug does not exist.
- `409` — Cannot update the RecordingRule because there is a conflict with an existing RecordingRule.
- `500` — An unexpected error response.
- `default` — An undefined error response.

---

[API](https://skmtc.dev/chronosphere/apis/config-v1-api.md) · [All operations](https://skmtc.dev/chronosphere/apis/config-v1-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/chronosphere/config-v1-api/revisions/530951bd2ccf/schema)
