import requests
url = "https://platform.ankra.app/api/v1/org/notifications/routes"
payload = { "destination_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({destination_id: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/notifications/routes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/notifications/routes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination_id": "<string>"
}
'{
"id": "<string>",
"organisation_id": "<string>",
"kind": "<string>",
"kinds": [
"<string>"
],
"kinds_negated": true,
"severity": "<string>",
"cluster_id": "<string>",
"source_id": "<string>",
"application_id": "<string>",
"reference_pattern": "<string>",
"project_id": "<string>",
"destination_id": "<string>",
"priority": 123,
"stop_on_match": true,
"mode": "<string>",
"enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"scope_note": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create a notification route
Creates a routing rule that sends matching notifications to a destination: an alert integration (webhook or channel) or a push audience of organisation members. Answers 404 when the destination, a named member or cluster_id does not belong to the organisation, and 404 Source not found when a caller confined to a project names a source_id a route would withhold from it. A source_id longer than 512 bytes or carrying more than 4 uuids answers 422.
import requests
url = "https://platform.ankra.app/api/v1/org/notifications/routes"
payload = { "destination_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({destination_id: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/notifications/routes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/notifications/routes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination_id": "<string>"
}
'{
"id": "<string>",
"organisation_id": "<string>",
"kind": "<string>",
"kinds": [
"<string>"
],
"kinds_negated": true,
"severity": "<string>",
"cluster_id": "<string>",
"source_id": "<string>",
"application_id": "<string>",
"reference_pattern": "<string>",
"project_id": "<string>",
"destination_id": "<string>",
"priority": 123,
"stop_on_match": true,
"mode": "<string>",
"enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"scope_note": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
Only notifications whose source_id is exactly this text. At delivery today a notification's source_id is the id of the alert that fired, so a source filter matches an alert's id and nothing else. Null or a blank string is no source filter, and a blank is never stored as one. A source_id is at most 512 bytes and carries at most 4 uuids: a longer one, or one with more uuids, answers 422. A caller confined to a project may not name a source_id a route would withhold from it (NotificationRoute.source_id says which): that answers 404 Source not found, as the preview does.
Only notifications about a branch, tag or pull request matching this glob (data.reference): main or refs/heads/main for the main branch, release/* within one path segment, release/** across segments, pull/* for every pull request, refs/tags/v* for tags. A pull request targeting main does not match main. Null matches every reference.
255Response
Successful Response
Only notifications whose source_id is exactly this text; null matches every source. At delivery today a notification's source_id is the id of the alert that fired, so a source filter matches an alert's id and nothing else. A caller confined to a project reads a source_id as null, and the route then carries scope_note, when any id in it, the whole source_id or one part of a composite one such as <cluster>/<node group> or <repository>:<ref>, names a cluster, application, ticket, pipeline run or step, pipeline repository, automation, workspace, incident, environment or API token of another project or of no project, an execution, power schedule, application installation, sandbox environment, agent task or support ticket on such a cluster, or an alert a rule of which names a cluster outside the caller's project, or that is deleted; and when it is longer than 512 bytes or carries more than 4 uuids, which no write accepts any more. Any other source_id is shown as written. The note names no id, but it does tell the reader that an id it already holds is outside its project, as a 404 Source not found from the preview or a route write does.
Only notifications about a branch, tag or pull request matching this glob (data.reference): main or refs/heads/main for the main branch, release/* within one path segment, release/** across segments, pull/* for every pull request, refs/tags/v* for tags. A pull request targeting main does not match main. Null matches every reference. It is shown as written to every caller, one confined to a project included: no project holds a glob over branch and tag names.
255The project the route is pinned to: it delivers only that project's notifications, read from the ticket, application, pipeline run, repository, automation, workspace, incident, environment or cluster the notification is about. Null is organisation-wide: the route hears every project's notifications and the organisation's own.