Grafana Cloud

Escalation HTTP API

Required permission: grafana-irm-app.alert-groups:direct-paging

Refer to Manual paging integration for more background on how escalating to a team or users works.

Escalate to a set of users

For more details about how to fetch a user’s Grafana OnCall ID, refer to the Users public API documentation.

shell
curl "{{API_URL}}/api/v1/escalation/" \
  --request POST \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --header "X-Grafana-URL: https://your-stack.grafana.net" \
  --data '{
    "title": "We are seeing a network outage in the datacenter",
    "message": "I need help investigating, can you join the investigation?",
    "source_url": "https://github.com/myorg/myrepo/issues/123",
    "users": [
      {
        "id": "U281SN24AVVJX",
        "important": false
      },
      {
        "id": "U5AKCVNDEDUE7",
        "important": true
      }
    ],
    "metadata": {
      "service": "payments_service",
      "zoom_meeting_link": "https://zoom.us/j/123456789?pwd=abc123xyz"
    }
  }'

Using usernames instead of IDs

You can also reference users by their username instead of their Grafana OnCall ID:

shell
curl "{{API_URL}}/api/v1/escalation/" \
  --request POST \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --header "X-Grafana-URL: https://your-stack.grafana.net" \
  --data '{
    "title": "We are seeing a network outage in the datacenter",
    "message": "I need help investigating, can you join the investigation?",
    "users": [
      {
        "username": "alice",
        "important": false
      },
      {
        "username": "bob",
        "important": true
      }
    ]
  }'

You can mix id and username in the same request, but each user entry must use only one identifier.

The above command returns JSON structured in the following way:

JSON
{
  "id": "IZHCC4GTNPZ93",
  "integration_id": "CC3GZYZNIIEH5",
  "route_id": "RDN8LITALJXCJ",
  "alerts_count": 1,
  "state": "firing",
  "created_at": "2024-08-15T18:05:36.801215Z",
  "resolved_at": null,
  "resolved_by": null,
  "acknowledged_at": null,
  "acknowledged_by": null,
  "title": "We're seeing a network outage in the datacenter",
  "permalinks": {
    "slack": null,
    "slack_app": null,
    "telegram": null,
    "web": "http://<my_grafana_url>/a/grafana-irm-app/alert-groups/I5LAZ2MXGPUAH"
  },
  "silenced_at": null
}

Escalate to a team

For more details about how to fetch a team’s Grafana OnCall ID, refer to the Teams public API documentation.

shell
curl "{{API_URL}}/api/v1/escalation/" \
  --request POST \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --header "X-Grafana-URL: https://your-stack.grafana.net" \
  --data '{
    "title": "We are seeing a network outage in the datacenter",
    "message": "I need help investigating, can you join the investigation?",
    "source_url": "https://github.com/myorg/myrepo/issues/123",
    "team": "TI73TDU19W48J",
    "important_team_escalation": true,
    "metadata": {
      "service": "payments_service",
      "zoom_meeting_link": "https://zoom.us/j/123456789?pwd=abc123xyz"
    }
  }'

Using team name instead of ID

You can also reference a team by its name instead of its Grafana OnCall ID:

shell
curl "{{API_URL}}/api/v1/escalation/" \
  --request POST \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --header "X-Grafana-URL: https://your-stack.grafana.net" \
  --data '{
    "title": "We are seeing a network outage in the datacenter",
    "message": "I need help investigating, can you join the investigation?",
    "team_name": "Platform Team",
    "important_team_escalation": true
  }'

The above command returns JSON structured in the following way:

JSON
{
  "id": "IZHCC4GTNPZ93",
  "integration_id": "CC3GZYZNIIEH5",
  "route_id": "RDN8LITALJXCJ",
  "alerts_count": 1,
  "state": "firing",
  "created_at": "2024-08-15T18:05:36.801215Z",
  "resolved_at": null,
  "resolved_by": null,
  "acknowledged_at": null,
  "acknowledged_by": null,
  "title": "We're seeing a network outage in the datacenter",
  "permalinks": {
    "slack": null,
    "slack_app": null,
    "telegram": null,
    "web": "http://<my_grafana_url>/a/grafana-irm-app/alert-groups/I5LAZ2MXGPUAH"
  },
  "silenced_at": null
}

Escalate with incident context

When paging users or teams from within an incident, you can include an incident_id to link the escalation to the incident. This enables paged responders to appear in the incident’s “Paged Participants” section and timeline.

