# Get the incident context — API reference

> Returns the facts for a diagnosis in one response: monitors, checks per region, certificates, observed changes, notes and timeline, without response bodies.

Source: https://upfour.io/docs/api/incidents/get-the-incident-context

[Developers](https://upfour.io/docs/api.md)/[Incidents](https://upfour.io/docs/api/incidents.md)

Returns the facts for a diagnosis in one response: monitors, checks per region, certificates, observed changes, notes and timeline, without response bodies.

GET https://app.upfour.io/v1/incidents/{incidentID}/context

scope incident.read stable returns 200

## Parameters

| Field | Type | Description |
| --- | --- | --- |
| `incidentID` required | uuid | path parameter |
| `notes` optional | string | query parameter · Comma-separated UUIDs of team notes to include. By default notes are omitted. IDs belonging to another incident are ignored. A malformed UUID returns 400. |

## Returns

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

Response fields 1 top-level fields

| Field | Type | Description |
| --- | --- | --- |
| `data` | IncidentContext | |
| IncidentContext · 87 fields FieldTypeDescription `affected_status_pages` IncidentContextStatusPage[]  · nullable Each item · 4 fields FieldTypeDescription `id` uuid `name` string `url` string `client_id` uuid `certificates` IncidentContextCertificate[]  · nullable Each item · 7 fields FieldTypeDescription `dns_names` string[]  · nullable `fingerprint_sha256` string `issuer` string `monitor_id` uuid `not_after` string (date-time) `not_before` string (date-time) `subject` string `context_version` integer `generated_at` string (date-time) `incident` IncidentContextIncident IncidentContextIncident · 8 fields FieldTypeDescription `cockpit_url` string `id` uuid `severity` string `started_at` string (date-time) `state` string `title` string `acknowledged_at` string (date-time) `resolved_at` string (date-time) `links` IncidentContextLinks IncidentContextLinks · 9 fields FieldTypeDescription `cockpit` string `evidence` IncidentContextLink[]  · nullable Each item · 3 fields FieldTypeDescription `id` uuid `url` string `title` string `playbooks` IncidentContextLink[]  · nullable Each item · 3 fields FieldTypeDescription `id` uuid `url` string `title` string `missing` string[]  · nullable `monitors` IncidentContextMonitor[]  · nullable Each item · 30 fields FieldTypeDescription `id` uuid `name` string `regions` IncidentContextRegion[]  · nullable Each item · 21 fields FieldTypeDescription `first_failed` IncidentContextCheck  · nullable IncidentContextCheck · 9 fields FieldTypeDescription `checked_at` string (date-time) `status_code` integer `timings` IncidentContextTimings IncidentContextTimings · 4 fields FieldTypeDescription `connect_ms` integer `dns_ms` integer `tls_ms` integer `ttfb_ms` integer `error` string `error_class` string `last_successful` IncidentContextCheck  · nullable IncidentContextCheck · 9 fields FieldTypeDescription `checked_at` string (date-time) `status_code` integer `timings` IncidentContextTimings IncidentContextTimings · 4 fields FieldTypeDescription `connect_ms` integer `dns_ms` integer `tls_ms` integer `ttfb_ms` integer `error` string `error_class` string `name` string `tags` string[]  · nullable `target` string `type` string `client` IncidentContextClient IncidentContextClient · 2 fields FieldTypeDescription `id` uuid `name` string `observed_changes` IncidentContextChange[]  · nullable Each item · 3 fields FieldTypeDescription `at` string (date-time) `type` string `monitor_id` uuid `timeline` IncidentContextTimelineEntry[]  · nullable Each item · 6 fields FieldTypeDescription `actor_type` string `at` string (date-time) `id` uuid `type` string `actor_label` string `message` string `truncated` boolean `untrusted_fields` string[]  · nullable `client` IncidentContextClient IncidentContextClient · 2 fields FieldTypeDescription `id` uuid `name` string `notes` IncidentContextNote[] Each item · 4 fields FieldTypeDescription `at` string (date-time) `id` uuid `message` string `actor_label` string | | |

## 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 an incident group](https://upfour.io/docs/api/incidents/get-an-incident-group.md) [NextList an incident's notification deliveries](https://upfour.io/docs/api/incidents/list-incident-deliveries.md)

## Request

### cURL

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

### JavaScript

```javascript
const res = await fetch("https://app.upfour.io/v1/incidents/00000000-0000-4000-8000-000000000001/context", {
  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/incidents/00000000-0000-4000-8000-000000000001/context",
    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/incidents/00000000-0000-4000-8000-000000000001/context", 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/incidents/00000000-0000-4000-8000-000000000001/context");
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": {
    "affected_status_pages": [],
    "certificates": [],
    "context_version": 1,
    "generated_at": "2026-10-27T09:00:00Z",
    "incident": {
      "acknowledged_at": "2026-10-27T09:00:00Z",
      "cockpit_url": "http://example.com/incidents/00000000-0000-4000-8000-000000000001",
      "id": "00000000-0000-4000-8000-000000000001",
      "severity": "warning",
      "started_at": "2026-10-27T09:00:00Z",
      "state": "acknowledged",
      "title": "Checkout is slow"
    },
    "links": {
      "cockpit": "http://example.com/incidents/00000000-0000-4000-8000-000000000001",
      "evidence": [],
      "playbooks": [
        {
          "id": "00000000-0000-4000-8000-000000000002",
          "title": "Checkout outage",
          "url": "http://example.com/runbooks/00000000-0000-4000-8000-000000000002"
        }
      ]
    },
    "missing": [
      "monitors[0].tags",
      "monitors[0].regions[0].first_failed",
      "certificates",
      "links.evidence",
      "affected_status_pages"
    ],
    "monitors": [
      {
        "id": "00000000-0000-4000-8000-000000000003",
        "name": "Marketing website",
        "regions": [
          {
            "first_failed": null,
            "last_successful": {
              "checked_at": "2026-10-27T08:50:00Z",
              "status_code": 200,
              "timings": {
                "connect_ms": 0,
                "dns_ms": 0,
                "tls_ms": 0,
                "ttfb_ms": 0
              }
            },
            "name": "eu"
          }
        ],
        "tags": [],
        "target": "https://example.org",
        "type": "http"
      }
    ],
    "observed_changes": [
      {
        "at": "2026-10-27T08:50:00Z",
        "monitor_id": "00000000-0000-4000-8000-000000000003",
        "type": "check_succeeded"
      },
      {
        "at": "2026-10-27T09:00:00Z",
        "type": "created"
      },
      {
        "at": "2026-10-27T09:00:00Z",
        "type": "escalated"
      },
      {
        "at": "2026-10-27T09:00:00Z",
        "type": "escalation_target_acknowledged"
      }
    ],
    "timeline": [
      {
        "actor_label": "anna@example.com",
        "actor_type": "user",
        "at": "2026-10-27T09:00:00Z",
        "id": "00000000-0000-4000-8000-000000000004",
        "type": "escalation_target_acknowledged"
      },
      {
        "actor_label": "anna@example.com",
        "actor_type": "user",
        "at": "2026-10-27T09:00:00Z",
        "id": "00000000-0000-4000-8000-000000000005",
        "type": "escalated"
      },
      {
        "actor_label": "anna@example.com",
        "actor_type": "user",
        "at": "2026-10-27T09:00:00Z",
        "id": "00000000-0000-4000-8000-000000000006",
        "message": "Incident reported manually.",
        "type": "created"
      }
    ],
    "truncated": false,
    "untrusted_fields": [
      "incident.title",
      "monitors[0].name",
      "monitors[0].target",
      "timeline[0].actor_label",
      "timeline[1].actor_label",
      "timeline[2].actor_label",
      "timeline[2].message",
      "links.playbooks[0].title"
    ]
  }
}
```

### 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_…"
  }
}
```
