# Get a maintenance window

`GET /api/v1/maintenance/{windowId}`

One maintenance window with its checks and its current or next occurrence.

Sign-in: a dashboard session, an API token with `maintenance:read` or the `monitorly` CLI's sign-in with `maintenance:read`.

Section: Maintenance windows. Operation id in openapi.json: `get_maintenance`.

## Parameters

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `windowId` | path | yes | string (uuid) | The maintenance window's id. |

## Responses

Errors are `application/problem+json` (`Problem`); branch on `type`.

### 200

The window.

`application/json`: MaintenanceView

| Field | Type | Required | Description |
|---|---|---|---|
| `checkIds` | array of string (uuid) | yes |  |
| `createdAt` | string | yes |  |
| `id` | string (uuid) | yes |  |
| `managedBy` | ManagedBy | no | `config` when a config apply manages the window, `ui` otherwise. Always sent; optional in the schema because it was added after the first clients. |
| `projectId` | string (uuid) | yes |  |
| `ref` | string \| null | no | The window's key in a config file; null until a config apply creates or adopts it. Always sent; optional in the schema because it was added after the first clients. |
| `schedule` | ScheduleDto | yes |  |
| `timezone` | string | yes |  |
| `title` | string | yes |  |
| `upcoming` | array of OccurrenceView | yes | The running occurrence first (if any), then the next ones; empty once a one-off window is over. |

### 400

Bad Request.

- `auth.credentials_conflict`: the request carries both a session cookie and a token

### 401

Unauthorized.

- `auth.unauthenticated`, `auth.session_expired`: no session, or it ended
- `token.invalid`: the token is malformed, unknown, revoked or expired, or its creator left the workspace

### 403

Forbidden.

- `auth.forbidden`: your role is too low for this
- `token.scope_missing`: the token lacks the scope this needs; `detail` names it

### 404

Not Found.

- `request.not_found`: it does not exist, or you cannot see it

### 429

Too Many Requests.

- `token.rate_limited`: more than 10 requests a second with this token

Schemas named above are listed with their fields in [the schema list](https://docs.monitorly.cloud/api/reference/schemas.md).
