Skip to main content

Maintenance Windows API

Maintenance windows allow you to mute alerts during planned downtime or maintenance periods.

List Windows

GET /api/v1/maintenance_windows
Query Parameters
ParameterTypeDescription
activebooleanFilter by active status
currentbooleanOnly show currently active windows
Response
{
  "data": [
    {
      "id": "mw_1234567890",
      "name": "Weekly Database Maintenance",
      "starts_at": "2024-01-21T02:00:00Z",
      "ends_at": "2024-01-21T04:00:00Z",
      "active": true,
      "recurring": true,
      "currently_active": false,
      "created_at": "2024-01-01T00:00:00Z"
    }
  ]
}

Get Window

GET /api/v1/maintenance_windows/:id
Response
{
  "data": {
    "id": "mw_1234567890",
    "name": "Weekly Database Maintenance",
    "description": "Scheduled backup and cleanup operations",
    "starts_at": "2024-01-21T02:00:00Z",
    "ends_at": "2024-01-21T04:00:00Z",
    "active": true,
    "recurring": true,
    "recurrence_rule": "FREQ=WEEKLY;BYDAY=SU",
    "rule_ids": ["rule_001", "rule_002"],
    "services": ["database", "backup-service"],
    "created_by": "[email protected]",
    "currently_active": false,
    "created_at": "2024-01-01T00:00:00Z"
  }
}

Create Window

POST /api/v1/maintenance_windows

One-Time Window

{
  "name": "Server Migration",
  "description": "Migrating to new servers",
  "starts_at": "2024-01-20T22:00:00Z",
  "ends_at": "2024-01-21T06:00:00Z",
  "rule_ids": ["rule_001", "rule_002", "rule_003"]
}

Recurring Window

{
  "name": "Weekly Database Maintenance",
  "description": "Scheduled backup and cleanup operations",
  "starts_at": "2024-01-21T02:00:00Z",
  "ends_at": "2024-01-21T04:00:00Z",
  "recurring": true,
  "recurrence_rule": "FREQ=WEEKLY;BYDAY=SU"
}

All Rules Window

To mute all rules, omit the rule_ids field:
{
  "name": "Full System Maintenance",
  "starts_at": "2024-01-20T22:00:00Z",
  "ends_at": "2024-01-21T06:00:00Z"
}

Update Window

PATCH /api/v1/maintenance_windows/:id
Request
{
  "ends_at": "2024-01-21T08:00:00Z",
  "description": "Extended maintenance window"
}

Delete Window

DELETE /api/v1/maintenance_windows/:id

Recurrence Rules

Maintenance windows support iCal RRULE format for recurring windows:
ExampleDescription
FREQ=DAILYEvery day
FREQ=WEEKLY;BYDAY=SUEvery Sunday
FREQ=WEEKLY;BYDAY=SA,SUEvery Saturday and Sunday
FREQ=MONTHLY;BYMONTHDAY=1First day of every month

Scope

Maintenance windows can target:

Specific Rules

Provide rule_ids array to mute only specific alert rules.

All Rules

Omit rule_ids to mute all rules in the project.

Services

Use services array to document which services are affected.

Active Check

To check if any maintenance window is currently active:
GET /api/v1/maintenance_windows?current=true
This is useful for displaying maintenance status in your application.