export const metadata = {
  title: "Status Page Scheduled Maintenance - OnlineOrNot API Documentation",
  description:
    "Schedule and manage planned maintenance windows on status pages",
}

## Schedule maintenance for a status page   {{ tag: 'POST', label: '/v1/status_pages/{status_page_id}/scheduled_maintenance' }}
<Row>
<Col>

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page ID"},"required":true,"description":"Status Page ID","name":"status_page_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page ID","style":"simple"}]} title="Path parameters" />

<ParameterTree parameters={[{"in":"body","schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"example":"Database upgrade","description":"Title of the scheduled maintenance"},"description":{"type":"string","minLength":1,"example":"Upgrading to PostgreSQL 16","description":"Description of the scheduled maintenance"},"start_date":{"type":"string","format":"date-time","example":"2024-03-01T02:00:00.000Z","description":"When the scheduled maintenance is expected to start (ISO 8601)"},"duration_minutes":{"type":"integer","minimum":1,"example":60,"description":"How long (in minutes) the maintenance is expected to last"},"components_affected":{"type":"array","items":{"type":"string"},"example":["comp_abc123","comp_def456"],"description":"Component IDs affected by this maintenance"},"notifications":{"type":"object","properties":{"an_hour_before":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"at_start":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"at_end":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"}},"description":"Notification settings for subscribers"}},"required":["title","description","start_date","duration_minutes"]},"name":"body","required":true,"exampleValues":{"object":{"title":"Database upgrade","description":"Upgrading to PostgreSQL 16","start_date":"2024-03-01T02:00:00.000Z","duration_minutes":60,"components_affected":["comp_abc123","comp_def456"],"notifications":{"an_hour_before":false,"at_start":true,"at_end":true}},"json":"{\n  \"title\": \"Database upgrade\",\n  \"description\": \"Upgrading to PostgreSQL 16\",\n  \"start_date\": \"2024-03-01T02:00:00.000Z\",\n  \"duration_minutes\": 60,\n  \"components_affected\": [\n    \"comp_abc123\",\n    \"comp_def456\"\n  ],\n  \"notifications\": {\n    \"an_hour_before\": false,\n    \"at_start\": true,\n    \"at_end\": true\n  }\n}"},"originalType":"object","safeType":"object"},{"in":"body","schema":{"type":"string","minLength":1,"example":"Database upgrade","description":"Title of the scheduled maintenance"},"name":"» title","required":true,"description":"Title of the scheduled maintenance","safeType":"string","depth":1,"exampleValues":{"object":"Database upgrade","json":"'Database upgrade'"},"shortDesc":"Title of the scheduled maintenance"},{"in":"body","schema":{"type":"string","minLength":1,"example":"Upgrading to PostgreSQL 16","description":"Description of the scheduled maintenance"},"name":"» description","required":true,"description":"Description of the scheduled maintenance","safeType":"string","depth":1,"exampleValues":{"object":"Upgrading to PostgreSQL 16","json":"'Upgrading to PostgreSQL 16'"},"shortDesc":"Description of the scheduled maintenance"},{"in":"body","schema":{"type":"string","format":"date-time","example":"2024-03-01T02:00:00.000Z","description":"When the scheduled maintenance is expected to start (ISO 8601)"},"name":"» start_date","required":true,"description":"When the scheduled maintenance is expected to start (ISO 8601)","safeType":"string(date-time)","depth":1,"exampleValues":{"object":"2024-03-01T02:00:00.000Z","json":"'2024-03-01T02:00:00.000Z'"},"shortDesc":"When the scheduled maintenance is expected to start (ISO 8601)"},{"in":"body","schema":{"type":"integer","minimum":1,"example":60,"description":"How long (in minutes) the maintenance is expected to last"},"name":"» duration_minutes","required":true,"description":"How long (in minutes) the maintenance is expected to last","safeType":"integer","depth":1,"exampleValues":{"object":60,"json":"'60'"},"shortDesc":"How long (in minutes) the maintenance is expected to last"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"example":["comp_abc123","comp_def456"],"description":"Component IDs affected by this maintenance"},"name":"» components_affected","required":false,"description":"Component IDs affected by this maintenance","safeType":"string[]","depth":1,"exampleValues":{"object":["comp_abc123","comp_def456"],"json":"[\n  \"comp_abc123\",\n  \"comp_def456\"\n]"},"shortDesc":"Component IDs affected by this maintenance"},{"in":"body","schema":{"type":"object","properties":{"an_hour_before":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"at_start":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"at_end":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"}},"description":"Notification settings for subscribers"},"name":"» notifications","required":false,"description":"Notification settings for subscribers","safeType":"object","depth":1,"exampleValues":{"object":{"an_hour_before":false,"at_start":true,"at_end":true},"json":"{\n  \"an_hour_before\": false,\n  \"at_start\": true,\n  \"at_end\": true\n}"},"shortDesc":"Notification settings for subscribers"},{"in":"body","schema":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"name":"»» an_hour_before","required":false,"description":"Notify subscribers one hour before maintenance starts","safeType":"boolean","depth":2,"exampleValues":{"object":false,"json":"'false'"},"shortDesc":"Notify subscribers one hour before maintenance starts"},{"in":"body","schema":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"name":"»» at_start","required":false,"description":"Notify subscribers when maintenance starts","safeType":"boolean","depth":2,"exampleValues":{"object":true,"json":"'true'"},"shortDesc":"Notify subscribers when maintenance starts"},{"in":"body","schema":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"},"name":"»» at_end","required":false,"description":"Notify subscribers when maintenance ends","safeType":"boolean","depth":2,"exampleValues":{"object":true,"json":"'true'"},"shortDesc":"Notify subscribers when maintenance ends"}]} title="Body parameters" />

<h3 id="post__v1_status_pages_{status_page_id}_scheduled_maintenance-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Returns the newly created scheduled maintenance|
|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad Request - validation error|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"201","properties":[{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Status Page Incident ID"},"title":{"type":"string","minLength":1,"maxLength":256,"example":"API is inaccessible","description":"a title for the incident"},"impact":{"type":["string","null"],"enum":["MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Impact of the incident"},"started":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident started"},"ended":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was resolved"},"created_at":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident was created"},"updated_at":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was last updated"}},"required":["id","title","impact","started","created_at","updated_at"]},{"type":"object","properties":{"start_date":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the scheduled maintenance is expected to start"},"duration_minutes":{"type":"integer","minimum":1,"example":60,"description":"How long (in minutes) the scheduled maintenance should be displayed on your status page before being resolved automatically"},"notifications":{"type":"object","properties":{"an_hour_before":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"at_start":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"at_end":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"}},"description":"Subscriber notification settings"},"components":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"comp123","description":"Component ID"},"name":{"type":"string","example":"API Server","description":"Component name"}},"required":["id","name"],"description":"Component associated with the scheduled maintenance"},"description":"Components affected by this maintenance"}},"required":["start_date","duration_minutes"]}]},"in":"body","name":"result","depth":1,"type":"any","safeType":"any","required":true,"displayName":"» result"},{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Status Page Incident ID"},"title":{"type":"string","minLength":1,"maxLength":256,"example":"API is inaccessible","description":"a title for the incident"},"impact":{"type":["string","null"],"enum":["MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Impact of the incident"},"started":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident started"},"ended":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was resolved"},"created_at":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident was created"},"updated_at":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was last updated"}},"required":["id","title","impact","started","created_at","updated_at"]},"in":"body","name":"*anonymous*","depth":2,"type":"object","safeType":"object","required":false,"displayName":"»» *anonymous*"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Status Page Incident ID"},"in":"body","name":"id","depth":3,"description":"Status Page Incident ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","minLength":1,"maxLength":256,"example":"API is inaccessible","description":"a title for the incident"},"in":"body","name":"title","depth":3,"description":"a title for the incident","type":"string","safeType":"string","required":true,"displayName":"»»» title"},{"schema":{"type":["string","null"],"enum":["MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Impact of the incident"},"in":"body","name":"impact","depth":3,"description":"Impact of the incident","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» impact"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident started"},"in":"body","name":"started","depth":3,"description":"When the incident started","type":"string","safeType":"string","required":true,"displayName":"»»» started"},{"schema":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was resolved"},"in":"body","name":"ended","depth":3,"description":"When the incident was resolved","type":"string","safeType":"string","required":false,"displayName":"»»» ended"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident was created"},"in":"body","name":"created_at","depth":3,"description":"When the incident was created","type":"string","safeType":"string","required":true,"displayName":"»»» created_at"},{"schema":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was last updated"},"in":"body","name":"updated_at","depth":3,"description":"When the incident was last updated","type":"string","safeType":"string","required":true,"displayName":"»»» updated_at"},{"schema":{"type":"object","properties":{"start_date":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the scheduled maintenance is expected to start"},"duration_minutes":{"type":"integer","minimum":1,"example":60,"description":"How long (in minutes) the scheduled maintenance should be displayed on your status page before being resolved automatically"},"notifications":{"type":"object","properties":{"an_hour_before":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"at_start":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"at_end":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"}},"description":"Subscriber notification settings"},"components":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"comp123","description":"Component ID"},"name":{"type":"string","example":"API Server","description":"Component name"}},"required":["id","name"],"description":"Component associated with the scheduled maintenance"},"description":"Components affected by this maintenance"}},"required":["start_date","duration_minutes"]},"in":"body","name":"*anonymous*","depth":2,"type":"object","safeType":"object","required":false,"displayName":"»» *anonymous*"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the scheduled maintenance is expected to start"},"in":"body","name":"start_date","depth":3,"description":"When the scheduled maintenance is expected to start","type":"string","safeType":"string","required":true,"displayName":"»»» start_date"},{"schema":{"type":"integer","minimum":1,"example":60,"description":"How long (in minutes) the scheduled maintenance should be displayed on your status page before being resolved automatically"},"in":"body","name":"duration_minutes","depth":3,"description":"How long (in minutes) the scheduled maintenance should be displayed on your status page before being resolved automatically","type":"integer","safeType":"integer","required":true,"displayName":"»»» duration_minutes"},{"schema":{"type":"object","properties":{"an_hour_before":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"at_start":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"at_end":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"}},"description":"Subscriber notification settings"},"in":"body","name":"notifications","depth":3,"description":"Subscriber notification settings","type":"object","safeType":"object","required":false,"displayName":"»»» notifications"},{"schema":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"in":"body","name":"an_hour_before","depth":4,"description":"Notify subscribers one hour before maintenance starts","type":"boolean","safeType":"boolean","required":false,"displayName":"»»»» an_hour_before"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"in":"body","name":"at_start","depth":4,"description":"Notify subscribers when maintenance starts","type":"boolean","safeType":"boolean","required":false,"displayName":"»»»» at_start"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"},"in":"body","name":"at_end","depth":4,"description":"Notify subscribers when maintenance ends","type":"boolean","safeType":"boolean","required":false,"displayName":"»»»» at_end"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"comp123","description":"Component ID"},"name":{"type":"string","example":"API Server","description":"Component name"}},"required":["id","name"],"description":"Component associated with the scheduled maintenance"},"description":"Components affected by this maintenance"},"in":"body","name":"components","depth":3,"description":"Components affected by this maintenance","type":"array","safeType":"object[]","required":false,"displayName":"»»» components"},{"schema":{"type":"string","example":"comp123","description":"Component ID"},"in":"body","name":"id","depth":4,"description":"Component ID","type":"string","safeType":"string","required":true,"displayName":"»»»» id"},{"schema":{"type":"string","example":"API Server","description":"Component name"},"in":"body","name":"name","depth":4,"description":"Component name","type":"string","safeType":"string","required":true,"displayName":"»»»» name"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="POST" label="/v1/status_pages/{status_page_id}/scheduled_maintenance">
```bash {{ title: 'cURL' }}
curl --request POST \
  --url https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"title":"Database upgrade","description":"Upgrading to PostgreSQL 16","start_date":"2024-03-01T02:00:00.000Z","duration_minutes":60,"components_affected":["comp_abc123","comp_def456"],"notifications":{"an_hour_before":false,"at_start":true,"at_end":true}}'
```

```javascript
fetch("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance", {
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  },
  "body": "{\"title\":\"Database upgrade\",\"description\":\"Upgrading to PostgreSQL 16\",\"start_date\":\"2024-03-01T02:00:00.000Z\",\"duration_minutes\":60,\"components_affected\":[\"comp_abc123\",\"comp_def456\"],\"notifications\":{\"an_hour_before\":false,\"at_start\":true,\"at_end\":true}}"
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"title\":\"Database upgrade\",\"description\":\"Upgrading to PostgreSQL 16\",\"start_date\":\"2024-03-01T02:00:00.000Z\",\"duration_minutes\":60,\"components_affected\":[\"comp_abc123\",\"comp_def456\"],\"notifications\":{\"an_hour_before\":false,\"at_start\":true,\"at_end\":true}}");
Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

$request->setBody('{"title":"Database upgrade","description":"Upgrading to PostgreSQL 16","start_date":"2024-03-01T02:00:00.000Z","duration_minutes":60,"components_affected":["comp_abc123","comp_def456"],"notifications":{"an_hour_before":false,"at_start":true,"at_end":true}}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'
request.body = "{\"title\":\"Database upgrade\",\"description\":\"Upgrading to PostgreSQL 16\",\"start_date\":\"2024-03-01T02:00:00.000Z\",\"duration_minutes\":60,\"components_affected\":[\"comp_abc123\",\"comp_def456\"],\"notifications\":{\"an_hour_before\":false,\"at_start\":true,\"at_end\":true}}"

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance"

payload = {
    "title": "Database upgrade",
    "description": "Upgrading to PostgreSQL 16",
    "start_date": "2024-03-01T02:00:00.000Z",
    "duration_minutes": 60,
    "components_affected": ["comp_abc123", "comp_def456"],
    "notifications": {
        "an_hour_before": False,
        "at_start": True,
        "at_end": True
    }
}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4",
    "title": "API is inaccessible",
    "impact": "MAJOR_OUTAGE",
    "started": "2021-01-01T00:00:00.000Z",
    "ended": "2021-02-01T00:00:00.000Z",
    "created_at": "2021-01-01T00:00:00.000Z",
    "updated_at": "2021-02-01T00:00:00.000Z",
    "start_date": "2021-01-01T00:00:00.000Z",
    "duration_minutes": 60,
    "notifications": {
      "an_hour_before": false,
      "at_start": true,
      "at_end": true
    },
    "components": [
      {
        "id": "comp123",
        "name": "API Server"
      }
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Retrieve a scheduled maintenance   {{ tag: 'GET', label: '/v1/status_pages/{status_page_id}/scheduled_maintenance/{scheduled_maintenance_id}' }}
<Row>
<Col>

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page ID"},"required":true,"description":"Status Page ID","name":"status_page_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page ID","style":"simple"},{"schema":{"type":"string","minLength":8,"example":"sm1b2c3d4","description":"Scheduled Maintenance ID"},"required":true,"description":"Scheduled Maintenance ID","name":"scheduled_maintenance_id","in":"path","exampleValues":{"object":"sm1b2c3d4","json":"'sm1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Scheduled Maintenance ID","style":"simple"}]} title="Path parameters" />

<h3 id="get__v1_status_pages_{status_page_id}_scheduled_maintenance_{scheduled_maintenance_id}-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Returns the scheduled maintenance|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Status Page Incident ID"},"title":{"type":"string","minLength":1,"maxLength":256,"example":"API is inaccessible","description":"a title for the incident"},"impact":{"type":["string","null"],"enum":["MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Impact of the incident"},"started":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident started"},"ended":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was resolved"},"created_at":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident was created"},"updated_at":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was last updated"}},"required":["id","title","impact","started","created_at","updated_at"]},{"type":"object","properties":{"start_date":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the scheduled maintenance is expected to start"},"duration_minutes":{"type":"integer","minimum":1,"example":60,"description":"How long (in minutes) the scheduled maintenance should be displayed on your status page before being resolved automatically"},"notifications":{"type":"object","properties":{"an_hour_before":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"at_start":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"at_end":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"}},"description":"Subscriber notification settings"},"components":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"comp123","description":"Component ID"},"name":{"type":"string","example":"API Server","description":"Component name"}},"required":["id","name"],"description":"Component associated with the scheduled maintenance"},"description":"Components affected by this maintenance"}},"required":["start_date","duration_minutes"]}]},"in":"body","name":"result","depth":1,"type":"any","safeType":"any","required":true,"displayName":"» result"},{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Status Page Incident ID"},"title":{"type":"string","minLength":1,"maxLength":256,"example":"API is inaccessible","description":"a title for the incident"},"impact":{"type":["string","null"],"enum":["MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Impact of the incident"},"started":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident started"},"ended":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was resolved"},"created_at":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident was created"},"updated_at":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was last updated"}},"required":["id","title","impact","started","created_at","updated_at"]},"in":"body","name":"*anonymous*","depth":2,"type":"object","safeType":"object","required":false,"displayName":"»» *anonymous*"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Status Page Incident ID"},"in":"body","name":"id","depth":3,"description":"Status Page Incident ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","minLength":1,"maxLength":256,"example":"API is inaccessible","description":"a title for the incident"},"in":"body","name":"title","depth":3,"description":"a title for the incident","type":"string","safeType":"string","required":true,"displayName":"»»» title"},{"schema":{"type":["string","null"],"enum":["MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Impact of the incident"},"in":"body","name":"impact","depth":3,"description":"Impact of the incident","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» impact"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident started"},"in":"body","name":"started","depth":3,"description":"When the incident started","type":"string","safeType":"string","required":true,"displayName":"»»» started"},{"schema":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was resolved"},"in":"body","name":"ended","depth":3,"description":"When the incident was resolved","type":"string","safeType":"string","required":false,"displayName":"»»» ended"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident was created"},"in":"body","name":"created_at","depth":3,"description":"When the incident was created","type":"string","safeType":"string","required":true,"displayName":"»»» created_at"},{"schema":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was last updated"},"in":"body","name":"updated_at","depth":3,"description":"When the incident was last updated","type":"string","safeType":"string","required":true,"displayName":"»»» updated_at"},{"schema":{"type":"object","properties":{"start_date":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the scheduled maintenance is expected to start"},"duration_minutes":{"type":"integer","minimum":1,"example":60,"description":"How long (in minutes) the scheduled maintenance should be displayed on your status page before being resolved automatically"},"notifications":{"type":"object","properties":{"an_hour_before":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"at_start":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"at_end":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"}},"description":"Subscriber notification settings"},"components":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"comp123","description":"Component ID"},"name":{"type":"string","example":"API Server","description":"Component name"}},"required":["id","name"],"description":"Component associated with the scheduled maintenance"},"description":"Components affected by this maintenance"}},"required":["start_date","duration_minutes"]},"in":"body","name":"*anonymous*","depth":2,"type":"object","safeType":"object","required":false,"displayName":"»» *anonymous*"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the scheduled maintenance is expected to start"},"in":"body","name":"start_date","depth":3,"description":"When the scheduled maintenance is expected to start","type":"string","safeType":"string","required":true,"displayName":"»»» start_date"},{"schema":{"type":"integer","minimum":1,"example":60,"description":"How long (in minutes) the scheduled maintenance should be displayed on your status page before being resolved automatically"},"in":"body","name":"duration_minutes","depth":3,"description":"How long (in minutes) the scheduled maintenance should be displayed on your status page before being resolved automatically","type":"integer","safeType":"integer","required":true,"displayName":"»»» duration_minutes"},{"schema":{"type":"object","properties":{"an_hour_before":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"at_start":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"at_end":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"}},"description":"Subscriber notification settings"},"in":"body","name":"notifications","depth":3,"description":"Subscriber notification settings","type":"object","safeType":"object","required":false,"displayName":"»»» notifications"},{"schema":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"in":"body","name":"an_hour_before","depth":4,"description":"Notify subscribers one hour before maintenance starts","type":"boolean","safeType":"boolean","required":false,"displayName":"»»»» an_hour_before"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"in":"body","name":"at_start","depth":4,"description":"Notify subscribers when maintenance starts","type":"boolean","safeType":"boolean","required":false,"displayName":"»»»» at_start"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"},"in":"body","name":"at_end","depth":4,"description":"Notify subscribers when maintenance ends","type":"boolean","safeType":"boolean","required":false,"displayName":"»»»» at_end"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"comp123","description":"Component ID"},"name":{"type":"string","example":"API Server","description":"Component name"}},"required":["id","name"],"description":"Component associated with the scheduled maintenance"},"description":"Components affected by this maintenance"},"in":"body","name":"components","depth":3,"description":"Components affected by this maintenance","type":"array","safeType":"object[]","required":false,"displayName":"»»» components"},{"schema":{"type":"string","example":"comp123","description":"Component ID"},"in":"body","name":"id","depth":4,"description":"Component ID","type":"string","safeType":"string","required":true,"displayName":"»»»» id"},{"schema":{"type":"string","example":"API Server","description":"Component name"},"in":"body","name":"name","depth":4,"description":"Component name","type":"string","safeType":"string","required":true,"displayName":"»»»» name"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="GET" label="/v1/status_pages/{status_page_id}/scheduled_maintenance/{scheduled_maintenance_id}">
```bash {{ title: 'cURL' }}
curl --request GET \
  --url https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'
```

```javascript
fetch("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4", {
  "method": "GET",
  "headers": {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4",
    "title": "API is inaccessible",
    "impact": "MAJOR_OUTAGE",
    "started": "2021-01-01T00:00:00.000Z",
    "ended": "2021-02-01T00:00:00.000Z",
    "created_at": "2021-01-01T00:00:00.000Z",
    "updated_at": "2021-02-01T00:00:00.000Z",
    "start_date": "2021-01-01T00:00:00.000Z",
    "duration_minutes": 60,
    "notifications": {
      "an_hour_before": false,
      "at_start": true,
      "at_end": true
    },
    "components": [
      {
        "id": "comp123",
        "name": "API Server"
      }
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Update a scheduled maintenance (only before it has started)   {{ tag: 'PATCH', label: '/v1/status_pages/{status_page_id}/scheduled_maintenance/{scheduled_maintenance_id}' }}
<Row>
<Col>

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page ID"},"required":true,"description":"Status Page ID","name":"status_page_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page ID","style":"simple"},{"schema":{"type":"string","minLength":8,"example":"sm1b2c3d4","description":"Scheduled Maintenance ID"},"required":true,"description":"Scheduled Maintenance ID","name":"scheduled_maintenance_id","in":"path","exampleValues":{"object":"sm1b2c3d4","json":"'sm1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Scheduled Maintenance ID","style":"simple"}]} title="Path parameters" />

<ParameterTree parameters={[{"in":"body","schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"example":"Database upgrade v2","description":"Updated title"},"start_date":{"type":"string","format":"date-time","example":"2024-03-02T02:00:00.000Z","description":"Updated start date (ISO 8601)"},"duration_minutes":{"type":"integer","minimum":1,"example":120,"description":"Updated duration in minutes"}}},"name":"body","required":true,"exampleValues":{"object":{"title":"Database upgrade v2","start_date":"2024-03-02T02:00:00.000Z","duration_minutes":120},"json":"{\n  \"title\": \"Database upgrade v2\",\n  \"start_date\": \"2024-03-02T02:00:00.000Z\",\n  \"duration_minutes\": 120\n}"},"originalType":"object","safeType":"object"},{"in":"body","schema":{"type":"string","minLength":1,"example":"Database upgrade v2","description":"Updated title"},"name":"» title","required":false,"description":"Updated title","safeType":"string","depth":1,"exampleValues":{"object":"Database upgrade v2","json":"'Database upgrade v2'"},"shortDesc":"Updated title"},{"in":"body","schema":{"type":"string","format":"date-time","example":"2024-03-02T02:00:00.000Z","description":"Updated start date (ISO 8601)"},"name":"» start_date","required":false,"description":"Updated start date (ISO 8601)","safeType":"string(date-time)","depth":1,"exampleValues":{"object":"2024-03-02T02:00:00.000Z","json":"'2024-03-02T02:00:00.000Z'"},"shortDesc":"Updated start date (ISO 8601)"},{"in":"body","schema":{"type":"integer","minimum":1,"example":120,"description":"Updated duration in minutes"},"name":"» duration_minutes","required":false,"description":"Updated duration in minutes","safeType":"integer","depth":1,"exampleValues":{"object":120,"json":"'120'"},"shortDesc":"Updated duration in minutes"}]} title="Body parameters" />

<h3 id="patch__v1_status_pages_{status_page_id}_scheduled_maintenance_{scheduled_maintenance_id}-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Returns the updated scheduled maintenance|
|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad Request - cannot update after maintenance has started|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Status Page Incident ID"},"title":{"type":"string","minLength":1,"maxLength":256,"example":"API is inaccessible","description":"a title for the incident"},"impact":{"type":["string","null"],"enum":["MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Impact of the incident"},"started":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident started"},"ended":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was resolved"},"created_at":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident was created"},"updated_at":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was last updated"}},"required":["id","title","impact","started","created_at","updated_at"]},{"type":"object","properties":{"start_date":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the scheduled maintenance is expected to start"},"duration_minutes":{"type":"integer","minimum":1,"example":60,"description":"How long (in minutes) the scheduled maintenance should be displayed on your status page before being resolved automatically"},"notifications":{"type":"object","properties":{"an_hour_before":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"at_start":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"at_end":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"}},"description":"Subscriber notification settings"},"components":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"comp123","description":"Component ID"},"name":{"type":"string","example":"API Server","description":"Component name"}},"required":["id","name"],"description":"Component associated with the scheduled maintenance"},"description":"Components affected by this maintenance"}},"required":["start_date","duration_minutes"]}]},"in":"body","name":"result","depth":1,"type":"any","safeType":"any","required":true,"displayName":"» result"},{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Status Page Incident ID"},"title":{"type":"string","minLength":1,"maxLength":256,"example":"API is inaccessible","description":"a title for the incident"},"impact":{"type":["string","null"],"enum":["MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Impact of the incident"},"started":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident started"},"ended":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was resolved"},"created_at":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident was created"},"updated_at":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was last updated"}},"required":["id","title","impact","started","created_at","updated_at"]},"in":"body","name":"*anonymous*","depth":2,"type":"object","safeType":"object","required":false,"displayName":"»» *anonymous*"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Status Page Incident ID"},"in":"body","name":"id","depth":3,"description":"Status Page Incident ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","minLength":1,"maxLength":256,"example":"API is inaccessible","description":"a title for the incident"},"in":"body","name":"title","depth":3,"description":"a title for the incident","type":"string","safeType":"string","required":true,"displayName":"»»» title"},{"schema":{"type":["string","null"],"enum":["MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Impact of the incident"},"in":"body","name":"impact","depth":3,"description":"Impact of the incident","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» impact"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident started"},"in":"body","name":"started","depth":3,"description":"When the incident started","type":"string","safeType":"string","required":true,"displayName":"»»» started"},{"schema":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was resolved"},"in":"body","name":"ended","depth":3,"description":"When the incident was resolved","type":"string","safeType":"string","required":false,"displayName":"»»» ended"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the incident was created"},"in":"body","name":"created_at","depth":3,"description":"When the incident was created","type":"string","safeType":"string","required":true,"displayName":"»»» created_at"},{"schema":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the incident was last updated"},"in":"body","name":"updated_at","depth":3,"description":"When the incident was last updated","type":"string","safeType":"string","required":true,"displayName":"»»» updated_at"},{"schema":{"type":"object","properties":{"start_date":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the scheduled maintenance is expected to start"},"duration_minutes":{"type":"integer","minimum":1,"example":60,"description":"How long (in minutes) the scheduled maintenance should be displayed on your status page before being resolved automatically"},"notifications":{"type":"object","properties":{"an_hour_before":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"at_start":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"at_end":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"}},"description":"Subscriber notification settings"},"components":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"comp123","description":"Component ID"},"name":{"type":"string","example":"API Server","description":"Component name"}},"required":["id","name"],"description":"Component associated with the scheduled maintenance"},"description":"Components affected by this maintenance"}},"required":["start_date","duration_minutes"]},"in":"body","name":"*anonymous*","depth":2,"type":"object","safeType":"object","required":false,"displayName":"»» *anonymous*"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the scheduled maintenance is expected to start"},"in":"body","name":"start_date","depth":3,"description":"When the scheduled maintenance is expected to start","type":"string","safeType":"string","required":true,"displayName":"»»» start_date"},{"schema":{"type":"integer","minimum":1,"example":60,"description":"How long (in minutes) the scheduled maintenance should be displayed on your status page before being resolved automatically"},"in":"body","name":"duration_minutes","depth":3,"description":"How long (in minutes) the scheduled maintenance should be displayed on your status page before being resolved automatically","type":"integer","safeType":"integer","required":true,"displayName":"»»» duration_minutes"},{"schema":{"type":"object","properties":{"an_hour_before":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"at_start":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"at_end":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"}},"description":"Subscriber notification settings"},"in":"body","name":"notifications","depth":3,"description":"Subscriber notification settings","type":"object","safeType":"object","required":false,"displayName":"»»» notifications"},{"schema":{"type":"boolean","default":false,"example":false,"description":"Notify subscribers one hour before maintenance starts"},"in":"body","name":"an_hour_before","depth":4,"description":"Notify subscribers one hour before maintenance starts","type":"boolean","safeType":"boolean","required":false,"displayName":"»»»» an_hour_before"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance starts"},"in":"body","name":"at_start","depth":4,"description":"Notify subscribers when maintenance starts","type":"boolean","safeType":"boolean","required":false,"displayName":"»»»» at_start"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Notify subscribers when maintenance ends"},"in":"body","name":"at_end","depth":4,"description":"Notify subscribers when maintenance ends","type":"boolean","safeType":"boolean","required":false,"displayName":"»»»» at_end"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"comp123","description":"Component ID"},"name":{"type":"string","example":"API Server","description":"Component name"}},"required":["id","name"],"description":"Component associated with the scheduled maintenance"},"description":"Components affected by this maintenance"},"in":"body","name":"components","depth":3,"description":"Components affected by this maintenance","type":"array","safeType":"object[]","required":false,"displayName":"»»» components"},{"schema":{"type":"string","example":"comp123","description":"Component ID"},"in":"body","name":"id","depth":4,"description":"Component ID","type":"string","safeType":"string","required":true,"displayName":"»»»» id"},{"schema":{"type":"string","example":"API Server","description":"Component name"},"in":"body","name":"name","depth":4,"description":"Component name","type":"string","safeType":"string","required":true,"displayName":"»»»» name"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="PATCH" label="/v1/status_pages/{status_page_id}/scheduled_maintenance/{scheduled_maintenance_id}">
```bash {{ title: 'cURL' }}
curl --request PATCH \
  --url https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"title":"Database upgrade v2","start_date":"2024-03-02T02:00:00.000Z","duration_minutes":120}'
```

```javascript
fetch("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4", {
  "method": "PATCH",
  "headers": {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  },
  "body": "{\"title\":\"Database upgrade v2\",\"start_date\":\"2024-03-02T02:00:00.000Z\",\"duration_minutes\":120}"
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"title\":\"Database upgrade v2\",\"start_date\":\"2024-03-02T02:00:00.000Z\",\"duration_minutes\":120}");
Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4")
  .patch(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

HttpRequest::methodRegister('PATCH');
$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);

$request->setHeaders([
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

$request->setBody('{"title":"Database upgrade v2","start_date":"2024-03-02T02:00:00.000Z","duration_minutes":120}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'
request.body = "{\"title\":\"Database upgrade v2\",\"start_date\":\"2024-03-02T02:00:00.000Z\",\"duration_minutes\":120}"

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4"

payload = {
    "title": "Database upgrade v2",
    "start_date": "2024-03-02T02:00:00.000Z",
    "duration_minutes": 120
}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("PATCH", url, json=payload, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4",
    "title": "API is inaccessible",
    "impact": "MAJOR_OUTAGE",
    "started": "2021-01-01T00:00:00.000Z",
    "ended": "2021-02-01T00:00:00.000Z",
    "created_at": "2021-01-01T00:00:00.000Z",
    "updated_at": "2021-02-01T00:00:00.000Z",
    "start_date": "2021-01-01T00:00:00.000Z",
    "duration_minutes": 60,
    "notifications": {
      "an_hour_before": false,
      "at_start": true,
      "at_end": true
    },
    "components": [
      {
        "id": "comp123",
        "name": "API Server"
      }
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Delete a scheduled maintenance   {{ tag: 'DELETE', label: '/v1/status_pages/{status_page_id}/scheduled_maintenance/{scheduled_maintenance_id}' }}
<Row>
<Col>

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page ID"},"required":true,"description":"Status Page ID","name":"status_page_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page ID","style":"simple"},{"schema":{"type":"string","minLength":8,"example":"sm1b2c3d4","description":"Scheduled Maintenance ID"},"required":true,"description":"Scheduled Maintenance ID","name":"scheduled_maintenance_id","in":"path","exampleValues":{"object":"sm1b2c3d4","json":"'sm1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Scheduled Maintenance ID","style":"simple"}]} title="Path parameters" />

<h3 id="delete__v1_status_pages_{status_page_id}_scheduled_maintenance_{scheduled_maintenance_id}-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Returns the deleted scheduled maintenance's ID|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"type":"object","properties":{"id":{"type":"string","example":"sm1b2c3d4","description":"Deleted scheduled maintenance ID"}},"required":["id"]},"in":"body","name":"result","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"sm1b2c3d4","description":"Deleted scheduled maintenance ID"},"in":"body","name":"id","depth":2,"description":"Deleted scheduled maintenance ID","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="DELETE" label="/v1/status_pages/{status_page_id}/scheduled_maintenance/{scheduled_maintenance_id}">
```bash {{ title: 'cURL' }}
curl --request DELETE \
  --url https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'
```

```javascript
fetch("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4", {
  "method": "DELETE",
  "headers": {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4")
  .delete(null)
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders([
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/status_pages/a1b2c3d4/scheduled_maintenance/sm1b2c3d4"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("DELETE", url, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "sm1b2c3d4"
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

