---
updatedAt: 2025-08-14T13:36:38.000Z
agentTools:
  siteIndex: https://developer.n-able.com/llms.txt
  projectIndex: https://developer.n-able.com/n-central/llms.txt
---

# PREVIEW : Retrieves all maintenance windows for a device.

Retrieves all maintenance windows for a given device.<br/><br/><b>NOTE: </b>This endpoint is currently in a preview stage.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "N-central API-Service",
    "description": "<h3>API Access</h3>\n<p>In order to use the API-Service endpoints, ensure the following prerequisites are met:</p>\n<ol>\n    <li>User is created in N-central with appropriate permissions and configuration\n        (roles, access groups, MFA disabled, 2FA disabled).</li>\n    <li>API access is set up in N-central by having a JWT\n        (Json Web Token, referred to as \"N-central User-API Token\") generated,\n        acting as the permanent secret solely used for fetching access and refresh tokens.</li>\n</ol>\n<p>To access the API-Service endpoints, the JWT must first be exchanged with access and refresh tokens:</p>\n<ul>\n    <li>\n        <p><b>Using Swagger UI:</b></p>\n        <ol>\n            <li>Click on the <b>\"Authorize\"</b> button and enter the JWT into the value field\n                under <b>\"N-central_User-API_Token_JWT\"</b>, then navigate to\n                the <code>/api/auth/authenticate</code> endpoint, click <b>\"Try it out\"</b>\n                and then <b>\"Execute\"</b>.\n                <br/>The new “Access Token” and “Refresh Token” fields will be available in the “Server Response”\n                section below. Note that the expiry is 3600s ( 1h ). Copy the value of the access token.</li>\n            <li>Click on the <b>lock icon</b> to the right of any endpoint\n                (or the <b>\"Authorize\"</b> button at the top), enter the access token in the\n                <b>\"API-Access_Token\"</b> field and click <b>\"Authorize\"</b>.</li>\n            <li>To call an API-Service endpoint, navigate to it, click <b>\"Try it out\"</b> button and\n            then <b>\"Execute\"</b>. If the steps above were successful, the access token is included in requests\n            automatically.</li>\n        </ol>\n    </li>\n    <li>\n        <p><b>Using a different HTTP client:</b></p>\n        <ol>\n            <li>Call the <code>/api/auth/authenticate</code> endpoint.\n                The JWT token must be specified under the <code>Authorization</code> header,\n                in the form <code>Bearer &lt;YOUR_JWT&gt;\"</code>.\n                <br/>The access and refresh tokens are present in the response.</li>\n            <li>When calling API-Service endpoints, make sure to specify the <b>access token</b> in\n            the <code>Authorization</code> header as <code>Bearer &lt;ACCESS_TOKEN&gt;</code>.</li>\n        </ol>\n    </li>\n</ul>\n<h3>API Pagination & Sorting</h3>\n<p>Certain API-Service query endpoints support pagination and sorting through the use of query parameters.</p>\n<p><b>Pagination query parameters:</b></p>\n<ul>\n    <li>pageSize: number between 1 and 1000 specifying how many items to return for each page (if available).\n        If unspecified, the default is 50.</li>\n    <li>pageNumber: number specifying what page of data to retrieve, starting from 1 as the first page.\n        If unspecified, the default is 1.</li>\n</ul>\n<p>A paginated response contains several related fields, such as pageSize, pageNumber, itemCount, totalItems,\n    totalPages, _links (first, last, previous and next pages) and _warning (containing any warning messages,\n    if present).</p>\n<p><b>Sorting query parameters:</b></p>\n<ul>\n    <li>sortBy: the name of the field to sort the results by. If unspecified, no sorting is applied.</li>\n    <li>sortOrder: the case insensitive sorting direction supporting ASC/ASCENDING/NATURAL and\n        DESC/DESCENDING/REVERSE. If unspecified, the default is ASC.</li>\n</ul>\n<h3>API Rate Limiting</h3>\n<p>The API-Service endpoints are rate limited to ensure the stability, availability and performance of\n    the overall system.</p>\n<p>Upon reaching such a rate limit, the endpoints return HTTP Status 429 - Too Many Requests.</p>\n<p>The system will accept further requests once existing in-flight requests are completed.</p>\n",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://{custom-server}/",
      "description": "Default Server URL"
    }
  ],
  "tags": [
    {
      "name": "Maintenance Windows",
      "description": "Maintenance Window CRUD operations"
    }
  ],
  "paths": {
    "/api/devices/{deviceId}/maintenance-windows": {
      "get": {
        "tags": [
          "Maintenance Windows"
        ],
        "summary": "PREVIEW : Retrieves all maintenance windows for a device.",
        "description": "Retrieves all maintenance windows for a given device.<br/><br/><b>NOTE: </b>This endpoint is currently in a preview stage.",
        "operationId": "getMaintenanceWindowsByDeviceId",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "description": "ID of the device for which information needs to be fetched.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful retrieval of maintenance window information.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ListResponseMaintenanceWindowGetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication Failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Device Id not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "API-Access_Token": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        },
        "description": "Error response",
        "example": {
          "status": 400,
          "message": "[ID=2b85998f-26a3-467a] BAD REQUEST: InvalidInputFormatException: Invalid customerId format: 'null'."
        }
      },
      "ValidationError": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Action": {
        "type": "object",
        "properties": {
          "Key": {
            "type": "string"
          },
          "Value": {
            "type": "string"
          }
        },
        "description": "Response for Maintenance Window Action.",
        "example": "             {\n                \"key\": \"Install\",\n                \"value\": \"871a0782-be12-a5c4-c57f-1bd6d9f7144e\",\n              }\n"
      },
      "ApplicableAction": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Action"
            }
          }
        },
        "description": "Request/Response for Maintenance Window ApplicableAction.",
        "example": "            {\n                \"type\": \"Patch\",\n                \"actions\": [\n                    {\n                        \"key\": \"Install\",\n                        \"value\": \"871a0782-be12-a5c4-c57f-1bd6d9f7144e\",\n                    }\n                ]\n            }\n"
      },
      "ListResponseMaintenanceWindowGetResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MaintenanceWindowGetResponse"
            }
          },
          "totalItems": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "MaintenanceWindowGetResponse": {
        "type": "object",
        "properties": {
          "scheduleID": {
            "type": "integer",
            "format": "int32"
          },
          "userName": {
            "type": "string"
          },
          "lastUpdated": {
            "type": "string"
          },
          "applicableAction": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicableAction"
            }
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "cron": {
            "type": "string"
          },
          "duration": {
            "type": "integer",
            "format": "int32"
          },
          "enabled": {
            "type": "boolean"
          },
          "maxDowntime": {
            "type": "integer",
            "format": "int32"
          },
          "rebootMethod": {
            "type": "string"
          },
          "rebootDelay": {
            "type": "integer",
            "format": "int32"
          },
          "downtimeOnAction": {
            "type": "boolean"
          },
          "userMessageEnabled": {
            "type": "boolean"
          },
          "userMessage": {
            "type": "string"
          },
          "messageSenderEnabled": {
            "type": "boolean"
          },
          "messageSender": {
            "type": "string"
          },
          "preserveStateEnabled": {
            "type": "boolean"
          },
          "ruleID": {
            "type": "integer",
            "format": "int32"
          },
          "ruleName": {
            "type": "string"
          }
        },
        "description": "Response for list of Maintenance Windows.",
        "example": {
          "scheduleID": 123456789,
          "userName": "admin",
          "lastUpdated": "2021-09-01T00:00:00Z",
          "applicableAction": [
            {
              "type": "Patch",
              "actions": [
                {
                  "Key": "reboot",
                  "Value": null
                }
              ]
            }
          ],
          "name": "Test Maintenance Window",
          "type": "action",
          "cron": "0 0 0 ? 2 1,4 *",
          "duration": 60,
          "enabled": "true",
          "maxDowntime": "0",
          "rebootMethod": "",
          "rebootDelay": 0,
          "downTimeOnAction": false,
          "userMessageEnabled": false,
          "userMessage": null,
          "messageSenderEnabled": false,
          "messageSender": null,
          "preserveStateEnabled": false,
          "ruleID": 123456789,
          "ruleName": "Test Rule"
        }
      }
    },
    "securitySchemes": {
      "API-Access_Token": {
        "type": "http",
        "description": "Access token for API. You can get the token by authenticating. See \"POST - /api/auth/authenticate\".",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```