# Create a notification destination

> Source: https://elaichi.ai/docs/api-reference/notification-destinations/notification-destination/createorgnotificationdestination/

`POST /notification-destination`

Resource: **Notification Destination** · API: **Notification destinations**

## Request body

- **`type`** _(string)_
  Immutable after creation.
  Allowed: `slack`, `email`
- **`name`** _(string)_
- **`is_active`** _(boolean)_
- **`config`** _(object)_
  Non-secret settings. `to`/`cc`/`bcc` apply to `email`; ignored for `slack`.
  - **`to`** _(array<string>)_
  - **`cc`** _(array<string>)_
  - **`bcc`** _(array<string>)_
  - **`subject_prefix`** _(string)_
- **`webhook_url`** _(string)_
  Slack incoming-webhook URL. Ignored for `type: "email"`.
- **`event_types`** _(array<string>)_

## Response body

- **`id`** _(string)_
  Notification destination id (`onfd_…`).
- **`type`** _(string)_
  Immutable after creation.
  Allowed: `slack`, `email`
- **`name`** _(string)_
- **`is_active`** _(boolean)_
  Paused destinations keep their config but forward nothing.
- **`config`** _(object)_
  Non-secret settings. `to`/`cc`/`bcc` apply to `email`; ignored for `slack`.
  - **`to`** _(array<string>)_
  - **`cc`** _(array<string>)_
  - **`bcc`** _(array<string>)_
  - **`subject_prefix`** _(string)_
- **`event_types`** _(array<string>)_
  Fixed catalog of org events this destination is subscribed to.
- **`last_test_at`** _(string,null)_
- **`last_test_status`** _(string,null)_
  Allowed: `ok`, `failed`, `null`
- **`created_by_user_id`** _(string,null)_
- **`created_at`** _(string)_
- **`updated_at`** _(string)_

## Code examples

### curl

```bash
curl -X POST 'https://api.elaichi.ai/notification-destination' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"type":"slack","name":"your_name","is_active":true,"config":{},"webhook_url":"your_webhook_url","event_types":[]}'
```

### JavaScript

```javascript
const body = {
  "type": "slack",
  "name": "your_name",
  "is_active": true,
  "config": {},
  "webhook_url": "your_webhook_url",
  "event_types": []
};

const response = await fetch('https://api.elaichi.ai/notification-destination', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import os
import requests

url = "https://api.elaichi.ai/notification-destination"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}
payload = {
    "type": "slack",
    "name": "your_name",
    "is_active": True,
    "config": {},
    "webhook_url": "your_webhook_url",
    "event_types": []
}

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