> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chronosphere.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateNotificationPolicy



## OpenAPI

````yaml openapi/api_v1_config_openapi3_DOCUMENTATION_ONLY.json POST /api/v1/config/notification-policies
openapi: 3.0.3
info:
  description: >

    The Config API provides standard HTTP/JSON REST endpoints for creating,
    reading,

    updating, deleting, and listing configurable Chronosphere resources.


    Use this link to download the raw Swagger specification:

    <a href="/api/v1/config/swagger.json">/api/v1/config/swagger.json</a>
  title: Config V1 API
  version: v1
servers:
  - url: https://{tenant}.chronosphere.io
    variables:
      tenant:
        default: tenant
        description: tenant ID assigned by the service provider
security:
  - ApiKeyAuth: []
tags:
  - name: ConfigV1
paths:
  /api/v1/config/notification-policies:
    post:
      tags:
        - NotificationPolicy
      operationId: CreateNotificationPolicy
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/configv1CreateNotificationPolicyRequest'
        required: true
        x-originalParamName: body
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1CreateNotificationPolicyResponse'
          description: A successful response containing the created NotificationPolicy.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
          description: Cannot create the NotificationPolicy because the request is invalid.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
          description: >-
            Cannot create the NotificationPolicy because there is a conflict
            with an existing NotificationPolicy.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
          description: An unexpected error response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/genericError'
          description: An undefined error response.
