---
title: "End a maintenance window now"
method: POST
path: "/maintenance-windows/{maintenanceWindow}/end"
tags: ["Maintenance windows"]
---

# End a maintenance window now

`POST /maintenance-windows/{maintenanceWindow}/end`

## Request

- Base URL: `https://api.spectate.net/v1`
- URL: `https://api.spectate.net/v1/maintenance-windows/{maintenanceWindow}/end`
- Auth: HTTP bearer

A one-off window ends. A weekly window skips this occurrence and runs again next time.
Muted alerts that still fire start their escalation within a minute.

## Path parameters

- `maintenanceWindow` string, uuid, required

## Response `200`

The window.

- MaintenanceWindow: Planned work. While a window runs, alerts on what it covers are muted, and failed checks don't count as downtime unless `exclude_from_uptime` is `false`.
  - `id` string, uuid, required: Window ID
  - `name` string, required: Name
  - `reason` string, nullable, required: Why, for the team; `null` for none
  - `starts_at` string, date-time, nullable, required: A one-off window's start; `null` for a weekly window
  - `ends_at` string, date-time, nullable, required: A one-off window's end; `null` for a weekly window
  - `schedule` MaintenanceWindowSchedule, required: When a weekly window runs. An end time before the start time runs past midnight.
    - `timezone` string, required: Time zone of the times. The window follows the clock in this zone across daylight saving
    - `days` integer[], required: Days it starts on: 1 is Monday, 7 is Sunday
    - `start_time` string, required: Start time, `HH:MM`
    - `end_time` string, required: End time, `HH:MM`
  - `repeat_until` string, date, nullable, required: A weekly window's last date, in its time zone; `null` for no last date
  - `covers_everything` boolean, required: `true`: covers everything in the team, and `targets` is ignored
  - `exclude_from_uptime` boolean, required: `true`: failed checks during the window don't count as downtime
  - `active` boolean, required: `true` while it runs
  - `paused_at` string, date-time, nullable, required: When it was paused; `null` if it isn't. A paused window covers nothing
  - `next_start_at` string, date-time, nullable, required: When the current or next occurrence starts; `null` when none is to come
  - `current_end_at` string, date-time, nullable, required: When the running occurrence ends; `null` when it isn't running
  - `targets` MaintenanceWindowTarget[], required: What it covers
    - `type` 'monitor' | 'host' | 'domain' | 'alert_source' | 'project', required: What a maintenance window can cover.
    - `id` string, uuid, required: Its ID
    - `name` string, required: Its name
  - `created_at` string, date-time, required: When it was created

## Other responses

- `401`: `UNAUTHENTICATED`: no token was sent. `INVALID_TOKEN`: the token is unknown or revoked. `TOKEN_EXPIRED`: the token has expired.
- `403`: `FORBIDDEN`: the token lacks an ability this endpoint requires (listed in `details.required_abilities`). `TEAM_PENDING_DELETION`: the team is scheduled for deletion. `TEAM_SUSPENDED`: Spectate suspended the team.
- `404`: `RESOURCE_NOT_FOUND`: there is no such resource in this team.
- `429`: `RATE_LIMITED`: too many requests for this token. Wait for the number of seconds in `Retry-After`.

---

[API](https://skmtc.dev/spectate/apis/spectate-api.md) - [All operations](https://skmtc.dev/spectate/apis/spectate-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spectate/apis/spectate-api/revisions/9b1a233997de?raw)
