Maintenance Windows
Maintenance windows let you suppress notifications during planned downtime. You can start maintenance immediately, schedule it for later, or set up recurring windows for regular deployment slots.
You'll need a monitor ID for most of these endpoints. All timestamps are in your team's timezone -- both when you send them and when we return them.
Example request:
$ OHDEAR_TOKEN="your API token" $ curl "https://ohdear.app/api/monitors/1/maintenance-periods?filter[started_at]=20240101000000&filter[ended_at]=20241231235959" \ -H "Authorization: Bearer $OHDEAR_TOKEN" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json'
All endpoints below follow the same authentication pattern.
Maintenance periods #
Maintenance period response fields #
Each maintenance period includes the following fields:
{ "id": 45, "monitor_id": 1, "name": "Deployment", "starts_at": "2026-02-12 14:30:00", "ends_at": "2026-02-12 15:00:00" }
id: unique identifiermonitor_id: the monitor this maintenance period belongs toname: optional label, ornullstarts_at: start time in your team's timezoneends_at: end time in your team's timezone
Starting maintenance immediately #
POST /api/monitors/{monitorId}/start-maintenance
Starts maintenance for a monitor right now. We'll suppress notifications until the window ends.
Request body (JSON):
stop_maintenance_after_seconds(integer, optional) -- how long the window lasts in seconds. Minimum5, default3600name(string, optional) -- a label for this maintenance window
Returns the maintenance period object.
Stopping active maintenance #
POST /api/monitors/{monitorId}/stop-maintenance
Ends active maintenance for a monitor. Notifications resume immediately, or after a delay if you specify one.
Request body (JSON):
delay_seconds(integer, optional) -- seconds to wait before resuming notifications. Minimum1
Returns 204 No Content on success.
Creating a scheduled maintenance period #
POST /api/maintenance-periods
Schedule a future maintenance window. We'll suppress notifications during the specified period.
Request body (JSON):
monitor_id(integer, required) -- the monitor to schedule maintenance forstarts_at(string, required) -- start time inY-m-d H:iformat, in your team's timezoneends_at(string, required) -- end time inY-m-d H:iformat, must be afterstarts_atname(string, optional) -- a label for this maintenance window
Returns the maintenance period object.
Updating a scheduled maintenance period #
PUT /api/maintenance-periods/{maintenancePeriodId}
Update the times or name of a scheduled maintenance period that hasn't started yet.
Request body (JSON):
starts_at(string, required) -- start time inY-m-d H:iformat, in your team's timezoneends_at(string, required) -- end time inY-m-d H:iformat, must be afterstarts_atname(string, optional) -- a label for this maintenance window
Returns the updated maintenance period object.
Deleting a maintenance period #
DELETE /api/maintenance-periods/{maintenancePeriodId}
Returns 204 No Content on success.
Retrieving maintenance periods #
GET /api/monitors/{monitorId}/maintenance-periods
Returns a paginated list of maintenance periods for a monitor. Each item follows the same maintenance period shape above.
Query parameters:
filter[started_at](string, optional) -- timestamp inYmdHisformatfilter[ended_at](string, optional) -- timestamp inYmdHisformat
Recurring maintenance periods #
Recurring maintenance periods automate regular maintenance windows -- perfect for weekly deployment slots or nightly processing windows.
Recurring maintenance period response fields #
Each recurring maintenance period includes the following fields:
{ "id": 1, "monitor_id": 1, "name": "Weekly deployment window", "recurrence_type": "weekly", "days_of_week": [2, 4], "day_of_month": null, "start_time": "02:00", "end_time": "03:00", "human_readable_schedule": "Every Tuesday and Thursday from 02:00 to 03:00", "last_generated_until": "2026-02-19", "created_at": "2026-01-15T10:00:00+00:00", "updated_at": "2026-01-15T10:00:00+00:00" }
id: unique identifiermonitor_id: the monitor this recurring period belongs toname: label for this recurring window, ornullrecurrence_type: schedule type -- Possible values:daily,weekly,monthlydays_of_week: for weekly: array of day numbers0-6where0is Sunday, ornullday_of_month: for monthly: day1-31, ornullstart_time:HH:MMformat, in your team's timezoneend_time:HH:MMformat, in your team's timezone. If beforestart_time, the window spans overnighthuman_readable_schedule: human-friendly description of the schedulelast_generated_until: the date (Y-m-d) up to which periods have been generated, ornullcreated_at: ISO 8601 timestampupdated_at: ISO 8601 timestamp
Get a recurring maintenance period #
GET /api/recurring-maintenance-periods/{recurringMaintenancePeriodId}
Returns a single recurring maintenance period by its ID. The response follows the recurring maintenance period shape above.
List recurring maintenance periods #
GET /api/monitors/{monitorId}/recurring-maintenance-periods
Returns all recurring maintenance periods for a monitor. Each item follows the same recurring maintenance period shape above.
Create a recurring maintenance period #
POST /api/recurring-maintenance-periods
Set up a recurring maintenance window that automatically generates maintenance periods on a daily, weekly, or monthly schedule.
Request body (JSON):
monitor_id(integer, required) -- the monitor to create the recurring window forname(string, required) -- a label for this recurring windowrecurrence_type(string, required) --daily,weekly, ormonthlystart_time(string, required) -- start time inHH:MMformat, in your team's timezoneend_time(string, required) -- end time inHH:MMformat, must differ fromstart_timedays_of_week(array of integers, required forweekly) -- values0-6where0is Sundayday_of_month(integer, required formonthly) -- values1-31generate_now(boolean, optional) -- immediately generates maintenance periods for the next 7 days. Defaulttrue
Returns the recurring maintenance period object.
Update a recurring maintenance period #
PUT /api/recurring-maintenance-periods/{recurringMaintenancePeriodId}
All fields are optional -- only include what you want to change.
Request body (JSON):
name(string, optional)recurrence_type(string, optional) --daily,weekly, ormonthlystart_time(string, optional) --HH:MMformat, in your team's timezoneend_time(string, optional) --HH:MMformatdays_of_week(array of integers, optional)day_of_month(integer, optional)regenerate_future_periods(boolean, optional) -- deletes and regenerates future periods with the new schedule. Defaulttrue
Returns the updated recurring maintenance period object.
Delete a recurring maintenance period #
DELETE /api/recurring-maintenance-periods/{recurringMaintenancePeriodId}
Returns 204 No Content on success.
Query parameter:
delete_future_periods(boolean, optional) -- also removes future periods generated from this recurring definition. Past periods are always preserved
Feel free to reach out via [email protected] or on X via @OhDearApp if you have any other questions. We'd love to help!