---
sidebar_label: Set up approval notifications
doc_id: 476f6b9a-5017-43ce-8963-c68624995605
description: >-
  Configure Slack and HTTP notifications for approval requests in Nullplatform
  to keep teams informed.
keywords:
  - notifications
  - approvals
  - Slack integration
  - nullplatform
  - webhook
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Set up approval notifications

To keep the right people informed about approval requests, set up notifications. Nullplatform supports Slack and HTTP notifications for approvals.

:::info
This page covers approval-specific notification setup. For the complete channel types reference, lifecycle management, and troubleshooting, see the [Notifications documentation](/docs/notifications).
:::

### Slack

To receive notifications on Slack, follow these steps:

1. Install nullplatform's Slack application. 

   Go to `https://<your-org-slug>.app.nullplatform.io/integration` and click **Connect Slack** to authorize the application.

2. Go to Slack and add the nullplatform application to the channels. You can use the `/invite @nullplatform` command.

3. Send a [POST request](/docs/api/notification-channel-create) to create your notification channel.

  :::tip
  Set up a notification channel for the entire organization to ensure that notifications always reach a channel.
  :::

#### Example request:

<Tabs
defaultValue="channel-cli"
values={[
{ label: 'CLI', value: 'channel-cli' },
{ label: 'cURL', value: 'channel-curl' },
]}>

<TabItem value="channel-cli">

```bash
np notification channel create
  --body '{
    "nrn": "organization=1",
    "description": "My Slack channel for approval notifications",
    "source": ["approval"],
    "type": "slack",
    "configuration": {
          "channels": ["my-organization-private-channel"]
        },
    "filters": {
      "action": "deployment:create"
    }
  }'
```

</TabItem>
<TabItem value="channel-curl">

```bash
curl -L 'https://api.nullplatform.com/notification/channel' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
    "nrn": "organization=1",
    "description": "My Slack channel for approval notifications",
    "source": ["approval"],
    "type": "slack",
    "configuration": {
          "channels": ["my-organization-private-channel"]
        },
    "filters": {
      "action": "deployment:create"
    }
}'
```
</TabItem>
</Tabs>




To notify specific teams, configure channels for namespaces, accounts, or other resources. For example:

```bash
{
  "nrn": "organization=1:account=2:namespace=3",
  "source": ["approval"],
  "type": "slack",
  "configuration": {
        "channels": ["my-namespace-private-channel"]
      },
  "filters": {
    "action": "deployment:create"
  }
}
```
:::note Request details

  - `nrn`: The NRN identifies the organization for which the notification channel is being created.
  - `source`: This specifies the source of the notifications. Here, the source is `approval`, meaning the channel will receive notifications related to approval requests.
  - `type`: This defines the type of notification channel. It can be either `slack` or `http` for approvals.
  - `configuration`: This field contains configuration details specific to the notification channel type.
  - `filters`: An optional field that allows notifications to be filtered based on custom criteria.
:::

Once configured, you’ll receive Slack messages to approve or deny requests.

Here's an example:

<img alt="Slack notification" src="/img/approvals/slack-new-deployment.png" width="100%" className="helper-image" />

## Configure an HTTP notification channel

HTTP notifications allow systems to programmatically respond to approval requests. To set this up, send a [POST request](/docs/api/notification-channel-create) with the endpoint details.

#### Example request


<Tabs
defaultValue="channel-cli"
values={[
{ label: 'CLI', value: 'channel-cli' },
{ label: 'cURL', value: 'channel-curl' },
]}>

<TabItem value="channel-cli">

```bash
np notification channel create
  --body '{
    "nrn": "organization=1",
    "description": "My HTTP channel for approval notifications",
    "source": ["approval"],
    "type": "http",
    "configuration": {
        "url": "https://yourdomain.com/url-you-configured",
        "headers": {
            "Authorization": "Bearer the-token"
        }
    },
    "filters": {
      "action": "deployment:create"
    }
  }'
```
</TabItem>
<TabItem value="channel-curl">

```bash
curl -L 'https://api.nullplatform.com/notification/channel' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
    "nrn": "organization=1",
    "description": "My HTTP channel for approval notifications",
    "source": ["approval"],
    "type": "http",
    "configuration": {
        "url": "https://yourdomain.com/url-you-configured",
        "headers": {
            "Authorization": "Bearer the-token"
        }
    },
    "filters": {
      "action": "deployment:create"
    }
}'
```
</TabItem>
</Tabs>


After setting up your custom notification channel, you'll start receiving requests like these:

```json
{
  "id": 12,
  "source": "approval",
  "created_at": "2022-12-19T20:37:42.109Z",
  "notification": {
      "approval_id": 1234,
      "approve_url": "https://api.nullplatform.com/approval/1234/approve?token=the-token",
      "deny_url": "https://api.nullplatform.com/approval/1234/deny?token=the-token",
      "requested_by": {
        "user_id": 1,
        "email": "alex.doe.developer@yourdomain.com",
        "first_name": "alex",
        "last_name": "doe",
        "avatar": null
      },
      "action": "deployment:create",
      "details": {...}
  }
}
```

:::info 
See examples of context details for approvals in our [Event payloads docs](/docs/notifications/event-payloads#approvals). 
:::

#### Responding to HTTP notifications

After evaluating an approval request, respond by approving or denying it based on the policy conditions. Use the provided `approve_url` or `deny_url` and include relevant details in your response.

Here’s an example of how to deny an approval due to policy violations:


```bash
curl -L 'https://api.nullplatform.com/approval/:id/deny' \
-H 'Content-Type: application/json' \
--data-raw '{
  "reviewer": {
    "name": "Deployments Review Team",
    "email": "reviewer@yourdomain.com",
    "nullplatform_user_id": null
  },
  "message": "Approval denied due to policy conditions not being met.",
  "details": {
    "restriction_reason": "Security policy violation: The number of security issues exceeds the allowed threshold.",
    "expected_max_security_issues": 4,
    "actual_security_issues": 6,
    "policy_name": "Enforce coverage, security, and scaling for deployments"
  }
}'
```



:::note Request details

  - `reviewer`: Information about the decision maker (name, email, and optional user ID).
  - `message`: A short explanation for the decision.
  - `details`: Additional context for the decision.


  All fields are **optional**, but including them can help provide clarity to the requester in the platform.
:::

:::info 
For more details on notifications, refer to the [Notifications](/docs/notifications) docs.
:::

## What's next

Now that you've set up your notification channel, learn how [approval requests progress through statuses](/docs/approvals/approval-requests) — from pending through review, approval, and execution.
