uptime-robot-v3
    Preparing search index...

    Client for the Maintenance Windows API.

    https://uptimerobot.com/api/v3 Official API Documentation

    1.0.0

    Index

    Maintenance Windows

    Other

    Maintenance Windows

    • 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.

      Parameters

      • payload: MaintenanceWindowPayload

        Maintenance window configuration object (see MaintenanceWindowPayload interface for all options)

      Returns Promise<MaintenanceWindow>

      Promise that resolves to the created MaintenanceWindow object with assigned ID

      When required fields are missing or validation fails

      When conditional requirements are not met (e.g., invalid date range)

      When API request fails or returns an error response

      // 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']
      });

      1.0.0

    • 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.

      Parameters

      • id: idField

        Maintenance window ID (number or string)

      Returns Promise<boolean>

      Promise that resolves to true when deletion is successful

      When maintenance window ID is not found

      When API request fails

      // Delete a maintenance window
      const success = await service.maintenanceWindows.delete((12345);
      if (success) {
      console.log('Maintenance window deleted successfully');
      }

      1.0.0

    • Fetches complete information about an individual maintenance window by ID, including schedule, affected monitors, status, and configuration details.

      Parameters

      • id: idField

        Maintenance window ID (number or string)

      Returns Promise<MaintenanceWindow>

      Promise that resolves to the MaintenanceWindow object

      When maintenance window ID is not found

      When API request fails

      // Get maintenance window details
      const window = await service.maintenanceWindows.get(12345);
      console.log(`Window "${window.friendlyName}" affects ${window.monitorIds.length} monitors`);

      1.0.0

    • 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.

      Parameters

      • Optionalfilter: { cursor?: number }

        Query string parameters passed to the API

        • Optionalcursor?: number

          Pagination cursor for next page

      • OptionalreturnFullResponse: false

      Returns Promise<MaintenanceWindow[]>

      Returns MaintenanceWindow[] by default, or URFullResponse<MaintenanceWindow> if returnFullResponse is true.

      When cursor is negative

      // 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);

      1.0.0

    • 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.

      Parameters

      • filter: { cursor?: number }

        Query string parameters passed to the API

        • Optionalcursor?: number

          Pagination cursor for next page

      • returnFullResponse: true

      Returns Promise<URFullResponse<MaintenanceWindow>>

      Returns MaintenanceWindow[] by default, or URFullResponse<MaintenanceWindow> if returnFullResponse is true.

      When cursor is negative

      // 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);

      1.0.0

    • 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.

      Parameters

      • id: idField

        Maintenance window ID (number or string)

      • payload: MaintenanceWindowPayload

        Maintenance window configuration updates (partial MaintenanceWindowPayload object)

      Returns Promise<MaintenanceWindow>

      Promise that resolves to the updated MaintenanceWindow object

      When maintenance window ID is not found

      When payload validation fails

      When conditional requirements are not met

      // 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']
      });

      1.0.0

    Other