> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hookstream.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Notification Channels

Configure where alert notifications are sent (webhook, Slack, Discord, or email).

Notification channels define where alerts are delivered. hookstream supports four channel types: **webhook** (with optional HMAC signing), **Slack**, **Discord**, and **email**. When an alert rule triggers, hookstream sends a notification to each configured channel with the alert details.

## List Channels

GET `/v1/notification-channels`

List all notification channels.

**Authentication:** API key or session cookie.

```json 200 OK
{
  "channels": [
    {
      "id": "nc_a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
      "name": "Ops Slack",
      "type": "webhook",
      "config": {
        "url": "https://hooks.slack.com/services/T.../B.../xxx"
      },
      "created_at": "2026-02-28T10:00:00Z"
    }
  ]
}
```

## Create Channel

POST `/v1/notification-channels`

Create a new notification channel.

**Authentication:** API key or session cookie.

### Body Parameters

Display name for the channel.

Channel type: `webhook`, `slack`, `discord`, or `email`.

Channel configuration. For webhook: `{ url: string, secret?: string }`. If `secret` is provided, requests are signed with HMAC-SHA256.

```bash cURL
curl -X POST https://hookstream.io/v1/notification-channels \
  -H "X-API-Key: $HOOKSTREAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Ops Slack",
    "channel_type": "webhook",
    "config": {
      "url": "https://hooks.slack.com/services/T.../B.../xxx"
    }
  }'
```

```json 201 Created
{
  "id": "nc_a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "name": "Ops Slack",
  "type": "webhook",
  "config": {
    "url": "https://hooks.slack.com/services/T.../B.../xxx"
  },
  "created_at": "2026-03-01T12:00:00Z"
}
```

## Retrieve Channel

GET `/v1/notification-channels/:id`

Get a single notification channel by ID.

**Authentication:** API key or session cookie.

```json 200 OK
{
  "id": "nc_a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "name": "Ops Slack",
  "type": "webhook",
  "config": {
    "url": "https://hooks.slack.com/services/T.../B.../xxx"
  },
  "created_at": "2026-02-28T10:00:00Z",
  "updated_at": "2026-03-01T08:00:00Z"
}
```

## Update Channel

PATCH `/v1/notification-channels/:id`

Update a notification channel.

**Authentication:** API key or session cookie.

```bash cURL
curl -X PATCH https://hookstream.io/v1/notification-channels/nc_a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2 \
  -H "X-API-Key: $HOOKSTREAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Ops PagerDuty"}'
```

```json 200 OK
{
  "id": "nc_a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "name": "Ops PagerDuty",
  "type": "webhook",
  "updated_at": "2026-03-01T15:00:00Z"
}
```

## Delete Channel

DELETE `/v1/notification-channels/:id`

Delete a notification channel. Alert rules referencing it must be updated first.

**Authentication:** API key or session cookie.

```json 200 OK
{ "deleted": true }
```

## Test Channel

POST `/v1/notification-channels/:id/test`

Send a test notification to verify the channel is working.

**Authentication:** API key or session cookie.

```bash cURL
curl -X POST https://hookstream.io/v1/notification-channels/nc_a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2/test \
  -H "X-API-Key: $HOOKSTREAM_API_KEY"
```

```json 200 OK
{ "success": true, "error": null }
```