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

# Get notification configuration

> Where an org sends one kind of notification Kosli raises itself.

An empty target list means the org has not configured any, and Kosli
derives the recipients from what the notification is about.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /notification-config/{org}/{notification_type}
openapi: 3.1.0
info:
  title: Kosli API
  summary: The API for communicating with Kosli
  description: >

    # Authentication 


    When making requests against Kosli API, you can authenticate your requests
    using a bearer token. 

    Set the bearer token in the request Authorization header to a valid API
    key. 

    API Keys can be personal or for service accounts. Check the [service
    accounts
    documentation](https://docs.kosli.com/getting_started/service-accounts/) for
    details. 


    ## Curl example


    ```shell

    curl -H "Authorization: Bearer <<your-api-key>>"
    https://app.kosli.com/api/v2/environments/<<your-org-name>>

    ```
  version: '2.0'
servers:
  - url: https://app.kosli.com/api/v2
    description: EU
  - url: https://app.us.kosli.com/api/v2
    description: US
security:
  - HTTPBearer: []
paths:
  /notification-config/{org}/{notification_type}:
    get:
      tags:
        - Notification Config
      summary: Get notification configuration
      description: |-
        Where an org sends one kind of notification Kosli raises itself.

        An empty target list means the org has not configured any, and Kosli
        derives the recipients from what the notification is about.
      operationId: get_notification_config
      parameters:
        - name: notification_type
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/NotificationType'
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationConfigResponse'
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    NotificationType:
      type: string
      enum:
        - api_key_expiry
      title: NotificationType
      description: |-
        A kind of notification a customer can configure.

        A new kind is a new member here, not a new field or a new collection.
    NotificationConfigResponse:
      properties:
        notification_type:
          $ref: '#/components/schemas/NotificationType'
          description: The kind of notification this configuration applies to
        scope:
          anyOf:
            - type: string
            - type: 'null'
          title: Scope
          description: The entity the configuration applies to, or null for the whole org
        targets:
          items:
            oneOf:
              - $ref: '#/components/schemas/SlackNotificationTargetResponse'
              - $ref: '#/components/schemas/WebhookNotificationTargetResponse'
              - $ref: '#/components/schemas/EmailNotificationTargetResponse'
            discriminator:
              propertyName: type
              mapping:
                EMAIL:
                  $ref: '#/components/schemas/EmailNotificationTargetResponse'
                SLACK:
                  $ref: '#/components/schemas/SlackNotificationTargetResponse'
                WEBHOOK:
                  $ref: '#/components/schemas/WebhookNotificationTargetResponse'
          type: array
          title: Targets
          description: >-
            Where notifications of this type go. Empty when the org has not
            configured any, in which case Kosli derives the recipients.
        detection:
          additionalProperties: true
          type: object
          title: Detection
          description: What counts as a condition, for the types that have one
        last_notified_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Last Notified At
          description: >-
            When a notification of this type was last sent for the org, as epoch
            seconds, or null if none has been
        last_failure:
          anyOf:
            - $ref: '#/components/schemas/NotificationFailureResponse'
            - type: 'null'
          description: >-
            The most recent failed delivery, when nothing has been sent since
            it; null otherwise
      type: object
      required:
        - notification_type
        - scope
        - targets
        - detection
      title: NotificationConfigResponse
    SlackNotificationTargetResponse:
      properties:
        type:
          type: string
          const: SLACK
          title: Type
        webhook:
          type: string
          title: Webhook
          description: Slack incoming webhook URL
      type: object
      required:
        - type
        - webhook
      title: SlackNotificationTargetResponse
    WebhookNotificationTargetResponse:
      properties:
        type:
          type: string
          const: WEBHOOK
          title: Type
        webhook:
          type: string
          title: Webhook
          description: URL the notification is POSTed to
        payload_version:
          type: string
          title: Payload Version
          description: Version of the webhook payload format
      type: object
      required:
        - type
        - webhook
        - payload_version
      title: WebhookNotificationTargetResponse
    EmailNotificationTargetResponse:
      properties:
        type:
          type: string
          const: EMAIL
          title: Type
        emails:
          items:
            type: string
          type: array
          title: Emails
          description: Addresses the notification is sent to
      type: object
      required:
        - type
        - emails
      title: EmailNotificationTargetResponse
    NotificationFailureResponse:
      properties:
        failed_at:
          type: number
          title: Failed At
          description: When the delivery failed, as epoch seconds
        error:
          type: string
          title: Error
          description: Why the delivery failed
      type: object
      required:
        - failed_at
        - error
      title: NotificationFailureResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````