Add a notification target to a service.
const url = 'https://api.siteqwality.com/service/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/notification_target';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"slack_channel","details":"example","confirm_external_recipients":true,"integration_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","min_severity":"minor","events":["example"]}'};
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.siteqwality.com/service/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/notification_target \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "slack_channel", "details": "example", "confirm_external_recipients": true, "integration_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "min_severity": "minor", "events": [ "example" ] }'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Service identifier
Request Body required
Section titled “Request Body required ”object
Required (true) for an email target with an address outside the members’ domains;
without it that target answers 409 email_target_confirmation_required.
Send with this connected integration instead of a pasted token or URL: a Slack integration for
slack_channel (details {channel}), a webhook integration for webhook (details {}).
Only these lifecycle events: incident_opened, incident_acknowledged, incident_updated,
incident_resolved, incident_reopened, incident_merged, incident_service_changed.
Responses
Section titled “ Responses ”Notification target created. A pasted-URL webhook target carries its signing_secret here, once
object
Stored details with a webhook URL cut to its host; a Slack token reads
back as has_token: true.
The connected integration this target sends with, when it uses one.
The lifecycle events this target takes; absent takes every one.
A pasted-URL webhook’s signing secret, returned once on create and never again.
Example
{ "type": "slack_channel", "min_severity": "minor"}Invalid request body, an unknown event, or an integration that cannot back this target type
Missing or invalid authentication
Service or integration not found
The service has 20 targets (service_target_limit_reached), or an email address outside the members’ domains needs confirm_external_recipients (email_target_confirmation_required)
Internal server error