GET/v1/maintenance-windows

List all maintenance windows

Retrieve a paginated list of all maintenance windows

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Query parameters

page:stringoptional
Page number of paginated results.
Default: "1"
per_page:stringoptional
Number of items per page.
Default: "20"
search:stringoptional
Search term to filter maintenance windows by name

Responses

StatusMeaningDescription
200OKReturns a list of maintenance windows
401UnauthorizedUnauthorized - Invalid or missing API token
500Internal Server ErrorInternal Server Error

Response Schema

result:object[]
result_info:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/maintenance-windows
curl --request GET \
  --url https://api.onlineornot.com/v1/maintenance-windows \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": [
    {
      "id": "abc123def456",
      "name": "Weekly Maintenance",
      "start_date": "09:00",
      "duration_minutes": 60,
      "timezone": "America/New_York",
      "days_of_week": [
        "MONDAY",
        "WEDNESDAY",
        "FRIDAY"
      ],
      "status": "ENABLED"
    }
  ],
  "result_info": {
    "page": 1,
    "per_page": 20,
    "count": 1,
    "total_count": 1
  },
  "success": true,
  "errors": [],
  "messages": []
}

POST/v1/maintenance-windows

Create a new maintenance window

Create a new maintenance window with associated checks and heartbeats

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Body parameters

name:string
Name of the maintenance window
start_date:string
Start time of the maintenance window (HH:MM format)
duration_minutes:integer
Duration of the maintenance window in minutes
timezone:string
Timezone for the maintenance window
days_of_week:string[]
Days of the week when the maintenance window is active
checks:string[]optional
Array of uptime check IDs to associate with this maintenance window
Default: []
heartbeats:string[]optional
Array of heartbeat IDs to associate with this maintenance window
Default: []

Responses

StatusMeaningDescription
201CreatedReturns the created maintenance window
400Bad RequestBad Request - Invalid input (e.g., invalid check/heartbeat IDs, empty name)
401UnauthorizedUnauthorized - Invalid or missing API token
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

POST
/v1/maintenance-windows
curl --request POST \
  --url https://api.onlineornot.com/v1/maintenance-windows \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"name":"Weekly Server Maintenance","start_date":"03:00","duration_minutes":60,"timezone":"America/New_York","days_of_week":["SUNDAY"]}'

Response

{
  "result": {
    "id": "abc123def456",
    "name": "Weekly Maintenance",
    "start_date": "09:00",
    "duration_minutes": 60,
    "timezone": "America/New_York",
    "days_of_week": [
      "MONDAY",
      "WEDNESDAY",
      "FRIDAY"
    ],
    "status": "ENABLED",
    "checks": [
      "abc123",
      "def456"
    ],
    "heartbeats": [
      "ghi789"
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}

GET/v1/maintenance-windows/{maintenance_window_id}

Get a maintenance window by ID

Retrieve a maintenance window with associated checks and heartbeats

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Path parameters

maintenance_window_id:string
Maintenance Window ID

Responses

StatusMeaningDescription
200OKReturns a maintenance window with associated check and heartbeat IDs
401UnauthorizedUnauthorized - Invalid or missing API token
404Not FoundNot Found - Maintenance window does not exist or belongs to different organization
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/maintenance-windows/{maintenance_window_id}
curl --request GET \
  --url https://api.onlineornot.com/v1/maintenance-windows/abc123def456 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "id": "abc123def456",
    "name": "Weekly Maintenance",
    "start_date": "09:00",
    "duration_minutes": 60,
    "timezone": "America/New_York",
    "days_of_week": [
      "MONDAY",
      "WEDNESDAY",
      "FRIDAY"
    ],
    "status": "ENABLED",
    "checks": [
      "abc123",
      "def456"
    ],
    "heartbeats": [
      "ghi789"
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}

PATCH/v1/maintenance-windows/{maintenance_window_id}

Update a maintenance window

Update a maintenance window. All fields are optional - only provided fields will be updated. Updating checks or heartbeats replaces existing associations.

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Path parameters

maintenance_window_id:string
Maintenance Window ID

Body parameters

name:stringoptional
Name of the maintenance window
start_date:stringoptional
Start time of the maintenance window (HH:MM format)
duration_minutes:integeroptional
Duration of the maintenance window in minutes
timezone:stringoptional
Timezone for the maintenance window
days_of_week:string[]optional
Days of the week when the maintenance window is active
status:stringoptional
Whether the maintenance window is enabled or disabled
Accepted values: "ENABLED" | "DISABLED"
checks:string[]optional
Array of uptime check IDs to associate (replaces existing associations)
heartbeats:string[]optional
Array of heartbeat IDs to associate (replaces existing associations)

Responses

StatusMeaningDescription
200OKReturns the updated maintenance window
400Bad RequestBad Request - Invalid input (e.g., invalid check/heartbeat IDs, no fields to update)
401UnauthorizedUnauthorized - Invalid or missing API token
404Not FoundNot Found - Maintenance window does not exist or belongs to different organization
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

PATCH
/v1/maintenance-windows/{maintenance_window_id}
curl --request PATCH \
  --url https://api.onlineornot.com/v1/maintenance-windows/abc123def456 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"name":"Updated Maintenance Window"}'

Response

{
  "result": {
    "id": "abc123def456",
    "name": "Weekly Maintenance",
    "start_date": "09:00",
    "duration_minutes": 60,
    "timezone": "America/New_York",
    "days_of_week": [
      "MONDAY",
      "WEDNESDAY",
      "FRIDAY"
    ],
    "status": "ENABLED",
    "checks": [
      "abc123",
      "def456"
    ],
    "heartbeats": [
      "ghi789"
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}

DELETE/v1/maintenance-windows/{maintenance_window_id}

Delete a maintenance window

Delete a maintenance window and all its associations with checks and heartbeats

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Path parameters

maintenance_window_id:string
Maintenance Window ID

Responses

StatusMeaningDescription
200OKReturns the deleted maintenance window ID
401UnauthorizedUnauthorized - Invalid or missing API token
404Not FoundNot Found - Maintenance window does not exist or belongs to different organization
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

DELETE
/v1/maintenance-windows/{maintenance_window_id}
curl --request DELETE \
  --url https://api.onlineornot.com/v1/maintenance-windows/abc123def456 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "id": "abc123def456"
  },
  "success": true,
  "errors": [],
  "messages": []
}

Was this page helpful?