# Notification Targets

## What are Notification Targets?

Notification Targets are named destinations where notifications can be sent.

You create Notification Targets to receive notifications via email, Slack, AWS SNS, and webhook. You specify which Notification Targets to use when creating Notification Configurations.

## Using Notification Targets

Notification Targets can be referenced while configuring notifications for Notifiable Objects using Spyctl. You can either specify a Notification Target or a Notification Template that map specific targets to templates like below.

**Example usage with Spyctl**:

Example:

```yaml
spyctl notifications configure saved-query QUERY_UID \
  --target TARGET_NAME_OR_UID \
  --target-map TARGET_NAME_OR_UID=TEMPLATE_NAME_OR_UID

```

Usage:

```yaml
spyctl notifications configure saved-query query:abc \
  --target OperationsTeam \
  --target-map SecurityTeam=email-template \
```

The `$spyctl notifications configure` command allows notifications to be sent using either Custom templates with Targets or directly via Targets (using Default Template).

## Types:

### Emails

Email Notification Targets contain a list of email address destinations for notifications.

```yaml
apiVersion: spyderbat/v1
kind: NotificationTarget
metadata:
  name: Example
  type: email
spec:
  emails:
  - engineer1@example.com
  - engineer2@example.com
```

### Slack

Slack Notification Targets contain a single Slack Hook URL destination for notifications.

```yaml
apiVersion: spyderbat/v1
kind: NotificationTarget
metadata:
  name: Example
  type: slack
spec:
  url: https://hooks.slack.com/services/xxxxxxxxxxx/xxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx
```

### Webhook

Webhook Notification Targets contain a single generic webhook URL destination for notifications.

```yaml
apiVersion: spyderbat/v1
kind: NotificationTarget
metadata:
  name: Example
  type: webhook
spec:
  url: https://my.webhook.example/location/of/webhook
```

### PagerDuty

PagerDuty Notification Targets contain a single routing key used to send notifications to a specific PagerDuty service.

```yaml
apiVersion: spyderbat/v1
kind: NotificationTarget
metadata:
  name: Example
  type: pagerduty
spec:
  routing_key: abcdef1234567890abcdef1234567890

```

## Manage Notification Targets Using Spyctl

To start creating Targets follow our tutorial using spyctl :: [Manage Notification Targets Using Spyctl](/reference/spyctl/notification-targets-management-spyctl.md)

### Quick Start Tutorial

If you already have Targets set, start configuring Spyderbat Notifications using spyctl.

[How to setup Spyderbat Notifications (Spyctl CLI)](/tutorials/notifications/how-to-set-up-spyderbat-notifications-spyctl.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spyderbat.com/concepts/notifications/notification-targets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
