curl --request PUT \
--url https://{host}/api/notification/public/v1/channels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"subscriptions": [
{
"alert_type": "break_glass_used"
},
{
"alert_type": "policy_changed"
}
],
"type": "webhook",
"url": "https://hooks.example.com/barndoor"
}
'import requests
url = "https://{host}/api/notification/public/v1/channels"
payload = {
"enabled": True,
"subscriptions": [{ "alert_type": "break_glass_used" }, { "alert_type": "policy_changed" }],
"type": "webhook",
"url": "https://hooks.example.com/barndoor"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
subscriptions: [{alert_type: 'break_glass_used'}, {alert_type: 'policy_changed'}],
type: 'webhook',
url: 'https://hooks.example.com/barndoor'
})
};
fetch('https://{host}/api/notification/public/v1/channels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/notification/public/v1/channels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'subscriptions' => [
[
'alert_type' => 'break_glass_used'
],
[
'alert_type' => 'policy_changed'
]
],
'type' => 'webhook',
'url' => 'https://hooks.example.com/barndoor'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/notification/public/v1/channels"
payload := strings.NewReader("{\n \"enabled\": true,\n \"subscriptions\": [\n {\n \"alert_type\": \"break_glass_used\"\n },\n {\n \"alert_type\": \"policy_changed\"\n }\n ],\n \"type\": \"webhook\",\n \"url\": \"https://hooks.example.com/barndoor\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{host}/api/notification/public/v1/channels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"subscriptions\": [\n {\n \"alert_type\": \"break_glass_used\"\n },\n {\n \"alert_type\": \"policy_changed\"\n }\n ],\n \"type\": \"webhook\",\n \"url\": \"https://hooks.example.com/barndoor\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/notification/public/v1/channels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"subscriptions\": [\n {\n \"alert_type\": \"break_glass_used\"\n },\n {\n \"alert_type\": \"policy_changed\"\n }\n ],\n \"type\": \"webhook\",\n \"url\": \"https://hooks.example.com/barndoor\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "in_app",
"enabled": true,
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email_address": "<string>",
"url": "<string>",
"label": "<string>",
"slack_channel_id": "<string>",
"subscriptions": [
{
"alert_type": "llm_threshold_exceeded"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"has_signing_secret": false,
"has_workflow_url": false,
"signing_secret": "<string>"
}Create or update a notification channel
Upserts one channel and replaces its subscription set.
Without id, the channel is keyed on its type’s natural identity, so an identical call is idempotent rather than duplicating: email by address, webhook by URL, slack by channel id, personal types by (organization, type, caller). With id it is an authoritative edit of that row — the only way to update a teams channel, whose natural identity is a secret URL.
subscriptions is replaced wholesale, not merged: send the complete desired set, and expect an omitted list to unsubscribe the channel from everything.
Creating a webhook channel reveals its signing secret in signing_secret ONCE; it is not readable afterwards. The secret is only generated when the row is new, so a retried create that lands after the first succeeded returns signing_secret: null. If you need a secret and got null, call POST /channels/{channel_id}/regenerate-secret.
curl --request PUT \
--url https://{host}/api/notification/public/v1/channels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"subscriptions": [
{
"alert_type": "break_glass_used"
},
{
"alert_type": "policy_changed"
}
],
"type": "webhook",
"url": "https://hooks.example.com/barndoor"
}
'import requests
url = "https://{host}/api/notification/public/v1/channels"
payload = {
"enabled": True,
"subscriptions": [{ "alert_type": "break_glass_used" }, { "alert_type": "policy_changed" }],
"type": "webhook",
"url": "https://hooks.example.com/barndoor"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
subscriptions: [{alert_type: 'break_glass_used'}, {alert_type: 'policy_changed'}],
type: 'webhook',
url: 'https://hooks.example.com/barndoor'
})
};
fetch('https://{host}/api/notification/public/v1/channels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/notification/public/v1/channels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'subscriptions' => [
[
'alert_type' => 'break_glass_used'
],
[
'alert_type' => 'policy_changed'
]
],
'type' => 'webhook',
'url' => 'https://hooks.example.com/barndoor'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/notification/public/v1/channels"
payload := strings.NewReader("{\n \"enabled\": true,\n \"subscriptions\": [\n {\n \"alert_type\": \"break_glass_used\"\n },\n {\n \"alert_type\": \"policy_changed\"\n }\n ],\n \"type\": \"webhook\",\n \"url\": \"https://hooks.example.com/barndoor\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{host}/api/notification/public/v1/channels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"subscriptions\": [\n {\n \"alert_type\": \"break_glass_used\"\n },\n {\n \"alert_type\": \"policy_changed\"\n }\n ],\n \"type\": \"webhook\",\n \"url\": \"https://hooks.example.com/barndoor\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/notification/public/v1/channels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"subscriptions\": [\n {\n \"alert_type\": \"break_glass_used\"\n },\n {\n \"alert_type\": \"policy_changed\"\n }\n ],\n \"type\": \"webhook\",\n \"url\": \"https://hooks.example.com/barndoor\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "in_app",
"enabled": true,
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email_address": "<string>",
"url": "<string>",
"label": "<string>",
"slack_channel_id": "<string>",
"subscriptions": [
{
"alert_type": "llm_threshold_exceeded"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"has_signing_secret": false,
"has_workflow_url": false,
"signing_secret": "<string>"
}Authorizations
Scopes
Body
Create or update one notification channel and replace its subscription set.
This is a full upsert, not a patch: subscriptions is replaced by what you send, so
omitting it removes every subscription the channel had. Send the complete desired set on
every call — which is what makes the endpoint safe to drive from a declarative tool.
Which fields are permitted depends on type; sending one that does not belong to the
type is a 422, not a silently ignored field. See ChannelType for the full matrix.
type | required | forbidden |
|---|---|---|
in_app / user_email | — | every destination field |
email | email_address | url, label, slack_channel_id, teams_workflow_url |
webhook | url | email_address, label, slack_channel_id, teams_workflow_url |
slack | slack_channel_id, label | email_address, url, teams_workflow_url |
teams | label (+ teams_workflow_url on create) | email_address, url, slack_channel_id |
Identity. Without id the channel is keyed on its type's natural identity, so
repeating the same call is idempotent rather than creating duplicates: personal types by
(organization, type, caller), email by (organization, email_address), webhook by
(organization, url), slack by (organization, slack_channel_id). With id it is
an authoritative edit of that row — the only way to change a teams channel, whose
natural identity is a secret URL you never hold back.
The kind of destination, and the discriminator for every other field. Immutable in practice: an edit-by-id that changes type is rejected, and an upsert without id and a different type addresses a different natural identity, so it creates a separate channel.
in_app, user_email, email, webhook, slack, teams Destination address for type: email. Any deliverable address — a team alias or a ticketing inbox, not necessarily a platform user. Validated and normalized; also the channel's natural identity, so reusing an address updates that channel. Forbidden on every other type.
Destination endpoint for type: webhook. Must be https and must resolve to a public address — private, loopback, link-local, and cloud-metadata targets are rejected with a 422 naming the reason. Also the channel's natural identity. Forbidden on every other type.
"https://hooks.example.com/barndoor"
Microsoft Teams Workflows incoming-webhook URL for type: teams. Write-only: it is stored as a secret and never returned by any endpoint — reads expose only has_workflow_url. Required on create, optional on edit-by-id (omit to keep the stored URL). Must be https, resolve to a public address, and sit on the Power Automate host allowlist. Forbidden on every other type.
Response
Successful Response
A channel and its subscriptions. Secrets (webhook signing secret, slack bot token) live
in OpenBao and are never surfaced here except as a one-time reveal via signing_secret,
populated only on the response to the request that just generated it (webhook create or
regenerate); slack channels expose only the non-secret label + slack_channel_id.
One-time reveal of a newly generated webhook signing secret. Present only on the response to the request that created it — the PUT that first creates a webhook channel — and null on every list or subsequent read. Store it when you receive it; the only way to recover from losing it is to rotate.