---
title: "POST /api/v1/config/notification-policies"
method: POST
path: "/api/v1/config/notification-policies"
tags: ["NotificationPolicy"]
---

# POST /api/v1/config/notification-policies

`POST /api/v1/config/notification-policies`

## Request body

- Configv1CreateNotificationPolicyRequest
  - `notification_policy` Configv1NotificationPolicy
    - `slug` string — Unique identifier of the NotificationPolicy. If a `slug` isn't provided, one will be generated based of the `name` field. You can't modify this field after the NotificationPolicy is created.
    - `name` string — Required. Name of the NotificationPolicy. You can modify this value after the NotificationPolicy is created.
    - `created_at` string, date-time — Timestamp of when the NotificationPolicy was created. Cannot be set by clients.
    - `updated_at` string, date-time — Timestamp of when the NotificationPolicy was last updated. Cannot be set by clients.
    - `bucket_slug` string — Slug of the bucket the notification policy belongs to. Required if team_slug is not set.
    - `team_slug` string — Slug of the team the notification policy belongs to. Required if bucket_slug is not set.
    - `routes` NotificationPolicyRoutes
      - `defaults` RoutesSeverityNotifiers
        - `warn` RoutesNotifierList
          - `notifier_slugs` string[] — Slugs of notifiers that will receive the alerts.
          - `repeat_interval_secs` integer — Frequency at which to resend alerts.
          - `group_by` NotificationPolicyRoutesGroupBy
            - `label_names` string[] — Set of label names used to group alerts. For example, if label_names is ["service", "code"] then all alerts including labels {service="foo",code="404"} will be grouped together.
        - `critical` RoutesNotifierList
          - `notifier_slugs` string[] — Slugs of notifiers that will receive the alerts.
          - `repeat_interval_secs` integer — Frequency at which to resend alerts.
          - `group_by` NotificationPolicyRoutesGroupBy
            - `label_names` string[] — Set of label names used to group alerts. For example, if label_names is ["service", "code"] then all alerts including labels {service="foo",code="404"} will be grouped together.
      - `overrides` NotificationPolicyRoutesOverride[] — Optional list of overrides to use for alerts having matching labels. Each override defines labels that potentially match an alert's labels. If one or more overrides match an alert, the notifiers of the first matching override are used instead of the defaults.
        - `alert_label_matchers` Configv1LabelMatcher[] — Set of matchers on an alert's labels. If all labels match then the override notifiers apply.
          - `type` 'EXACT' | 'REGEX'
          - `name` string — name always matches against an exact label name.
          - `value` string — value matches against a label value based on the configured type.
        - `notifiers` RoutesSeverityNotifiers
          - `warn` RoutesNotifierList
            - `notifier_slugs` string[] — Slugs of notifiers that will receive the alerts.
            - `repeat_interval_secs` integer — Frequency at which to resend alerts.
            - `group_by` NotificationPolicyRoutesGroupBy
              - …
          - `critical` RoutesNotifierList
            - `notifier_slugs` string[] — Slugs of notifiers that will receive the alerts.
            - `repeat_interval_secs` integer — Frequency at which to resend alerts.
            - `group_by` NotificationPolicyRoutesGroupBy
              - …
  - `dry_run` boolean — If true, the NotificationPolicy isn't created, and no response NotificationPolicy will be returned. The response will return an error if the given NotificationPolicy is invalid.

## Response `200`

A successful response containing the created NotificationPolicy.

- Configv1CreateNotificationPolicyResponse
  - `notification_policy` Configv1NotificationPolicy
    - `slug` string — Unique identifier of the NotificationPolicy. If a `slug` isn't provided, one will be generated based of the `name` field. You can't modify this field after the NotificationPolicy is created.
    - `name` string — Required. Name of the NotificationPolicy. You can modify this value after the NotificationPolicy is created.
    - `created_at` string, date-time — Timestamp of when the NotificationPolicy was created. Cannot be set by clients.
    - `updated_at` string, date-time — Timestamp of when the NotificationPolicy was last updated. Cannot be set by clients.
    - `bucket_slug` string — Slug of the bucket the notification policy belongs to. Required if team_slug is not set.
    - `team_slug` string — Slug of the team the notification policy belongs to. Required if bucket_slug is not set.
    - `routes` NotificationPolicyRoutes
      - `defaults` RoutesSeverityNotifiers
        - `warn` RoutesNotifierList
          - `notifier_slugs` string[] — Slugs of notifiers that will receive the alerts.
          - `repeat_interval_secs` integer — Frequency at which to resend alerts.
          - `group_by` NotificationPolicyRoutesGroupBy
            - `label_names` string[] — Set of label names used to group alerts. For example, if label_names is ["service", "code"] then all alerts including labels {service="foo",code="404"} will be grouped together.
        - `critical` RoutesNotifierList
          - `notifier_slugs` string[] — Slugs of notifiers that will receive the alerts.
          - `repeat_interval_secs` integer — Frequency at which to resend alerts.
          - `group_by` NotificationPolicyRoutesGroupBy
            - `label_names` string[] — Set of label names used to group alerts. For example, if label_names is ["service", "code"] then all alerts including labels {service="foo",code="404"} will be grouped together.
      - `overrides` NotificationPolicyRoutesOverride[] — Optional list of overrides to use for alerts having matching labels. Each override defines labels that potentially match an alert's labels. If one or more overrides match an alert, the notifiers of the first matching override are used instead of the defaults.
        - `alert_label_matchers` Configv1LabelMatcher[] — Set of matchers on an alert's labels. If all labels match then the override notifiers apply.
          - `type` 'EXACT' | 'REGEX'
          - `name` string — name always matches against an exact label name.
          - `value` string — value matches against a label value based on the configured type.
        - `notifiers` RoutesSeverityNotifiers
          - `warn` RoutesNotifierList
            - `notifier_slugs` string[] — Slugs of notifiers that will receive the alerts.
            - `repeat_interval_secs` integer — Frequency at which to resend alerts.
            - `group_by` NotificationPolicyRoutesGroupBy
              - …
          - `critical` RoutesNotifierList
            - `notifier_slugs` string[] — Slugs of notifiers that will receive the alerts.
            - `repeat_interval_secs` integer — Frequency at which to resend alerts.
            - `group_by` NotificationPolicyRoutesGroupBy
              - …

## Other responses

- `400` — Cannot create the NotificationPolicy because the request is invalid.
- `409` — Cannot create the NotificationPolicy because there is a conflict with an existing NotificationPolicy.
- `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)
