Creates a new maintenance window in your UptimeRobot account. During the scheduled maintenance period, affected monitors will not send alert notifications, preventing false alarms during planned downtime.
Maintenance window configuration object (see MaintenanceWindowPayload interface for all options)
Promise that resolves to the created MaintenanceWindow object with assigned ID
// Create a maintenance window for server updates
const maintenanceWindow = await service.maintenanceWindows.create({
friendlyName: 'Server Updates',
description: 'Monthly server patching and updates',
startDateTime: '2023-11-15T02:00:00Z',
duration: 7200, // 2 hours in seconds
monitorIds: ['monitor1', 'monitor2']
});
https://uptimerobot.com/api/v3/#post-/maintenance-windows Official API Documentation
Removes a maintenance window completely from your UptimeRobot account. This action cannot be undone. If the maintenance window is currently active, it will be cancelled immediately.
Maintenance window ID (number or string)
Promise that resolves to true when deletion is successful
// Delete a maintenance window
const success = await service.maintenanceWindows.delete((12345);
if (success) {
console.log('Maintenance window deleted successfully');
}
https://uptimerobot.com/api/v3/#delete-/maintenance-windows/-id- Official API Documentation
Fetches complete information about an individual maintenance window by ID, including schedule, affected monitors, status, and configuration details.
Maintenance window ID (number or string)
Promise that resolves to the MaintenanceWindow object
// Get maintenance window details
const window = await service.maintenanceWindows.get(12345);
console.log(`Window "${window.friendlyName}" affects ${window.monitorIds.length} monitors`);
https://uptimerobot.com/api/v3/#get-/maintenance-windows/-id- Official API Documentation
Retrieves a list of maintenance windows from your UptimeRobot account. Maintenance windows allow you to schedule periods when monitors should not send alerts during planned downtime. Results are paginated using cursor-based pagination.
Optionalfilter: { cursor?: number }Query string parameters passed to the API
Optionalcursor?: numberPagination cursor for next page
OptionalreturnFullResponse: falseReturns MaintenanceWindow[] by default, or URFullResponse<MaintenanceWindow> if returnFullResponse is true.
// Get all maintenance windows
const windows = await service.maintenanceWindows.list();
// Paginate through results
const page1 = await service.maintenanceWindows.list();
const page2 = await service.maintenanceWindows.list({ cursor: 123456789 });
// Get full response for pagination
const response = await service.maintenanceWindows.list({}, true);
const nextUrl = new URL(response.nextLink);
const nextCursorVal = nextUrl.searchParams.get('cursor');
console.log(nextCursorVal);
https://uptimerobot.com/api/v3/#get-/maintenance-windows Official API Documentation
Retrieves a list of maintenance windows from your UptimeRobot account. Maintenance windows allow you to schedule periods when monitors should not send alerts during planned downtime. Results are paginated using cursor-based pagination.
Query string parameters passed to the API
Optionalcursor?: numberPagination cursor for next page
Returns MaintenanceWindow[] by default, or URFullResponse<MaintenanceWindow> if returnFullResponse is true.
// Get all maintenance windows
const windows = await service.maintenanceWindows.list();
// Paginate through results
const page1 = await service.maintenanceWindows.list();
const page2 = await service.maintenanceWindows.list({ cursor: 123456789 });
// Get full response for pagination
const response = await service.maintenanceWindows.list({}, true);
const nextUrl = new URL(response.nextLink);
const nextCursorVal = nextUrl.searchParams.get('cursor');
console.log(nextCursorVal);
https://uptimerobot.com/api/v3/#get-/maintenance-windows Official API Documentation
Modifies the settings of an existing maintenance window. Only provided fields will be updated; omitted fields retain their current values. Changes take effect according to the new schedule.
Maintenance window ID (number or string)
Maintenance window configuration updates (partial MaintenanceWindowPayload object)
Promise that resolves to the updated MaintenanceWindow object
// Update maintenance window duration and description
const updatedWindow = await service.maintenanceWindows.update((12345, {
duration: 10800, // Extend to 3 hours
description: 'Extended maintenance for database migration'
});
// Add more monitors to existing window
const expandedWindow = await service.maintenanceWindows.update((12345, {
monitorIds: ['monitor1', 'monitor2', 'monitor3', 'monitor4']
});
https://uptimerobot.com/api/v3/#patch-/maintenance-windows/-id- Official API Documentation
Creates a new MaintenanceWindows client.
The request client to use.
Client for the Maintenance Windows API.
See
https://uptimerobot.com/api/v3 Official API Documentation
Since
1.0.0