const url = 'https://api.channelautomation.com/api/notification-alerts';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json', 'X-API-Key': '<X-API-Key>'},
body: JSON.stringify({
name: 'string',
alert_type: 'string',
description: 'string',
threshold: 0,
window_minutes: 0,
cooldown_minutes: 0,
webhook_url: 'string',
enabled: true
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));