import requests
url = "https://platform.ankra.app/api/v1/org/notifications/routes/{route_id}"
payload = {
"kind": "<string>",
"kinds": ["<string>"],
"kinds_negated": True,
"severity": "<string>",
"cluster_id": "<string>",
"source_id": "<string>",
"application_id": "<string>",
"reference_pattern": "<string>",
"destination_id": "<string>",
"priority": 123,
"stop_on_match": True,
"mode": "<string>",
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
kind: '<string>',
kinds: ['<string>'],
kinds_negated: true,
severity: '<string>',
cluster_id: '<string>',
source_id: '<string>',
application_id: '<string>',
reference_pattern: '<string>',
destination_id: '<string>',
priority: 123,
stop_on_match: true,
mode: '<string>',
enabled: true
})
};
fetch('https://platform.ankra.app/api/v1/org/notifications/routes/{route_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://platform.ankra.app/api/v1/org/notifications/routes/{route_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "<string>",
"kinds": [
"<string>"
],
"kinds_negated": true,
"severity": "<string>",
"cluster_id": "<string>",
"source_id": "<string>",
"application_id": "<string>",
"reference_pattern": "<string>",
"destination_id": "<string>",
"priority": 123,
"stop_on_match": true,
"mode": "<string>",
"enabled": true
}
'{
"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>"
}
]
}Update a notification route
Updates the fields sent in the body of a routing rule and leaves the rest unchanged. A new destination or cluster is checked against the organisation first; answers 404 when the route does not exist or, for a caller acting for one project, is another project’s. For a caller confined to a project, a cluster_id, application_id or source_id it cannot read is answered as null with scope_note, and sending null for such a filter (or a blank string for source_id) keeps it stored, while a value it may name replaces it; a source_id it may not name answers 404 Source not found, as the preview does. A source_id longer than 512 bytes or carrying more than 4 uuids answers 422. reference_pattern is shown as written.
import requests
url = "https://platform.ankra.app/api/v1/org/notifications/routes/{route_id}"
payload = {
"kind": "<string>",
"kinds": ["<string>"],
"kinds_negated": True,
"severity": "<string>",
"cluster_id": "<string>",
"source_id": "<string>",
"application_id": "<string>",
"reference_pattern": "<string>",
"destination_id": "<string>",
"priority": 123,
"stop_on_match": True,
"mode": "<string>",
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
kind: '<string>',
kinds: ['<string>'],
kinds_negated: true,
severity: '<string>',
cluster_id: '<string>',
source_id: '<string>',
application_id: '<string>',
reference_pattern: '<string>',
destination_id: '<string>',
priority: 123,
stop_on_match: true,
mode: '<string>',
enabled: true
})
};
fetch('https://platform.ankra.app/api/v1/org/notifications/routes/{route_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://platform.ankra.app/api/v1/org/notifications/routes/{route_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "<string>",
"kinds": [
"<string>"
],
"kinds_negated": true,
"severity": "<string>",
"cluster_id": "<string>",
"source_id": "<string>",
"application_id": "<string>",
"reference_pattern": "<string>",
"destination_id": "<string>",
"priority": 123,
"stop_on_match": true,
"mode": "<string>",
"enabled": true
}
'{
"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; null or a blank string clears the filter, and a blank is never stored as one. 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. For a caller confined to a project, null or a blank string on a source_id it reads as null (the route's scope_note says so) keeps the stored filter, and any other value it may name replaces it. 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 this application (its data.application_id); null clears the filter. For a caller confined to a project, null on an application filter it reads as null (the route's scope_note says so) keeps the stored filter, and an application of its own project replaces it.
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.
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.