# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.statusentry.com/maintenance-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
