---
title: "Send notifications to Slack, Jira and other tools"
sidebarTitle: "Configure notifications"
description: "Turn on email and Slack alerts, or register a notification destination for one of eight tools, filter what it receives and confirm it delivers."
keywords: ["notifications", "alerts", "Slack", "Teams", "PagerDuty", "Jira", "ServiceNow", "Splunk", "Datadog", "email", "notification-targets"]
---

There are two ways to be told about a finding or a verdict without writing a
webhook receiver. They are separate features and you can use both.

| | Alert settings | Notification destinations |
|---|---|---|
| Where | **Settings → Notifications** in the dashboard | The API only (`/api/v1/notification-targets`) |
| Delivers to | Email to named members, and one Slack incoming webhook | Slack, Teams, Splunk, Datadog, PagerDuty, Jira, ServiceNow, email |
| What is sent | New critical or high findings first seen by a scan, a failed policy verdict, and findings past their SLA deadline | Any of the subscribable events, filtered by severity |
| How many | One set per organization | Up to 20 per organization |

Changing either needs `webhooks:manage` and a signed-in person. That
permission cannot be granted to an API key: a destination is somewhere every
future event is copied to.

## Turn on email and Slack alerts

<Steps>
  <Step title="Open the settings">
    **Settings → Notifications.** Only administrators can change them.
  </Step>
  <Step title="Choose the email alerts">
    Select the events to mail (**New critical or high findings on a scan**,
    **A failed policy verdict**, **Findings past their SLA deadline**) and the
    members who receive them. Recipients
    are members of the organization, and membership is checked again each time
    a mail is sent, so somebody who has been removed stops receiving alerts.

    If email alerts cannot be turned on, this deployment has no mail configured.
    See [Send mail through your SMTP relay](/how-to/configure-smtp).
  </Step>
  <Step title="Add a Slack webhook">
    Paste a Slack **incoming webhook URL** and choose which of the two events
    post to it. The URL must be `https`. It is stored encrypted and never
    shown again; the card reports only whether one is configured.
  </Step>
</Steps>

The same settings over the API:

```bash
curl -s -X PUT https://app.trustivan.com/api/v1/notifications/settings \
  -H 'Content-Type: application/json' \
  -b cookies.txt \
  -H "X-CSRF-Token: $(grep trustivan_csrf cookies.txt | awk '{print $7}')" \
  -d '{
        "email_findings": true,
        "email_verdicts": true,
        "email_recipients": ["<member-user-id>"],
        "slack_webhook_url": "https://hooks.slack.com/services/…",
        "slack_findings": true,
        "slack_verdicts": false,
        "email_sla_breaches": true,
        "slack_sla_breaches": false
      }'
```

Leave `slack_webhook_url` out to keep the stored URL, or send `""` to remove
it. Turning email on with no recipients, or naming someone who is not a
member, is a `400`. Turning email on where the deployment has no mail is a
`503` with `mail_unavailable: true`.

## Register a notification destination

A destination receives a message already rendered for one tool. Ask the API
what this deployment can deliver to before you start:

```bash
curl -s https://app.trustivan.com/api/v1/notification-targets -b cookies.txt \
  | jq '{channels, events}'
```

### What each channel needs

`secret` is the destination's one credential. `url` is used only where you
name the host and the credential is separate. `config` holds the non-secret
settings, as strings.

| `channel` | `secret` | `url` | `config` keys |
|---|---|---|---|
| `slack` | The incoming webhook URL | Not used | None |
| `teams` | The incoming webhook URL | Not used | None |
| `splunk` | The HTTP Event Collector token | The collector URL | `index`, `sourcetype` |
| `datadog` | The API key | Not used | `site` |
| `pagerduty` | The Events API v2 integration key | Not used | `region` |
| `jira` | The API token | The site's base URL | `email`, `project_key`, `issue_type` |
| `servicenow` | The integration user's password | `https://<instance>.service-now.com` | `instance`, `username`, `table` |
| `email` | Not used | Not used | None |

Three rules catch most first attempts:

