createNotificationWebhook
POST
/api/v1/notifications/webhooks
const url = 'https://example.com/api/v1/notifications/webhooks';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"name":"example","url":"https://example.com","categories":["incident"]}'};
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://example.com/api/v1/notifications/webhooks \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "url": "https://example.com", "categories": [ "incident" ] }'Create a notification webhook. Requires an Owner or Administrator with the admin scope. Cookie-authenticated unsafe requests require X-CSRF-Token.
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters”X-CSRF-Token
string
Cookie-backed browser requests only, and only on unsafe methods. Bearer grants never send it.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
url
required
string format: uri
categories
Array<string>
Responses
Section titled “ Responses ”Notification webhook created
Media typeapplication/json
object
data
required
The signing secret is returned exactly once. There is no endpoint that reads it back.
object
webhook
required
object
id
required
string format: uuid
name
required
string
url
required
string format: uri
enabled
required
boolean
categories
required
Array<string>
lastAttemptAt
string format: date-time
lastSuccessAt
string format: date-time
lastError
string
createdAt
required
string format: date-time
signingSecret
required
string
secretNotice
required
string
Example
{ "data": { "webhook": { "categories": [ "incident" ] } }}Invalid webhook
Dashboard authentication required
Insufficient role