Create a notification target
POST
/v1/notificationtarget/
const url = 'https://example.com/v1/notificationtarget/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"display_name":"example","target":"example","time_from":"example","time_to":"example","notify_on_monday":true,"notify_on_tuesday":true,"notify_on_wednesday":true,"notify_on_thursday":true,"notify_on_friday":true,"notify_on_saturday":true,"notify_on_sunday":true,"notify_on_ok":true,"notify_on_warning":true,"notify_on_critical":true,"integration":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","rules":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"contactsgroups":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"private_target":true,"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://example.com/v1/notificationtarget/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "display_name": "example", "target": "example", "time_from": "example", "time_to": "example", "notify_on_monday": true, "notify_on_tuesday": true, "notify_on_wednesday": true, "notify_on_thursday": true, "notify_on_friday": true, "notify_on_saturday": true, "notify_on_sunday": true, "notify_on_ok": true, "notify_on_warning": true, "notify_on_critical": true, "integration": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rules": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "contactsgroups": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "private_target": true, "enabled": true }'Create a new notification target.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”A ModelSerializer that takes an additional fields argument that
controls which fields should be displayed.
object
id
required
string format: uuid
display_name
required
string
target
string
time_from
string format: time
time_to
string format: time
notify_on_monday
boolean
notify_on_tuesday
boolean
notify_on_wednesday
boolean
notify_on_thursday
boolean
notify_on_friday
boolean
notify_on_saturday
boolean
notify_on_sunday
boolean
notify_on_ok
boolean
notify_on_warning
boolean
notify_on_critical
boolean
integration
required
string format: uuid
rules
Array<string>
contactsgroups
Array<string>
last_error_message
required
string
private_target
boolean
oncall_count
required
integer
enabled
boolean
Examplegenerated
{ "display_name": "example", "target": "example", "time_from": "example", "time_to": "example", "notify_on_monday": true, "notify_on_tuesday": true, "notify_on_wednesday": true, "notify_on_thursday": true, "notify_on_friday": true, "notify_on_saturday": true, "notify_on_sunday": true, "notify_on_ok": true, "notify_on_warning": true, "notify_on_critical": true, "integration": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rules": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "contactsgroups": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "private_target": true, "enabled": true}A ModelSerializer that takes an additional fields argument that
controls which fields should be displayed.
object
id
required
string format: uuid
display_name
required
string
target
string
time_from
string format: time
time_to
string format: time
notify_on_monday
boolean
notify_on_tuesday
boolean
notify_on_wednesday
boolean
notify_on_thursday
boolean
notify_on_friday
boolean
notify_on_saturday
boolean
notify_on_sunday
boolean
notify_on_ok
boolean
notify_on_warning
boolean
notify_on_critical
boolean
integration
required
string format: uuid
rules
Array<string>
contactsgroups
Array<string>
last_error_message
required
string
private_target
boolean
oncall_count
required
integer
enabled
boolean
Responses
Section titled “Responses”Media typeapplication/json
A ModelSerializer that takes an additional fields argument that
controls which fields should be displayed.
object
id
required
string format: uuid
display_name
required
string
target
string
time_from
string format: time
time_to
string format: time
notify_on_monday
boolean
notify_on_tuesday
boolean
notify_on_wednesday
boolean
notify_on_thursday
boolean
notify_on_friday
boolean
notify_on_saturday
boolean
notify_on_sunday
boolean
notify_on_ok
boolean
notify_on_warning
boolean
notify_on_critical
boolean
integration
required
string format: uuid
rules
Array<string>
contactsgroups
Array<string>
last_error_message
required
string
private_target
boolean
oncall_count
required
integer
enabled
boolean
Examplegenerated
{ "display_name": "example", "target": "example", "time_from": "example", "time_to": "example", "notify_on_monday": true, "notify_on_tuesday": true, "notify_on_wednesday": true, "notify_on_thursday": true, "notify_on_friday": true, "notify_on_saturday": true, "notify_on_sunday": true, "notify_on_ok": true, "notify_on_warning": true, "notify_on_critical": true, "integration": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rules": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "contactsgroups": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "private_target": true, "enabled": true}