# Maintenance API

## List Maintenances

<mark style="color:blue;">`GET`</mark> `https://api.statusentry.com/v1/maintenances`

This endpoint allows you to list all maintenances.

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Authorization Token |

{% tabs %}
{% tab title="200 " %}

```
{
    "customerId": "b81b5166-7a8f-4046-9cd6-482cd7ecb032",
    "maintenances": [
        {
            "customerId": "b81b5166-7a8f-4046-9cd6-482cd7ecb032",
            "id": "5e910045-7272-4562-bef5-0eddf32a1c8d",
            "name": "We will update our login mechanism",
            "message": "We will switch to another provider. During this transition, we expect to observe intermittent login failures.",
            "plannedStartTime": "2021-04-03T21:19:00.791Z",
            "plannedEndTime": "2021-04-03T21:24:00.791Z",
            "affectedComponents": [
                {
                    "componentId": "29db6fd6-9d5d-4c8c-8cc7-e072f3e08f67"
                }
            ],
            "sendNotification": true,
            "internal": false
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get Maintenance

<mark style="color:blue;">`GET`</mark> `https://api.statusentry.com/v1/maintenances/:id`

This endpoint allows you to retrieve a specific maintenance.

#### Path Parameters

| Name | Type   | Description           |
| ---- | ------ | --------------------- |
|      | string | ID of the maintenance |

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Authorization Token |

{% tabs %}
{% tab title="200 " %}

```
{
    "customerId": "b81b5166-7a8f-4046-9cd6-482cd7ecb032",
    "id": "5e910045-7272-4562-bef5-0eddf32a1c8d",
    "name": "We will update our login mechanism",
    "message": "We will switch to another provider. During this transition, we expect to observe intermittent login failures.",
    "plannedStartTime": "2021-04-03T21:19:00.791Z",
    "plannedEndTime": "2021-04-03T21:24:00.791Z",
    "affectedComponents": [
        {
            "componentId": "29db6fd6-9d5d-4c8c-8cc7-e072f3e08f67"
        }
    ],
    "sendNotification": true,
    "internal": false
}
```

{% endtab %}
{% endtabs %}

## Create Maintenance

<mark style="color:green;">`POST`</mark> `https://api.statusentry.com/v1/maintenances`

This endpoint allows you to create a new maintenance.

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Authorization Token |

#### Request Body

| Name               | Type    | Description                                                                |
| ------------------ | ------- | -------------------------------------------------------------------------- |
| name               | string  | Maintenance Name                                                           |
| message            | string  | Maintenance Message                                                        |
| plannedStartTime   | number  | <p>Planned Maintenance Start Time<br>(Epoch time in milliseconds)</p>      |
| plannedEndTime     | number  | <p>Planned Maintenance Completion Time<br>(Epoch time in milliseconds)</p> |
| affectedComponents | array   | Affected Component ID List                                                 |
| sendNotification   | boolean | Should send notification                                                   |
| internal           | boolean | Internal maintenance                                                       |

{% tabs %}
{% tab title="200 " %}

```
{
    "customerId": "b81b5166-7a8f-4046-9cd6-482cd7ecb032",
    "id": "5e910045-7272-4562-bef5-0eddf32a1c8d",
    "name": "We will update our login mechanism",
    "message": "We will switch to another provider. During this transition, we expect to observe intermittent login failures.",
    "plannedStartTime": "2021-04-03T21:19:00.791Z",
    "plannedEndTime": "2021-04-03T21:24:00.791Z",
    "affectedComponents": [
        {
            "componentId": "29db6fd6-9d5d-4c8c-8cc7-e072f3e08f67"
        }
    ],
    "sendNotification": true,
    "internal": false
}
```

{% endtab %}
{% endtabs %}

## Update Maintenance

<mark style="color:orange;">`PUT`</mark> `https://api.statusentry.com/v1/maintenances/:id`

This endpoint allows you to update all of the fields of an existing maintenance.

#### Path Parameters

| Name | Type   | Description    |
| ---- | ------ | -------------- |
| id   | string | Maintenance ID |

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Authorization Token |

#### Request Body

| Name               | Type    | Description                                                                |
| ------------------ | ------- | -------------------------------------------------------------------------- |
| name               | string  | Maintenance Name                                                           |
| message            | string  | Maintenance Message                                                        |
| plannedStartTime   | number  | <p>Planned Maintenance Start Time<br>(Epoch time in milliseconds)</p>      |
| plannedEndTime     | number  | <p>Planned Maintenance Completion Time<br>(Epoch time in milliseconds)</p> |
| affectedComponents | array   | Affected Component ID List                                                 |
| sendNotification   | boolean | Should send notification                                                   |
| internal           | boolean | Internal maintenance                                                       |

{% tabs %}
{% tab title="200 " %}

```
{
    "customerId": "b81b5166-7a8f-4046-9cd6-482cd7ecb032",
    "id": "5e910045-7272-4562-bef5-0eddf32a1c8d",
    "name": "We will update our login mechanism",
    "message": "We will switch to another provider. During this transition, we expect to observe intermittent login failures.",
    "plannedStartTime": "2021-04-03T21:19:00.791Z",
    "plannedEndTime": "2021-04-03T21:24:00.791Z",
    "affectedComponents": [
        {
            "componentId": "29db6fd6-9d5d-4c8c-8cc7-e072f3e08f67"
        }
    ],
    "sendNotification": true,
    "internal": false
}
```

{% endtab %}
{% endtabs %}

## Delete Maintenance

<mark style="color:red;">`DELETE`</mark> `https://api.statusentry.com/v1/maintenances/:id`

This endpoint allows you to delete a specific maintenance.

#### Path Parameters

| Name | Type   | Description           |
| ---- | ------ | --------------------- |
|      | string | ID of the maintenance |

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Authorization Token |

{% tabs %}
{% tab title="200 " %}

```
{
    "customerId": "b81b5166-7a8f-4046-9cd6-482cd7ecb032",
    "id": "5e910045-7272-4562-bef5-0eddf32a1c8d",
    "name": "We will update our login mechanism",
    "message": "We will switch to another provider. During this transition, we expect to observe intermittent login failures.",
    "plannedStartTime": "2021-04-03T21:19:00.791Z",
    "plannedEndTime": "2021-04-03T21:24:00.791Z",
    "affectedComponents": [
        {
            "componentId": "29db6fd6-9d5d-4c8c-8cc7-e072f3e08f67"
        }
    ],
    "sendNotification": true,
    "internal": false
}
```

{% endtab %}
{% endtabs %}
