---
title: "Slack"
description: "Post TRUSTIVAN alerts to a Slack channel through an incoming webhook: new critical findings, blocking verdicts, SLA breaches and finding changes."
---

TRUSTIVAN posts to Slack through a Slack **incoming webhook**. It is not a Slack
app: there is no slash command, no buttons, and nothing in Slack can change a
finding. Each message is plain text with a link back to the asset in TRUSTIVAN.

There are two ways to set it up, and they can run side by side:

| | Alert settings | A notification destination |
|---|---|---|
| Set up in | **Settings → Notifications** in the dashboard | The API, `POST /api/v1/notification-targets` |
| Events | New critical or high findings on a scan, a blocking verdict, findings past their SLA deadline | Any subscribable event, including finding status changes and NHI Security events, filtered by severity |
| How many | One Slack webhook per organization | Up to 20 destinations of any kind per organization |

## Prerequisites

- **A Slack incoming webhook URL.** In Slack, create an app for your workspace
  (or open an existing one), turn on **Incoming Webhooks**, choose **Add New
  Webhook to Workspace** and pick the channel. The URL starts with `https://`.
  It is the credential: anyone holding it can post to that channel.
- **An administrator of the TRUSTIVAN organization**, signed in. Changing
  notifications needs `webhooks:manage`, which an API key cannot hold.
- For a destination, a plan that includes webhooks.

## The quick way: Settings → Notifications

<Steps>
  <Step title="Paste the URL">
    **Settings → Notifications**, then paste the incoming webhook URL. It is
    stored encrypted and never shown again.
  </Step>
  <Step title="Choose the events">
    Choose which alerts post to Slack. A scan is announced only when it found
    new critical or high findings, and a verdict only when it blocks a
    deployment.
  </Step>
</Steps>

## The flexible way: a destination

Use a destination when you want finding status changes, NHI Security events,
a severity floor, or a second channel. Sign in with `curl` first so
`cookies.txt` holds the session (see the [quickstart](/getting-started/quickstart)).

```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-slack",
        "channel": "slack",
        "secret": "https://hooks.slack.com/services/…",
        "events": ["verdict.recorded", "finding.state_changed", "finding.sla_breached"],
        "min_severity": "high"
      }'
```

The webhook URL goes in `secret`, not `url`, so it is stored encrypted. A Slack
destination takes no `config`; sending any is a `400`. The URL must be
`https://`.

Send a test message, then read whether it arrived:

```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}')"

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

## What it posts

- **Plain text.** `<`, `>` and `&` in a finding title or an asset name are
  escaped, so a title containing `<!channel>` cannot notify a whole channel.
- **One message per event.** Slack keeps no record that TRUSTIVAN can update,
  so a finding that is later resolved is a second message, not an edit of the
  first.
- **A verdict has no severity**, so a `min_severity` filter never holds back a
  blocking verdict.

## Troubleshooting

| Symptom | Cause |
|---|---|
| `400` naming the URL field | The webhook URL was sent as `url`. Send it as `secret` |
| `last_error` says Slack no longer knows this webhook | The webhook was revoked in Slack (`404` or `410`). Create a new one and replace it with `POST /api/v1/notification-targets/{id}/rotate-secret` |
| `last_error` says the destination was disabled automatically | Deliveries failed repeatedly. Fix the cause, then `PATCH` it with `{"enabled": true}` |
| Nothing arrives for a scan | A scan is announced only when it found new critical or high findings |

## See also

- [Send notifications to Slack, Jira and other tools](/how-to/configure-notifications):
  every channel, field and limit
- [Microsoft Teams](/integrations/microsoft-teams)
- [Webhooks](/integrations/webhooks): the signed envelope, to write your own receiver
