# What this PR does The right-hand side navigation in the OnCall API public docs ([example](https://grafana.com/docs/oncall/latest/oncall-api-reference/alertgroups/)) doesn’t render as expected vs. what we see in the Grafana API public docs ([example](https://grafana.com/docs/grafana/latest/developers/http_api/folder/); 2nd screenshot). This PR fixes that ([convo on Slack](https://raintank-corp.slack.com/archives/C045CTY1QEP/p1718388424649359)).  
2.7 KiB
2.7 KiB
| canonical | title | weight |
|---|---|---|
| https://grafana.com/docs/oncall/latest/oncall-api-reference/alerts/ | Alerts HTTP API | 100 |
Alerts HTTP API
List Alerts
curl "{{API_URL}}/api/v1/alerts/" \
--request GET \
--header "Authorization: meowmeowmeow" \
--header "Content-Type: application/json"
The above command returns JSON structured in the following way:
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"id": "AA74DN7T4JQB6",
"alert_group_id": "I68T24C13IFW1",
"created_at": "2020-05-11T20:08:43Z",
"payload": {
"state": "alerting",
"title": "[Alerting] Test notification",
"ruleId": 0,
"message": "Someone is testing the alert notification within Grafana.",
"ruleUrl": "{{API_URL}}/",
"ruleName": "Test notification",
"evalMatches": [
{
"tags": null,
"value": 100,
"metric": "High value"
},
{
"tags": null,
"value": 200,
"metric": "Higher Value"
}
]
}
},
{
"id": "AR9SSYFKE2PV7",
"alert_group_id": "I68T24C13IFW1",
"created_at": "2020-05-11T20:07:54Z",
"payload": {
"state": "alerting",
"title": "[Alerting] Test notification",
"ruleId": 0,
"message": "Someone is testing the alert notification within Grafana.",
"ruleUrl": "{{API_URL}}/",
"ruleName": "Test notification",
"evalMatches": [
{
"tags": null,
"value": 100,
"metric": "High value"
},
{
"tags": null,
"value": 200,
"metric": "Higher Value"
}
]
}
},
{
"id": "AWJQSGEYYUFGH",
"alert_group_id": "I68T24C13IFW1",
"created_at": "2020-05-11T20:06:58Z",
"payload": {
"state": "alerting",
"title": "[Alerting] Test notification",
"ruleId": 0,
"message": "Someone is testing the alert notification within Grafana.",
"ruleUrl": "{{API_URL}}/",
"ruleName": "Test notification",
"evalMatches": [
{
"tags": null,
"value": 100,
"metric": "High value"
},
{
"tags": null,
"value": 200,
"metric": "Higher Value"
}
]
}
}
],
"current_page_number": 1,
"page_size": 50,
"total_pages": 1
}
The following available filter parameters should be provided as GET arguments:
idalert_group_idsearch—string-based inclusion search by alert payload
HTTP request
GET {{API_URL}}/api/v1/alerts/