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": "ef8a6564-0ccf-4f3f-a5ef-d2963176b3eb" },
    { "type": "icmp", "id": "3d005a18-fdd8-4dc7-9f26-1a9d409c1bc5" }
  ],
  "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 | customer_domain | customer_ip. id is the monitor's public id (UUID), the same identifier the legacy single-target fields take; a numeric row id is still accepted.
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 an organization-wide admin or editor: the role AND an unrestricted customer scope. A customer-bound actor (a readonly user, an editor assigned to customers, a customer-scoped token) does not get an org-wide window: when it is bound to exactly one customer, the window is anchored to that customer and covers only that customer's tagged monitors; when it is bound to several (or none), the request is rejected with 400 tagOnlyNeedsCustomer and it must select monitors or a customer instead. See Roles and the customer scope.
  • 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.
timezonestringDefault "UTC". The IANA zone (e.g. "Europe/Berlin") the recurrence pattern is interpreted in. Case-insensitive spellings and legacy IANA link names (e.g. "gmt", "Zulu") are accepted and stored under the runtime's canonical name, "utc" and "Zulu" are both stored as "UTC". A raw UTC offset (e.g. "+05:00") is rejected: it carries no daylight-saving rule, so it cannot express what a zone name does.

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 0-6 (0 = Sunday); used when frequency is weekly
dayOfMonth1-31; 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,
  "timezone": "UTC",
  "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, customerId combined with other target fields, or timezone is a raw UTC offset or not a zone name the runtime recognizes. 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.
400 { data: { code: "tagOnlyNeedsCustomer" } }Tag-only request from a customer-bound actor that is bound to several customers (or none): select monitors or a single customer.
403 ForbiddenYou cannot access the organization, or the target is out of scope (global supporter accounts cannot create maintenance windows).
404 { data: { code: "tagNotFound" } }A tagId does not exist in your organization.

On this page