Add a notification channel
POST
/notifications/channels
const url = 'https://api.krakenkey.io/notifications/channels';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"slack","name":"Ops alerts","url":"https://hooks.slack.com/services/T000/B000/XXXX","events":["cert.issued"],"enabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.krakenkey.io/notifications/channels \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "slack", "name": "Ops alerts", "url": "https://hooks.slack.com/services/T000/B000/XXXX", "events": [ "cert.issued" ], "enabled": true }'For webhook channels the response includes the signing secret. It is shown only once.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
type
required
string
Example
slackname
required
string
Example
Ops alertsurl
required
Destination URL. Slack: an incoming webhook (https://hooks.slack.com/services/…). Teams: a Workflows webhook URL (Office 365 connectors are retired). Webhook: any https URL that resolves only to public addresses. Stored encrypted and never returned in full.
string
Example
https://hooks.slack.com/services/T000/B000/XXXXevents
Events to send. Defaults to cert.failed, cert.expiring, cert.revoked, cert.replacement_requested, domain.verification_failed, endpoint.scan_failed, deploy.failed, connector.stale.
Array<string>
enabled
boolean
Responses
Section titled “Responses”Channel created
Invalid URL, unknown event or channel limit reached