components:
  schemas:
    configv1CreateNotificationPolicyRequest:
      properties:
        dry_run:
          description: >-
            If `true`, validates the specified configuration without creating
            the NotificationPolicy. If the specified configuration is valid, the
            endpoint returns a partial response without the NotificationPolicy.
            If the specified configuration is invalid, the endpoint returns an
            error.
          type: boolean
        notification_policy:
          allOf:
            - $ref: '#/components/schemas/configv1NotificationPolicy'
          description: The NotificationPolicy to create.
      type: object
    configv1CreateNotificationPolicyResponse:
      properties:
        notification_policy:
          $ref: '#/components/schemas/configv1NotificationPolicy'
      type: object
    apiError:
      properties:
        message:
          description: An error message describing what went wrong.
          type: string
      type: object
    genericError:
      additionalProperties: true
      type: object
    configv1NotificationPolicy:
      properties:
        bucket_slug:
          description: >-
            The slug of the bucket that the notification policy belongs to.
            Required if

            `team_slug` is not set.
          type: string
        created_at:
          description: >-
            Timestamp of when the NotificationPolicy was created. Cannot be set
            by clients.
          format: date-time
          readOnly: true
          type: string
        name:
          description: >-
            The name of the NotificationPolicy. You can modify this value after
            the NotificationPolicy is created.
          type: string
        routes:
          allOf:
            - $ref: '#/components/schemas/NotificationPolicyRoutes'
          description: >-
            The routing configuration for alerts that use this notification
            policy.
        slug:
          description: >-
            The unique identifier of the NotificationPolicy. If a `slug` isn't
            provided, one is generated based on the `name` field. You can't
            modify this field after the NotificationPolicy is created.
          type: string
        team_slug:
          description: >-
            The slug of the team that the notification policy belongs to.
            Required if

            `bucket_slug` is not set.
          type: string
        updated_at:
          description: >-
            Timestamp of when the NotificationPolicy was last updated. Cannot be
            set by clients.
          format: date-time
          readOnly: true
          type: string
      required:
        - name
      type: object
    NotificationPolicyRoutes:
      properties:
        defaults:
          allOf:
            - $ref: '#/components/schemas/RoutesSeverityNotifiers'
          description: The default notifiers to use if no override is found.
        overrides:
          description: >-
            A list of overrides to use for alert notification policies. Each

            override defines the labels that potentially match an alert. If an
            alert has

            matching labels, the override notification policy is used for that
            alert

            instead of the default notification policy. If multiple overrides
            match

            the same alert, the first matching override notification policy is
            used.
          items:
            $ref: '#/components/schemas/NotificationPolicyRoutesOverride'
          type: array
      required:
        - defaults
      type: object
    RoutesSeverityNotifiers:
      properties:
        critical:
          allOf:
            - $ref: '#/components/schemas/RoutesNotifierList'
          description: The notifiers that will receive `critical` alerts.
        warn:
          allOf:
            - $ref: '#/components/schemas/RoutesNotifierList'
          description: The notifiers that will receive `warn` alerts.
      type: object
    NotificationPolicyRoutesOverride:
      properties:
        alert_label_matchers:
          description: >-
            The alert labels to match against. If an alert matches all of these
            labels,

            the override notifier is applied to that alert.
          items:
            $ref: '#/components/schemas/configv1LabelMatcher'
          type: array
        notifiers:
          allOf:
            - $ref: '#/components/schemas/RoutesSeverityNotifiers'
          description: The notifiers that will receive the alerts matched by overrides.
      type: object
    RoutesNotifierList:
      properties:
        destinations:
          description: Notification destinations. Cannot be set if notifier_slugs is set.
          items:
            $ref: '#/components/schemas/RoutesDestination'
          type: array
        notifier_slugs:
          description: The slugs of the notifiers that will receive the alerts.
          items:
            type: string
          type: array
        repeat_interval_secs:
          description: The frequency at which to resend alerts.
          format: int32
          type: integer
      type: object
    configv1LabelMatcher:
      properties:
        name:
          description: >-
            The name of the label to match against. This always matches against
            an

            exact label name, regardless of the value of `type`.
          type: string
        type:
          allOf:
            - $ref: '#/components/schemas/configv1LabelMatcherMatcherType'
          description: |-
            Determines how the label `value` is matched. This parameter doesn't
            affect how the label `name` is matched.
        value:
          description: >-
            The value of the label to match against. If `type` is set to
            `EXACT`, this

            matches against an exact label value. If `type` is set to `REGEX`,
            this

            parameter is treated as a regular expression for parsing label
            values.
          type: string
      type: object
    RoutesDestination:
      properties:
        disable_resolves:
          description: |-
            If true, do not send notifications when alerts resolve.
            Defaults to false (resolve notifications are sent).
          type: boolean
        email:
          $ref: '#/components/schemas/DestinationEmailTarget'
        ops_genie:
          $ref: '#/components/schemas/DestinationOpsGenieTarget'
        pagerduty:
          $ref: '#/components/schemas/DestinationPagerdutyTarget'
        slack:
          $ref: '#/components/schemas/DestinationSlackTarget'
        victor_ops:
          $ref: '#/components/schemas/DestinationVictorOpsTarget'
        webhook:
          $ref: '#/components/schemas/DestinationWebhookTarget'
      type: object
    configv1LabelMatcherMatcherType:
      enum:
        - EXACT
        - REGEX
      type: string
    DestinationEmailTarget:
      properties:
        addresses:
          description: The email addresses to send notifications to.
          items:
            type: string
          type: array
      type: object
    DestinationOpsGenieTarget:
      properties:
        external_connection_slug:
          description: The slug of the ExternalConnection that holds OpsGenie credentials.
          type: string
      type: object
    DestinationPagerdutyTarget:
      properties:
        external_connection_slug:
          description: The slug of the ExternalConnection that holds PagerDuty credentials.
          type: string
      type: object
    DestinationSlackTarget:
      properties:
        channels:
          description: The Slack channels to send notifications to.
          items:
            type: string
          type: array
        external_connection_slug:
          description: The slug of the ExternalConnection that holds Slack credentials.
          type: string
      type: object
    DestinationVictorOpsTarget:
      properties:
        external_connection_slug:
          description: The slug of the ExternalConnection that holds VictorOps credentials.
          type: string
        routing_keys:
          description: >-
            The VictorOps routing keys that determine where notifications are
            routed.

            A separate notification is sent for each routing key.
          items:
            type: string
          type: array
      type: object
    DestinationWebhookTarget:
      properties:
        external_connection_slug:
          description: The slug of the ExternalConnection that holds webhook credentials.
          type: string
        query_parameters:
          description: >-
            Query parameters to add to the webhook URL.

            If the webhook URL already contains parameters, these will be
            appended.
          items:
            $ref: '#/components/schemas/WebhookTargetQueryParameter'
          type: array
      type: object
    WebhookTargetQueryParameter:
      properties:
        key:
          type: string
        value:
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: Chronosphere API token
      in: header
      name: API-Token
      type: apiKey

````