# List incidents — API reference

> Lists incidents for a monitor.

Source: https://upfour.io/docs/api/monitors/list-incidents

[Developers](https://upfour.io/docs/api.md)/[Monitors](https://upfour.io/docs/api/monitors.md)

Lists incidents for a monitor.

GET https://app.upfour.io/v1/monitors/{monitorID}/incidents

scope monitor.read stable returns 200

## Parameters

| Field | Type | Description |
| --- | --- | --- |
| `monitorID` required | uuid | path parameter |

## Returns

A successful request returns `200` with application/json.

Response fields 1 top-level fields

| Field | Type | Description |
| --- | --- | --- |
| `data` | IncidentListResult | |
| IncidentListResult · 49 fields FieldTypeDescription `counts` IncidentCounts IncidentCounts · 7 fields FieldTypeDescription `acknowledged` integer `open` integer `resolved_in_window` integer `started_in_window` integer `unresolved` integer `window_from` string (date-time) `window_to` string (date-time) `items` Incident[]  · nullable Each item · 37 fields FieldTypeDescription `acknowledged_at` string (date-time)  · nullable `cause` string `check_method` string `check_url` string `client_id` uuid  · nullable `correlated_count` integer `created_at` string (date-time) `created_by` string `description` string `duration_seconds` integer  · nullable `escalation_target_label` string `heartbeat_id` uuid  · nullable `heartbeat_name` string `id` uuid `metadata` map of string  · nullable max 100 keys each value max length 4096 Custom key/value pairs (at most 100 keys; keys 1-128 characters, values up to 4096). Sent to machine-readable alert channels and API webhook subscriptions, and copied onto the incidents the resource opens. `monitor_id` uuid  · nullable `monitor_name` string `notified_label` string `override_channel_ids` uuid[]  · nullable `resolved_at` string (date-time)  · nullable `resolved_by_type` string  · nullable `resolved_by_user_id` uuid  · nullable `routing_target_id` uuid  · nullable `routing_type` string one of`everyone` `escalation_policy` `team` `severity` string one of`critical` `warning` `info` `started_at` string (date-time) `started_by_type` string `started_by_user_id` uuid  · nullable `status` string one of`open` `acknowledged` `resolved` `title` string `updated_at` string (date-time) `user_id` uuid `escalation_target_channel_count` integer `escalation_target_kind` string one of`nobody` `channel_count` `channel_count_with_policy` `name` `escalation_target_name` string `notified_channel_count` integer `notified_kind` string one of`nobody` `delivery_failed` `channel_count` `channel` `page` integer `per_page` integer `total` integer | | |

## Errors

Only the errors this operation can return. Every error uses the [same envelope](https://upfour.io/docs/api/responses.md).

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | [bad_request](https://upfour.io/docs/api/errors#code-bad_request) | The request is malformed or fails validation. |
| 404 | [not_found](https://upfour.io/docs/api/errors#code-not_found) | The requested resource does not exist or is outside the caller's scope. |

Every call can also return `unauthorized` (401), `rate_limit_exceeded` (429) or `internal_error` (500 / 502). See [Responses and errors](https://upfour.io/docs/api/responses.md).

[PreviousGet response times](https://upfour.io/docs/api/monitors/get-response-times.md) [NextList certificates](https://upfour.io/docs/api/monitors/list-certificates.md)

## Request

### cURL

```bash
curl -s "https://app.upfour.io/v1/monitors/00000000-0000-4000-8000-000000000001/incidents" \
  -H "Authorization: Bearer $UP4_API_KEY"
```

### JavaScript

```javascript
const res = await fetch("https://app.upfour.io/v1/monitors/00000000-0000-4000-8000-000000000001/incidents", {
  headers: {
    Authorization: `Bearer ${process.env.UP4_API_KEY}`,
  },
});
console.log(res.status, await res.json());
```

### Python

```python
import os
import requests

res = requests.get(
    "https://app.upfour.io/v1/monitors/00000000-0000-4000-8000-000000000001/incidents",
    headers={"Authorization": f"Bearer {os.environ['UP4_API_KEY']}"},
)
print(res.status_code, res.json())
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.upfour.io/v1/monitors/00000000-0000-4000-8000-000000000001/incidents", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("UP4_API_KEY"))
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(res.StatusCode, string(out))
}
```

### PHP

```php
<?php
$ch = curl_init("https://app.upfour.io/v1/monitors/00000000-0000-4000-8000-000000000001/incidents");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("UP4_API_KEY"),
    ],
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), " ", $response, "\n";
curl_close($ch);
```

## Response

### 200

```json
{
  "data": {
    "counts": {
      "acknowledged": 0,
      "open": 0,
      "resolved_in_window": 0,
      "started_in_window": 0,
      "unresolved": 0
    },
    "items": [],
    "page": 1,
    "per_page": 25,
    "total": 0
  }
}
```

### 400

```json
{
  "error": {
    "code": "bad_request",
    "message": "The request is malformed or fails validation.",
    "request_id": "req_…"
  }
}
```

### 404

```json
{
  "error": {
    "code": "not_found",
    "message": "The requested resource does not exist or is outside the caller's scope.",
    "request_id": "req_…"
  }
}
```
