Grafana OnCallGrafana OnCall API referenceIncidents HTTP API

List Incidents

curl "{{API_URL}}/api/v1/incidents/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" 

The above command returns JSON structured like this:

    "count": 1,
    "next": null,
    "previous": null,
    "results": [
            "id": "I68T24C13IFW1",
            "integration_id": "CFRPV98RPR1U8",
            "route_id": "RIYGUJXCPFHXY",
            "alerts_count": 3,
            "state": "resolved",
            "created_at": "2020-05-19T12:37:01.430444Z",
            "resolved_at": "2020-05-19T13:37:01.429805Z",
            "acknowledged_at": null,
            "title": "Memory above 90% threshold"

These available filter parameters should be provided as get arguments:

  • route_id
  • integration_id

HTTP request

GET {{API_URL}}/api/v1/incidents/

Delete Incidents

curl "{{API_URL}}/api/v1/incidents/I68T24C13IFW1/" \
  --request DELETE \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --data '{
      "mode": "wipe"
modeNoDefaule setting is wipe. wipe will remove the payload of all Grafana OnCall incident alerts. This is useful if you sent sensitive data to OnCall. All metadata will remain. delete mode will trigger the removal of incidents, alerts, and all related metadata. It will also remove incident notifications in Slack and other destinations.

NOTE: DELETE can take a few minutes to delete incidents because Grafana Oncall interacts with 3rd party APIs such as Slack. Please check objects using GET to be sure the data is removed.

HTTP request

DELETE {{API_URL}}/api/v1/incidents/<INCIDENT_ID>