Create a maintenance window Beta
POST /api/v1/maintenance
Needs an X-API-Key header whose owner has permission to manage uptime monitors in the app. The call counts once against your daily quota. See Monitoring API: getting started for authentication, rate limits and errors.
Body
| Field | Type | Description |
|---|---|---|
description required | string | Up to 200 characters. |
from required | string | integer | When the first occurrence starts, as ISO 8601 or UNIX seconds. |
to required | string | integer | When it ends. Must be after from, and at most 30 days later. |
recurrence optional | string | none (default), day, week or month. Monthly occurrences keep the same day of the month, or the last day in shorter months. |
repeatEvery optional | integer | 1 to 100. Default 1. |
effectiveTo optional | string | integer | null | Stop repeating after this time. Must not be before from. Leave out or send null to repeat for ever. |
monitorIds | string[] | The monitors to cover. Every id must be a monitor in your workspace. |
allMonitors | boolean | true to cover every monitor, now and in future. |
- Send
monitorIdswith at least one id, orallMonitors: true. - For a repeating window, each occurrence must end before the next one starts. For
month, that's checked against 28 days timesrepeatEvery. - A workspace can have up to 500 windows. Creating one more returns
409.
Request
Response
201 Created with the window.
201 · application/json
- {
- "maintenance": { "id": "mw_3f9a0c1d2e4b5a6c7d8e", "description": "Weekly database backup", … },
- "usage": { "used": 31, "dailyLimit": 100, "tier": "free" }
- }
Errors
| Status | When |
|---|---|
400 | A missing or invalid field, a window longer than 30 days, occurrences that would overlap, no monitors chosen, or an unknown monitor id. |
403 | The key's owner doesn't have permission to manage uptime monitors. |
409 | The workspace already has 500 windows. |
Related
- Maintenance windows: how maintenance works and the window object
- Update a window: change the schedule or monitors
- List occurrences: when it will happen