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

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

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

## Path parameters

- `slug` string, required

## Request body

- ConfigV1UpdateMappingRuleBody
  - `create_if_missing` boolean — If `true`, the MappingRule will be created if it does not already exist, identified by `slug`. If `false`, an error will be returned if the MappingRule does not already exist.
  - `dry_run` boolean — If `true`, validates the specified configuration without creating or updating the MappingRule. If the specified configuration is valid, the endpoint returns a partial response without the MappingRule. If the specified configuration is invalid, the endpoint returns an error.
  - `mapping_rule` Configv1MappingRule
    - `aggregation_policy` MappingRuleAggregationPolicy
      - `aggregation` 'LAST' | 'MIN' | 'MAX' | 'MEAN' | 'MEDIAN' | 'COUNT' | 'SUM' | 'SUMSQ' | 'STDEV' | 'P10' | 'P20' | 'P30' | 'P40' | 'P50' | 'P60' | 'P70' | 'P80' | 'P90' | 'P95' | 'P99' | 'P999' | 'P9999' | 'P25' | 'P75' | 'COUNT_SAMPLES' | 'HISTOGRAM'
      - `drop_timestamp` boolean — Deprecated: This parameter is no longer supported.
      - `interval` string — The interval between aggregated data points.
      - `storage_policy` Configv1MappingRuleStoragePolicy
        - `resolution` string — Deprecated: This parameter is no longer supported.
        - `retention` string — Deprecated: This parameter is no longer supported.
    - `bucket_slug` string — The slug of the bucket the MappingRule belongs to.
    - `created_at` string, date-time — Timestamp of when the MappingRule was created. Cannot be set by clients.
    - `drop` boolean — Specifies whether to drop the given set of metrics. Cannot be set if the `aggregation_policy` object is set.
    - `filters` Configv1LabelFilter[], required — The filters that determine which metrics should have rules applied to them. To be considered a match, a metric must meet the criteria for all of the filters specified in this array.
      - `name` string — The name of the label to match.
      - `value_glob` string — The glob value of the label to match.
    - `mode` 'ENABLED' | 'PREVIEW' — - ENABLED: ENABLED rules are applied. Rules default to ENABLED. - PREVIEW: PREVIEW rules are not applied, but shaping impact stats for them rule are recorded.
    - `name` string, required — The name of the MappingRule. You can modify this value after the MappingRule is created.
    - `slug` string — The unique identifier of the MappingRule. If a `slug` isn't provided, one is generated based on the `name` field. You can't modify this field after the MappingRule is created.
    - `updated_at` string, date-time — Timestamp of when the MappingRule was last updated. Cannot be set by clients.

## Response `200`

A successful response containing the updated MappingRule.

- Configv1UpdateMappingRuleResponse
  - `mapping_rule` Configv1MappingRule
    - `aggregation_policy` MappingRuleAggregationPolicy
      - `aggregation` 'LAST' | 'MIN' | 'MAX' | 'MEAN' | 'MEDIAN' | 'COUNT' | 'SUM' | 'SUMSQ' | 'STDEV' | 'P10' | 'P20' | 'P30' | 'P40' | 'P50' | 'P60' | 'P70' | 'P80' | 'P90' | 'P95' | 'P99' | 'P999' | 'P9999' | 'P25' | 'P75' | 'COUNT_SAMPLES' | 'HISTOGRAM'
      - `drop_timestamp` boolean — Deprecated: This parameter is no longer supported.
      - `interval` string — The interval between aggregated data points.
      - `storage_policy` Configv1MappingRuleStoragePolicy
        - `resolution` string — Deprecated: This parameter is no longer supported.
        - `retention` string — Deprecated: This parameter is no longer supported.
    - `bucket_slug` string — The slug of the bucket the MappingRule belongs to.
    - `created_at` string, date-time — Timestamp of when the MappingRule was created. Cannot be set by clients.
    - `drop` boolean — Specifies whether to drop the given set of metrics. Cannot be set if the `aggregation_policy` object is set.
    - `filters` Configv1LabelFilter[], required — The filters that determine which metrics should have rules applied to them. To be considered a match, a metric must meet the criteria for all of the filters specified in this array.
      - `name` string — The name of the label to match.
      - `value_glob` string — The glob value of the label to match.
    - `mode` 'ENABLED' | 'PREVIEW' — - ENABLED: ENABLED rules are applied. Rules default to ENABLED. - PREVIEW: PREVIEW rules are not applied, but shaping impact stats for them rule are recorded.
    - `name` string, required — The name of the MappingRule. You can modify this value after the MappingRule is created.
    - `slug` string — The unique identifier of the MappingRule. If a `slug` isn't provided, one is generated based on the `name` field. You can't modify this field after the MappingRule is created.
    - `updated_at` string, date-time — Timestamp of when the MappingRule was last updated. Cannot be set by clients.

## Other responses

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

---

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