---
title: "Create a notification destination"
method: POST
path: "/notification-destination"
tags: ["Notification destinations"]
---

# Create a notification destination

`POST /notification-destination`

## Request

- Base URL: `https://api.elaichi.ai`
- URL: `https://api.elaichi.ai/notification-destination`
- Auth: HTTP bearer

Creates a notification destination (Slack or email). Requires `notification:manage`. `slack` requires `webhook_url`; `email` requires `config.to`. Verify delivery with `POST /notification-destination/{id}/test` before relying on it.

## Headers

- `X-Organization-Id` string

## Request body

- object
  - `type` 'slack' | 'email', required: Immutable after creation.
  - `name` string, required
  - `is_active` boolean
  - `config` object: Non-secret settings. `to`/`cc`/`bcc` apply to `email`; ignored for `slack`.
    - `to` string[]
    - `cc` string[]
    - `bcc` string[]
    - `subject_prefix` string
  - `webhook_url` string: Slack incoming-webhook URL. Ignored for `type: "email"`.
  - `event_types` string[]

## Response `201`

Created

- object: Where org notification events are sent. The Slack webhook URL is write-only and never appears in any response.
  - `id` string: Notification destination id (`onfd_…`).
  - `type` 'slack' | 'email': Immutable after creation.
  - `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` string[]
    - `cc` string[]
    - `bcc` string[]
    - `subject_prefix` string
  - `event_types` string[]: Fixed catalog of org events this destination is subscribed to.
  - `last_test_at` string, date-time, nullable
  - `last_test_status` 'ok' | 'failed' | 'null', nullable
  - `created_by_user_id` string, nullable
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `429`: Rate limited

---

[API](https://skmtc.dev/elaichi/apis/elaichi-api.md) · [All operations](https://skmtc.dev/elaichi/apis/elaichi-api/llms.txt) · [OpenAPI document](https://skmtc.dev/elaichi/apis/elaichi-api/revisions/b22cfb7b6d15?raw)
