---
title: "Incident API reference | Grafana Cloud documentation"
description: "API documentation describing ways to programmatically interact with Grafana Incident."
---

# Incident API reference

Interacting programmatically with Grafana Incident is the quickest way for engineering teams to customize the workflow and integrate with other tools.

Grafana Incident provides a variety of ways to integrate programmatically:

- The [JSON/HTTPS RPC API](/docs/grafana-cloud/alerting-and-irm/incident/api/reference/) for getting, creating and updating things
- [Prefill the Declare Incident form with URL parameters](#prefill-the-declare-incident-form-with-url-parameters)
- [Declare Incident bookmarklet](#declare-incident-bookmarklet)

It is recommended that you use the API alongside [Incoming](/docs/grafana-cloud/alerting-and-irm/irm/integrations/custom-integrations/incoming-webhooks) and [Outgoing](/docs/grafana-cloud/alerting-and-irm/irm/integrations/custom-integrations/outgoing-webhooks) webhooks.

## Prefill the Declare Incident form with URL parameters

A simple way to help people declare an incident is to prefill the title, and other contextual information, during the declaration process.

You can do this using URL parameters on the [https://your-stack.grafana.net/a/grafana-irm-app/incidents/declare](https://your-stack.grafana.net/a/grafana-irm-app/incidents/declare) page.

Expand table

| Parameter      | Type    | Description                                                                                              | Example Value                              |
|----------------|---------|----------------------------------------------------------------------------------------------------------|--------------------------------------------|
| `caption`      | string  | A brief explanation of the attached context (the label for the URL)                                      | `Grafana Incident for incident management` |
| `description`  | string  | Prefill the description of the incident                                                                  | `Database latency increased after deploy`  |
| `drill`        | boolean | Mark the incident as a drill                                                                             | `true` or `false`                          |
| `incidentType` | string  | Specify the type of incident (e.g., `security`, `availability`, `performance`)                           | `security`                                 |
| `labels`       | array   | Add labels to the incident (repeat the param for multiples, e.g., `?labels=service:api&labels=env:prod`) | `service:api`                              |
| `severity`     | string  | Set the severity level of the incident (e.g., `critical`, `high`, `medium`, `low`)                       | `critical`                                 |
| `status`       | string  | Set the initial status of the incident (e.g., `open`, `closed`)                                          | `open`                                     |
| `title`        | string  | Prefill the title of the incident (a human readable string)                                              | `API outage impacting users`               |
| `url`          | string  | Attach some context to the incident from the beginning (such as a related URL)                           | `https://grafana.com/blog/example`         |

For example, try the following URL in your stack (Note: You should replace `your-stack.grafana.net`):

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
https://your-stack.grafana.net/a/grafana-irm-app/incidents/declare?title=An+example+incident+using+url+params&url=https%3A%2F%2Fgrafana.com%2Fblog%2F2022%2F09%2F13%2Fgrafana-incident-for-incident-management-is-now-generally-available-in-grafana-cloud%2F&caption=Grafana+Incident+for+incident+management+is+now+generally+available+in+Grafana+Cloud
```

## Declare Incident bookmarklet

You can add a **Declare Incident** button to your browser to allow you to declare incidents from any website.

The bookmarklet will carry the URL and title of the page into the Incident. For example, GitHub issues, JIRA tickets, SLO page, Grafana Dashboard, even a specific tweet, any URL.

To create a bookmarklet, consult the help docs of your specific browser. However, you will likely follow this process:

1. Add or create a new bookmark (it is recommended that you place it on your Bookmarks Bar)
2. For the title or caption, enter **Declare Incident**
3. Use the code below for the URL field, providing the correct value for the `your-stack.grafana.net` placeholder

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
javascript: (() => {
  let title = encodeURIComponent(document.title);
  let url = encodeURIComponent(window.location.href);
  window.open(
    `https://your-stack.grafana.net/a/grafana-irm-app/incidents/declare?title=${title}&caption=${title}&url=${url}`
  );
})();
```
