Uptimeify Docs
Maintenance windows

Create Maintenance Window

Creates a new maintenance window. Accepts a single monitor (legacy), multiple monitors, tag-based (including org-wide), or customer-level targeting.

POST /api/maintenance-windows

Body

{
  "name": "Database migration",
  "startTime": "2026-07-10T22:00:00.000Z",
  "endTime": "2026-07-11T01:00:00.000Z",
  "targets": [
    { "type": "website", "id": 101 },
    { "type": "icmp", "id": 5 }
  ],
  "tagIds": [7],
  "description": "Planned schema migration",
  "isRecurring": false,
  "isActive": true
}

Required fields

  • name (string): A friendly label for the window.
  • startTime (ISO 8601 datetime): When the window begins.
  • endTime (ISO 8601 datetime): When the window ends. Must be after startTime.
  • At least one targeting field (see below).

Target selection (mutually exclusive modes)

Exactly one targeting mode must be used. targets and tagIds may be combined within the multi-monitor mode.

FieldTypeDescription
websiteIdnumberLegacy: single website monitor
icmpMonitorIdnumberLegacy: single ICMP monitor
smtpMonitorIdnumberLegacy: single SMTP monitor
sshMonitorIdnumberLegacy: single SSH monitor
ftpMonitorIdnumberLegacy: single FTP monitor
imapPopMonitorIdnumberLegacy: single IMAP/POP monitor
dnsMonitorIdnumberLegacy: single DNS monitor
customerIpIdnumberLegacy: single customer IP
customerDomainIdnumberLegacy: single customer domain
targets{ type, id }[]Multi-monitor: type is one of website | dns | icmp | smtp | ssh | ftp | imap_pop
tagIdsnumber[]Tag-based: see Tag-only (org-wide) mode below
customerIdnumberCustomer-level: covers every monitor of that customer

Tag-only (org-wide) mode

Sending tagIds without customerId, targets, or any legacy field creates an org-wide maintenance window. The window dynamically covers every monitor across the entire organization that currently carries the specified tags — across all customers.

{
  "name": "Infra tag freeze",
  "startTime": "2026-07-10T22:00:00.000Z",
  "endTime": "2026-07-11T01:00:00.000Z",
  "tagIds": [7]
}
  • Requires admin or editor role. A readonly user attempting this receives 403 Forbidden.
  • The tag membership is resolved live at check time — monitors tagged after the window is created are automatically covered.
  • All tagIds must belong to the same organization; mixing tags from different organizations returns 400 mixedTagOrganizations.

Combination rules

  • Minimum one targeting field is required. Omitting all is a Zod validation error (standard 400 with a validation body, not a data.code error).
  • customerId (customer-level mode) cannot be combined with targets, tagIds, or any legacy field. Combining them is a Zod validation error (standard 400).
  • All monitors in targets must belong to the same customer; mixing customers returns { data: { code: "mixedCustomers" } }.
  • All tagIds must belong to the same organization; mixing organizations returns { data: { code: "mixedTagOrganizations" } }.

Optional fields

FieldTypeDescription
descriptionstringFree-text notes (shown in history).
isRecurringbooleanDefault false. Set to true to enable recurrencePattern.
recurrencePatternobjectRequired when isRecurring is true. See Recurrence.
isActivebooleanDefault true. Set to false to create a disabled window.

Recurrence

{
  "frequency": "weekly",
  "interval": 1,
  "daysOfWeek": [1, 3],
  "dayOfMonth": null,
  "endRecurrenceDate": "2026-12-31"
}
FieldValues
frequencydaily | weekly | monthly
intervalInteger ≥ 1 (repeat every N periods)
daysOfWeekArray of 06 (0 = Sunday); used when frequency is weekly
dayOfMonth131; used when frequency is monthly
endRecurrenceDateISO date string; optional, stops recurrence after this date

Dynamic tag behavior

Tag coverage is resolved live by the monitoring worker at check time. A monitor tagged after the window is created is automatically covered — no window update needed. Removing a tag from a monitor drops it from coverage immediately.

Example (cURL)

BASE_URL="https://uptimeify.io"
TOKEN="<your-api-token>"

curl -X POST "$BASE_URL/api/maintenance-windows" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Database migration",
    "startTime": "2026-07-10T22:00:00.000Z",
    "endTime": "2026-07-11T01:00:00.000Z",
    "targets": [
      { "type": "website", "id": 101 }
    ]
  }'

Response

{
  "id": 42,
  "publicId": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
  "organizationId": 10,
  "customerId": 1,
  "name": "Database migration",
  "description": null,
  "startTime": "2026-07-10T22:00:00.000Z",
  "endTime": "2026-07-11T01:00:00.000Z",
  "isRecurring": false,
  "recurrencePattern": null,
  "isActive": true,
  "targets": [
    { "type": "website", "id": 101 }
  ],
  "tags": [],
  "websiteId": null,
  "icmpMonitorId": null,
  "smtpMonitorId": null,
  "sshMonitorId": null,
  "ftpMonitorId": null,
  "imapPopMonitorId": null,
  "dnsMonitorId": null,
  "customerIpId": null,
  "customerDomainId": null,
  "createdAt": "2026-06-29T10:00:00.000Z",
  "updatedAt": "2026-06-29T10:00:00.000Z"
}

Common errors

StatusDescription
400 (validation)No targeting field provided, or customerId combined with other target fields. These are Zod request-validation errors; the response body is a standard validation error, not { data: { code } }.
400 { data: { code: "mixedCustomers" } }targets contains monitors from different customers.
400 { data: { code: "mixedTagOrganizations" } }tagIds contains tags from different organizations.
401 UnauthorizedNot logged in.
403 ForbiddenYou cannot access the organization, the target is out of scope (global supporter accounts cannot create maintenance windows), or you are a readonly user attempting an org-wide tag-only window.
404 { data: { code: "tagNotFound" } }A tagId does not exist in your organization.

On this page