- For Slack and Teams the URL **is** the credential. Send it as `secret` and
  omit `url`, so it is stored encrypted.
- A `config` key the channel does not use is a `400`, not an ignored field.
- `site` and `region` choose from a fixed list; they are not hostnames.
  `region` is `us` or `eu`. `site` is one of `datadoghq.com`,
  `us3.datadoghq.com`, `us5.datadoghq.com`, `datadoghq.eu`,
  `ap1.datadoghq.com` or `ddog-gov.com`.

A host you name is checked before it is stored and again when the connection
is made. Loopback, private, link-local and cloud metadata addresses are
refused.

### Create it

```bash
curl -s -X POST https://app.trustivan.com/api/v1/notification-targets \
  -H 'Content-Type: application/json' \
  -b cookies.txt \
  -H "X-CSRF-Token: $(grep trustivan_csrf cookies.txt | awk '{print $7}')" \
  -d '{
        "name": "appsec-jira",
        "channel": "jira",
        "url": "https://acme.atlassian.net",
        "secret": "…",
        "config": {
          "email": "svc-trustivan@acme.com",
          "project_key": "SEC",
          "issue_type": "Bug"
        },
        "events": ["finding.state_changed", "verdict.recorded"],
        "min_severity": "high",
        "only_blocking": false
      }'
```

| Field | Effect |
|---|---|
| `events` | Required. Which events this destination subscribes to, from the `events` list above |
| `min_severity` | Nothing below this severity is sent: `critical`, `high`, `medium`, `low` or `info`. Leave it out for no severity filter |
| `only_blocking` | Only notifications that stop a deployment. A completed scan never does, so with this set the destination receives verdicts and nothing else |

The response returns the destination with `configured: true` and never the
secret. A name already in use, or a twenty-first destination, is `409`.

### Confirm it delivers

```bash
curl -s -X POST "https://app.trustivan.com/api/v1/notification-targets/$TARGET_ID/test" \
  -b cookies.txt \
  -H "X-CSRF-Token: $(grep trustivan_csrf cookies.txt | awk '{print $7}')"
```

The test answers `202`: it queues a sample message through the same worker and
the same outbound checks a real one takes. Read the outcome a few seconds
later:

```bash
curl -s "https://app.trustivan.com/api/v1/notification-targets/$TARGET_ID" -b cookies.txt \
  | jq '.target | {enabled, last_success_at, last_failure_at, last_error, consecutive_failures}'
```

<Warning>
  Each channel is verified against recorded fixtures of the vendor's published
  API, not against a live vendor account. Treat a new destination as
  unconfirmed until a test has moved `last_success_at`.
</Warning>

The `email` destination cannot be tested this way (`400`): its relay is
configured by whoever operates the deployment. A destination that is switched
off is refused the same way.

## Change, pause or remove a destination

| To | Request |
|---|---|
| Pause it | `PATCH /api/v1/notification-targets/{id}` with `{"enabled": false}`. Nothing else has to be restated |
| Change its filters or settings | `PATCH` with the fields to change. The `channel` cannot change; a different tool is a new destination |
| Replace its credential | `POST /api/v1/notification-targets/{id}/rotate-secret` with `{"secret": "…"}` |
| Remove it | `DELETE /api/v1/notification-targets/{id}`. Messages still queued for it go with it |

Replacing a credential takes effect immediately, with no overlap window, and
is never blocked by your plan: a leaked token has to be replaceable whatever
your billing state.

## Which destinations close what they open

`pagerduty`, `jira` and `servicenow` create a record keyed to the finding and
close it when the finding is resolved. The other five send a message and
nothing follows it. [Integrations overview](/integrations/overview#notification-destinations)
explains the difference.

## See also

- Step-by-step recipes for [Slack](/integrations/slack),
  [Microsoft Teams](/integrations/microsoft-teams),
  [PagerDuty](/integrations/pagerduty) and [Jira](/integrations/jira)
- [Webhooks](/integrations/webhooks): the signed envelope, when you want to
  write the receiver yourself.
- [Verify a webhook signature](/how-to/verify-webhooks)
