---
title: "Create a notification alert rule"
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Notifications

`POST /api/notification-alerts`

## Authentication

- `ApiKeyAuth`, apiKey, in header, header `X-API-Key`, format `API_KEY`

## Request body

_Required._

- `name` (`post/api/notification-alerts.name`; string, required)
- `alert_type` (`post/api/notification-alerts.alert_type`; string, optional)
- `description` (`post/api/notification-alerts.description`; string, optional)
- `threshold` (`post/api/notification-alerts.threshold`; integer, optional)
- `window_minutes` (`post/api/notification-alerts.window_minutes`; integer, optional)
- `cooldown_minutes` (`post/api/notification-alerts.cooldown_minutes`; integer, optional)
- `webhook_url` (`post/api/notification-alerts.webhook_url`; string, optional)
- `enabled` (`post/api/notification-alerts.enabled`; boolean, optional)

## Example request

```json
{
  "name": "string",
  "alert_type": "string",
  "description": "string",
  "threshold": 0,
  "window_minutes": 0,
  "cooldown_minutes": 0,
  "webhook_url": "string",
  "enabled": true
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.channelautomation.com/api/notification-alerts \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <X-API-Key>' \
  --data '
{
  "name": "string",
  "alert_type": "string",
  "description": "string",
  "threshold": 0,
  "window_minutes": 0,
  "cooldown_minutes": 0,
  "webhook_url": "string",
  "enabled": true
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/notification-alerts';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', 'X-API-Key': '<X-API-Key>'},
  body: JSON.stringify({
    name: 'string',
    alert_type: 'string',
    description: 'string',
    threshold: 0,
    window_minutes: 0,
    cooldown_minutes: 0,
    webhook_url: 'string',
    enabled: true
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/notification-alerts"

payload = {
    "name": "string",
    "alert_type": "string",
    "description": "string",
    "threshold": 0,
    "window_minutes": 0,
    "cooldown_minutes": 0,
    "webhook_url": "string",
    "enabled": True
}
headers = {
    "Content-Type": "application/json",
    "X-API-Key": "<X-API-Key>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

Rule created

### 400

Missing required fields


Source: https://developer.channelautomations.com/api/post-api-notification-alerts/index.md
