import requests
url = "https://platform.ankra.app/api/v1/org/alerts/alerts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/alerts/alerts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/alerts/alerts \
--header 'Authorization: Bearer <token>'{
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"enabled": true,
"state": "<string>",
"status": "<string>",
"severity": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"webhook_ids": [
"<string>"
],
"rule_count": 123,
"trigger_count": 123,
"last_triggered_at": "<string>",
"last_evaluated_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"source": "<string>",
"external_annotations": {},
"external_labels": {},
"external_generator_url": "<string>",
"external_source_url": "<string>",
"evaluation_state": "evaluable",
"unevaluable_rule_count": 123,
"unevaluable_reasons": [
"<string>"
],
"resolved_by": "<string>",
"resolution_note": "<string>"
}
],
"pagination": {
"page": 123,
"page_size": 123,
"total_count": 123,
"total_pages": 123
},
"metrics": {
"total_alerts": 123,
"enabled_alerts": 123,
"disabled_alerts": 123,
"critical_alerts": 123,
"warning_alerts": 123,
"info_alerts": 123,
"firing_alerts": 123,
"triggered_last_24h": 123,
"total_webhooks": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}List alerts
Lists the organisation’s alert definitions one page at a time, with the organisation-wide totals in metrics. Each item carries its firing status, its highest rule severity and whether the evaluator can evaluate its rules. A caller confined to a project sees the alerts in their reach. Open to every member of the organisation.
import requests
url = "https://platform.ankra.app/api/v1/org/alerts/alerts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/alerts/alerts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/alerts/alerts \
--header 'Authorization: Bearer <token>'{
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"enabled": true,
"state": "<string>",
"status": "<string>",
"severity": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"webhook_ids": [
"<string>"
],
"rule_count": 123,
"trigger_count": 123,
"last_triggered_at": "<string>",
"last_evaluated_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"source": "<string>",
"external_annotations": {},
"external_labels": {},
"external_generator_url": "<string>",
"external_source_url": "<string>",
"evaluation_state": "evaluable",
"unevaluable_rule_count": 123,
"unevaluable_reasons": [
"<string>"
],
"resolved_by": "<string>",
"resolution_note": "<string>"
}
],
"pagination": {
"page": 123,
"page_size": 123,
"total_count": 123,
"total_pages": 123
},
"metrics": {
"total_alerts": 123,
"enabled_alerts": 123,
"disabled_alerts": 123,
"critical_alerts": 123,
"warning_alerts": 123,
"info_alerts": 123,
"firing_alerts": 123,
"triggered_last_24h": 123,
"total_webhooks": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
The page to return.
x >= 1Alerts per page.
1 <= x <= 100Only alerts whose name matches this text. The name parameter is accepted as an alias.
Only enabled alerts (true) or only muted ones (false).
Only alerts with a rule of this severity.
Only alerts with a rule on this resource type.
Only alerts whose rules watch this cluster.
The column to sort on; an unknown column falls back to newest first.
id, name, enabled, firing, status, severity, state, rule_count, created_at, updated_at The sort direction; applies only with sort_by.
asc, desc