# Outages API Reference

Source: https://instatus.com/help/api/outages

## Get all page outages

**Endpoint:**

```bash
GET /v1/:page_id/outages?page=:page&per_page=:per_page
```

- The default page number is 1.
- The default per_page number is 50 and the maximum is 100 items per page.

**Example response:**

```json
[
  {
    "id": "ckoutage1",
    "from": "2020-09-12T03:38:47.998Z",
    "to": "2020-09-12T04:38:47.998Z",
    "status": "PARTIALOUTAGE",
    "visibilityState": "PUBLISHED",
    "createdAt": "2020-09-12T03:38:47.998Z",
    "updatedAt": "2020-09-12T03:40:47.998Z",
    "component": {
      "id": "ckf01fvnxywz50a35nh1qzssm",
      "name": "Website"
    },
    "incident": {
      "id": "ckf01m59ueaqb0a32wrljz1yd",
      "name": "Rocket is going down",
      "createdByType": "USER",
      "status": "INVESTIGATING"
    }
  }
]
```

## Get an outage

**Endpoint:**

```bash
GET /v1/:page_id/outages/:outage_id
```

**Example response:**

```json
{
  "id": "ckoutage1",
  "from": "2020-09-12T03:38:47.998Z",
  "to": "2020-09-12T04:38:47.998Z",
  "status": "PARTIALOUTAGE",
  "visibilityState": "PUBLISHED",
  "createdAt": "2020-09-12T03:38:47.998Z",
  "updatedAt": "2020-09-12T03:40:47.998Z",
  "component": {
    "id": "ckf01fvnxywz50a35nh1qzssm",
    "name": "Website"
  },
  "incident": {
    "id": "ckf01m59ueaqb0a32wrljz1yd",
    "name": "Rocket is going down",
    "createdByType": "USER",
    "status": "INVESTIGATING"
  }
}
```

## Add an outage

**Endpoint:**

```bash
POST /v1/:page_id/outages
```

**Example request:**

```json
{
  "componentId": "ckf01fvnxywz50a35nh1qzssm",
  "status": "PARTIALOUTAGE",
  "from": "2020-09-12 03:38:47.998",
  "to": "2020-09-12 04:38:47.998",
  "visibilityState": "PUBLISHED"
}
```

**Example response:**

```json
{
  "id": "ckoutage1",
  "from": "2020-09-12T03:38:47.998Z",
  "to": "2020-09-12T04:38:47.998Z",
  "status": "PARTIALOUTAGE",
  "visibilityState": "PUBLISHED",
  "createdAt": "2020-09-12T03:38:47.998Z",
  "updatedAt": "2020-09-12T03:40:47.998Z",
  "component": {
    "id": "ckf01fvnxywz50a35nh1qzssm",
    "name": "Website"
  },
  "incident": null
}
```

## Update an outage

**Endpoint:**

```bash
PUT /v1/:page_id/outages/:outage_id
```

**Example request:**

```json
{
  "status": "MAJOROUTAGE",
  "to": "2020-09-12 05:38:47.998"
}
```

**Example response:**

```json
{
  "id": "ckoutage1",
  "from": "2020-09-12T03:38:47.998Z",
  "to": "2020-09-12T05:38:47.998Z",
  "status": "MAJOROUTAGE",
  "visibilityState": "PUBLISHED",
  "createdAt": "2020-09-12T03:38:47.998Z",
  "updatedAt": "2020-09-12T04:40:47.998Z",
  "component": {
    "id": "ckf01fvnxywz50a35nh1qzssm",
    "name": "Website"
  },
  "incident": null
}
```

## Delete an outage

**Endpoint:**

```bash
DELETE /v1/:page_id/outages/:outage_id
```

**Example response:**

HTTP 204 No Content
