Skip to main content

Create notification subscription

POST

Creates a notification subscription for the caller's environment. New subscriptions are created as active.

Request body​

FieldTypeRequiredDescription
namestringYesSubscription display name
urlstringYesHTTP or HTTPS delivery URL
filterobjectYesJSON Logic filter evaluated for each notification event
authorizationobject or nullNoOptional outbound authorization settings
authorization.typestringYes, when authorization is setSupported values: basic, bearer
authorization.tokenstringYes, when authorization.type is bearerBearer token sent to the destination
authorization.usernamestringYes, when authorization.type is basicBasic-auth username
authorization.passwordstringYes, when authorization.type is basicBasic-auth password

Filter validation​

  • filter must be valid JSON Logic
  • Only event.* and supported computed.* variables are allowed
  • Invalid body data or invalid filter expressions return 400

Response​

  • 201 Created
FieldTypeDescription
idstringNew subscription identifier
rsaKeyobjectPublic-key details for request verification
rsaKey.publicstringPublic RSA key in PEM format
xNotificationTokenstringToken used in outbound notification headers

Errors​

  • 400: invalid request body or filter definition

Example request​

{
"name": "High impact alerts",
"url": "https://example.com/notify",
"filter": {
">=": [
{
"var": "computed.impact.max_24h"
},
3
]
},
"authorization": {
"type": "bearer",
"token": "CONFIGURED_TOKEN"
}
}

Example response​

{
"id": "65f3b1d8e83b5d0a4af00c91",
"rsaKey": {
"public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBg...\n-----END PUBLIC KEY-----"
},
"xNotificationToken": "0123456789abcdef0123456789abcdef"
}