shell
curl "{{API_URL}}/api/v1/escalation/" \
  --request POST \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --header "X-Grafana-URL: https://your-stack.grafana.net" \
  --data '{
    "title": "Production Database Outage",
    "message": "You have been paged for an incident",
    "users": [
      {
        "username": "alice",
        "important": true
      }
    ],
    "incident_id": "INC-123"
  }'

When incident_id is provided:

  1. The alert group’s grafana_incident_id is set to the incident ID
  2. An incident reference is added, populating the “Paged Participants” UI section
  3. A timeline activity is created showing who was paged
  4. An incident context entry is added to the “Links and context” tab

Note

Incident API failures are logged but do not fail the escalation. The primary paging operation always succeeds first.

Escalate to a set of user(s) for an existing Alert Group

The following shows how you can escalate to a set of user(s) for an existing Alert Group.

shell
curl "{{API_URL}}/api/v1/escalation/" \
  --request POST \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --header "X-Grafana-URL: https://your-stack.grafana.net" \
  --data '{
    "alert_group_id": "IZMRNNY8RFS94",
    "users": [
      {
        "id": "U281SN24AVVJX",
        "important": false
      },
      {
        "id": "U5AKCVNDEDUE7",
        "important": true
      }
    ]
  }'

The above command returns JSON structured in the following way:

JSON
{
  "id": "IZHCC4GTNPZ93",
  "integration_id": "CC3GZYZNIIEH5",
  "route_id": "RDN8LITALJXCJ",
  "alerts_count": 1,
  "state": "firing",
  "created_at": "2024-08-15T18:05:36.801215Z",
  "resolved_at": null,
  "resolved_by": null,
  "acknowledged_at": null,
  "acknowledged_by": null,
  "title": "We're seeing a network outage in the datacenter",
  "permalinks": {
    "slack": null,
    "slack_app": null,
    "telegram": null,
    "web": "http://<my_grafana_url>/a/grafana-irm-app/alert-groups/I5LAZ2MXGPUAH"
  },
  "silenced_at": null
}

Parameters

ParameterUniqueRequiredDescription
titleNoNoName of the Alert Group that will be created
messageNoNoContent of the Alert Group that will be created
source_urlNoNoValue that will be added in the Alert’s payload as oncall.permalink. This can be useful to have the source URL/button autopopulated with a URL of interest.
teamNoYes (see Things to Note)Grafana OnCall team ID. If specified, will use the “Direct Paging” Integration associated with this Grafana OnCall team, to create the Alert Group.
team_nameNoYes (see Things to Note)Team name (alternative to team). If specified, will look up the team by name.
usersNoYes (see Things to Note)List of user(s) to escalate to. Each user object requires either id (Grafana OnCall user ID) or username, plus an important boolean for notification policy selection.
users[].idNoYes (or username)Grafana OnCall user ID.
users[].usernameNoYes (or id)Username (alternative to id). If specified, will look up the user by username.
users[].importantNoYesBoolean representing whether to escalate using this user’s default or important personal notification policy.
alert_group_idNoNoIf specified, will escalate the specified users for this Alert Group.
important_team_escalationNoNoSets the value of payload.oncall.important to the value specified here (default is False; see Things to Note for more details).
metadataNoNoDictionary of structured data that gets included in the alert payload as metadata. Useful for including additional context, labels, and other structured information that can be used in alert templates.
incident_idNoNoIncident ID (e.g., “INC-123”). If provided, links the escalation to the specified incident. See Escalate with incident context for details.

Things to note

  • team and team_name are mutually exclusive. Use one or the other to identify the team.
  • id and username are mutually exclusive within each user object. Use one or the other to identify each user.
  • team/team_name and users are mutually exclusive in the request payload. If you would like to escalate to a team AND user(s), first escalate to a team, then using the Alert Group ID returned in the response payload, add the required users to the existing Alert Group
  • alert_group_id is mutually exclusive with title, message, source_url, and incident_id. Practically speaking this means that if you are trying to escalate to a set of users on an existing Alert Group, you cannot update the title, message, source_url, or link to an incident for that Alert Group
  • If escalating to a set of users for an existing Alert Group, the Alert Group cannot be in a resolved state
  • Regarding important_team_escalation; this can be useful to send an “important” escalation to the specified team. Teams can configure their Direct Paging Integration to route to different escalation chains based on the value of payload.oncall.important. Refer to Manual paging integration - important escalations for more details.

HTTP request

POST {{API_URL}}/api/v1/escalation/