Notifications
Alert channels and browser push subscriptions.
A channel is a webhook (Slack, Discord, a generic URL) with its own set of subscribed alerts. Channels are JSON in and out: the shape is the one the dashboard's channel editor saves, and the webhook URL is the credential for the room it posts in, so reading channels needs manage_notifications.
Channels
notificationChannels
Any signed-in principal. Returns JSON.
The active team's configured channels, each with its own subscribed alerts. Needs manage_notifications: a channel carries the webhook URL, which is the credential for the room it posts in, so an API token reads it masked. Saving the mask back keeps the stored URL.
query {
notificationChannels
}saveNotificationChannel
Any signed-in principal. Returns JSON.
Create a channel (omit id) or replace one. Returns the saved channel.
| Argument | Type | Description |
|---|---|---|
id | ID | |
input | JSON! |
mutation {
saveNotificationChannel(
input: { kind: "slack", name: "#deploys", enabled: true, url: "https://hooks.slack.com/services/…", alerts: ["deployment_failed", "backup_failed"] }
)
}testNotificationChannel
Any signed-in principal. Returns Boolean.
Send a one-off test alert through one channel, using its saved config.
| Argument | Type | Description |
|---|---|---|
id | ID! |
mutation {
testNotificationChannel(id: "chan_9f1c2ab7d3e4f5a6")
}deleteNotificationChannel
Any signed-in principal. Returns Boolean.
Remove a channel. Its subscribed alerts go with it.
| Argument | Type | Description |
|---|---|---|
id | ID! |
mutation {
deleteNotificationChannel(id: "chan_9f1c2ab7d3e4f5a6")
}Browser push
webPushPublicKey
Any signed-in principal. Returns String.
This instance's VAPID public key, minted on first use. Public by design.
query {
webPushPublicKey
}subscribeWebPush
Any signed-in principal. Returns Boolean.
Register this browser for push alerts in the active team.
| Argument | Type | Description |
|---|---|---|
auth | String! | |
endpoint | String! | |
p256dh | String! |
mutation {
subscribeWebPush(endpoint: "https://push.example.com/send/abc", p256dh: "BNc…", auth: "k8s…")
}unsubscribeWebPush
Any signed-in principal. Returns Boolean.
Forget this browser's push registration.
| Argument | Type | Description |
|---|---|---|
endpoint | String! |
mutation {
unsubscribeWebPush(endpoint: "https://push.example.com/send/abc")
}See also
Did this page help you?