---
title: "Update Maintenance Window"
description: "Updates an existing maintenance window."
---

`PATCH /api/maintenance-windows/:id`

## Authentication

Requires a valid session.

- Header: `Authorization: Bearer <token>`

Note: Global supporter users are not allowed to update maintenance windows (`403`). Read-only users are allowed.

## Parameters

- `id` (Path, required): Maintenance window ID.

## Request Body

All fields are optional.

```json
{
  "name": "Server Upgrade (updated)",
  "description": null,
  "startTime": "2026-02-25T02:00:00.000Z",
  "endTime": "2026-02-25T04:00:00.000Z",
  "isRecurring": true,
  "recurrencePattern": {
    "frequency": "weekly",
    "interval": 1,
    "daysOfWeek": [1]
  },
  "isActive": true,
  "timezone": "Europe/Berlin"
}
```

Notes:

- You cannot change the target IDs (`websiteId`, `icmpMonitorId`, ...). Only the window fields can be updated.
- `description` can be set to `null` to clear it.
- If you update `startTime` and/or `endTime`, `endTime` must be after `startTime`.
- `timezone` (string, optional): the IANA zone the recurrence pattern is interpreted in. Case-insensitive spellings and legacy IANA link names (e.g. `"gmt"`, `"Zulu"`) are accepted and stored under the runtime's canonical name, `"utc"` and `"Zulu"` are both stored as `"UTC"`. A raw UTC offset (e.g. `"+05:00"`) is rejected: it carries no daylight-saving rule, so it cannot express what a zone name does.

## Example (cURL)

```bash
BASE_URL="https://uptimeify.io"
TOKEN="<your-api-token>"

curl -X PATCH \
  "$BASE_URL/api/maintenance-windows/5" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Server Upgrade (updated)","description":null,"startTime":"2026-02-25T02:00:00.000Z","endTime":"2026-02-25T04:00:00.000Z","isRecurring":true,"recurrencePattern":{"frequency":"weekly","interval":1,"daysOfWeek":[1]},"isActive":true}'
```

## Example Response

```json
{
  "id": 5,
  "websiteId": 101,
  "icmpMonitorId": null,
  "smtpMonitorId": null,
  "sshMonitorId": null,
  "ftpMonitorId": null,
  "imapPopMonitorId": null,
  "customerId": 12,
  "name": "Server Upgrade (updated)",
  "description": null,
  "startTime": "2026-02-25T02:00:00.000Z",
  "endTime": "2026-02-25T04:00:00.000Z",
 "isRecurring": true,
 "recurrencePattern": {
  "frequency": "weekly",
  "interval": 1,
  "daysOfWeek": [1]
 },
  "isActive": true,
  "timezone": "Europe/Berlin",
  "createdBy": "<user-id>",
  "createdAt": "2026-02-20T10:00:00.000Z",
  "updatedAt": "2026-02-21T11:00:00.000Z"
}
```

## Common Errors

- `400 Invalid maintenance window ID` if `:id` is invalid
- `400 End time must be after start time` if you update the time range to an invalid value
- `400` (validation) if `timezone` is a raw UTC offset or not a zone name the runtime recognizes
- `401 Unauthorized` if you are not authenticated
- `403 Forbidden` if you do not have access
- `404 Maintenance window not found` if the maintenance window does not exist

