---
title: "PUT /api/v1/config/derived-labels/{slug}"
method: PUT
path: "/api/v1/config/derived-labels/{slug}"
tags: ["DerivedLabel"]
---

# PUT /api/v1/config/derived-labels/{slug}

`PUT /api/v1/config/derived-labels/{slug}`

## Path parameters

- `slug` string, required

## Request body

- ConfigV1UpdateDerivedLabelBody
  - `derived_label` Configv1DerivedLabel
    - `name` string — Required. Name of the DerivedLabel. You can modify this value after the DerivedLabel is created.
    - `slug` string — Unique identifier of the DerivedLabel. If a `slug` isn't provided, one will be generated based of the `name` field. You can't modify this field after the DerivedLabel is created.
    - `created_at` string, date-time — Timestamp of when the DerivedLabel was created. Cannot be set by clients.
    - `updated_at` string, date-time — Timestamp of when the DerivedLabel was last updated. Cannot be set by clients.
    - `label_name` string — Name of the derived label. It needs to be unique across the system.
    - `description` string — Optional description of the derived label.
    - `metric_label` DerivedLabelMetricLabel
      - `constructed_label` MetricLabelConstructedLabel
        - `value_definitions` ConstructedLabelValueDefinition[]
          - `value` string
          - `filters` Configv1LabelFilter[]
            - `name` string — Name of the label to match.
            - `value_glob` string — Glob value of the label to match.
      - `mapping_label` MetricLabelMappingLabel
        - `name_mappings` MappingLabelNameMapping[]
          - `filters` Configv1LabelFilter[]
            - `name` string — Name of the label to match.
            - `value_glob` string — Glob value of the label to match.
          - `source_label` string — The actual label ingested on the time series
          - `value_mappings` MappingLabelValueMapping[] — These value mappings apply to just the name mapping they belong to.
            - `source_value_globs` string[] — Defines the source label values that should be mapped into the given target_value.
            - `target_value` string — The value that source_value_globs are mapped into. For example, given this mapping: ```yaml value_mappings: - source_value_globs: - Cat - CAT target_value: cat ``` This indicates that the target value `cat` maps to the source label's values `Cat` and `CAT`.
        - `value_mappings` MappingLabelValueMapping[] — These value mappings apply to the whole mapping label. If there's no name_mappings, these value mappings apply to the label that exists on the metric.
          - `source_value_globs` string[] — Defines the source label values that should be mapped into the given target_value.
          - `target_value` string — The value that source_value_globs are mapped into. For example, given this mapping: ```yaml value_mappings: - source_value_globs: - Cat - CAT target_value: cat ``` This indicates that the target value `cat` maps to the source label's values `Cat` and `CAT`.
    - `existing_label_policy` 'KEEP' | 'OVERRIDE'
  - `create_if_missing` boolean — If true, the DerivedLabel will be created if it does not already exist, identified by slug. If false, an error will be returned if the DerivedLabel does not already exist.
  - `dry_run` boolean — If true, the DerivedLabel isn't created or updated, and no response DerivedLabel will be returned. The response will return an error if the given DerivedLabel is invalid.

## Response `200`

A successful response containing the updated DerivedLabel.

- Configv1UpdateDerivedLabelResponse
  - `derived_label` Configv1DerivedLabel
    - `name` string — Required. Name of the DerivedLabel. You can modify this value after the DerivedLabel is created.
    - `slug` string — Unique identifier of the DerivedLabel. If a `slug` isn't provided, one will be generated based of the `name` field. You can't modify this field after the DerivedLabel is created.
    - `created_at` string, date-time — Timestamp of when the DerivedLabel was created. Cannot be set by clients.
    - `updated_at` string, date-time — Timestamp of when the DerivedLabel was last updated. Cannot be set by clients.
    - `label_name` string — Name of the derived label. It needs to be unique across the system.
    - `description` string — Optional description of the derived label.
    - `metric_label` DerivedLabelMetricLabel
      - `constructed_label` MetricLabelConstructedLabel
        - `value_definitions` ConstructedLabelValueDefinition[]
          - `value` string
          - `filters` Configv1LabelFilter[]
            - `name` string — Name of the label to match.
            - `value_glob` string — Glob value of the label to match.
      - `mapping_label` MetricLabelMappingLabel
        - `name_mappings` MappingLabelNameMapping[]
          - `filters` Configv1LabelFilter[]
            - `name` string — Name of the label to match.
            - `value_glob` string — Glob value of the label to match.
          - `source_label` string — The actual label ingested on the time series
          - `value_mappings` MappingLabelValueMapping[] — These value mappings apply to just the name mapping they belong to.
            - `source_value_globs` string[] — Defines the source label values that should be mapped into the given target_value.
            - `target_value` string — The value that source_value_globs are mapped into. For example, given this mapping: ```yaml value_mappings: - source_value_globs: - Cat - CAT target_value: cat ``` This indicates that the target value `cat` maps to the source label's values `Cat` and `CAT`.
        - `value_mappings` MappingLabelValueMapping[] — These value mappings apply to the whole mapping label. If there's no name_mappings, these value mappings apply to the label that exists on the metric.
          - `source_value_globs` string[] — Defines the source label values that should be mapped into the given target_value.
          - `target_value` string — The value that source_value_globs are mapped into. For example, given this mapping: ```yaml value_mappings: - source_value_globs: - Cat - CAT target_value: cat ``` This indicates that the target value `cat` maps to the source label's values `Cat` and `CAT`.
    - `existing_label_policy` 'KEEP' | 'OVERRIDE'

## Other responses

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

---

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