> ## 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.

# kosli_notification_config data source

> Fetches where Kosli sends one type of notification that Kosli raises itself, and when that notification was last delivered.

Fetches where Kosli sends one type of notification that Kosli raises itself, and when that notification was last delivered.

If the organization has not configured a type, the data source returns `configured = false` and empty target sets. In that case, Kosli derives the recipients from what the notification is about.

Use this data source to:

* Check whether the organization overrides the recipients Kosli derives
* Read the configured email, Slack webhook, and webhook targets
* Monitor when a notification was last delivered and whether the latest delivery failed

## Example usage

```terraform theme={"theme":"dracula","languages":{"custom":["/languages/rego.json"]}}
terraform {
  required_providers {
    kosli = {
      source = "kosli-dev/kosli"
    }
  }
}

# Query where API key expiry warnings are sent
data "kosli_notification_config" "api_key_expiry" {
  notification_type = "api_key_expiry"
}

output "api_key_expiry_configured" {
  description = "Whether the organization overrides the recipients Kosli derives"
  value       = data.kosli_notification_config.api_key_expiry.configured
}

output "api_key_expiry_emails" {
  description = "Email addresses API key expiry warnings are sent to"
  value       = data.kosli_notification_config.api_key_expiry.emails
}

output "api_key_expiry_last_notified_at" {
  description = "When an API key expiry warning was last sent (RFC3339)"
  value       = data.kosli_notification_config.api_key_expiry.last_notified_at
}
```

## Read-only access

Data sources provide read-only access to notification configuration. To set or remove targets, use the [`kosli_notification_config` resource](/terraform-reference/resources/notification_config).

## Schema

### Required

* `notification_type` (String) The type of notification to query. Currently `api_key_expiry` (warnings that a service account API key is about to expire).

### Read-only

* `configured` (Boolean) Whether the organization has configured targets for this notification type.
* `emails` (Set of String) Email addresses the notification is sent to.
* `last_failure_at` (String) When the most recent failed delivery happened (RFC3339). Null unless that failure is more recent than the last successful delivery.
* `last_failure_error` (String) Why the most recent failed delivery failed. Null unless that failure is more recent than the last successful delivery.
* `last_notified_at` (String) When a notification of this type was last sent for the organization (RFC3339). Null if none has been sent.
* `slack_webhooks` (Set of String, Sensitive) Slack incoming webhook URLs the notification is posted to.
* `webhooks` (Set of String, Sensitive) Generic webhook URLs the notification is POSTed to.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.