> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# List maintenance windows

`GET https://api.pagerduty.com/maintenance_windows`

List existing maintenance windows, optionally filtered by service and/or team, or whether they are from the past, present or future.

A Maintenance Window is used to temporarily disable one or more Services for a set period of time.

For more information see the [API Concepts Document](https://docs.pagerduty.com/developer/api-concepts#maintenance-windows)

Scoped OAuth requires: `services.read`

## Authorization

- **api_key** (apiKey) — `Authorization` header. The API Key with format `Token token=<API_KEY>`

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `query` | string |  | Filters the result, showing only the records whose name matches the query. |
| `limit` | integer |  | The number of results per page. |
| `offset` | integer |  | Offset to start pagination search results. |
| `total` | boolean |  | By default the `total` field in pagination responses is set to `null` to provide the fastest possible response times. Set `total` to `true` for this field to be populated. See our [Pagination Docs](https://docs.pagerduty.com/developer/pagination) for more information. Default: `false`. |
| `team_ids[]` | array of string |  | An array of team IDs. Only results related to these teams will be returned. Account must have the `teams` ability to use this parameter. Items must be unique. |
| `service_ids[]` | array of string |  | An array of service IDs. Only results related to these services will be returned. |
| `include[]` | string |  | Array of additional Models to include in response. One of: `teams`, `services`, `users`. Items must be unique. |
| `filter` | string |  | Only return maintenance windows in a given state. One of: `past`, `future`, `ongoing`, `open`, `all`. |

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Accept` | string | yes | The `Accept` header is used as a versioning header. Default: `application/vnd.pagerduty+json;version=2`. |

## Response 200

A paginated array of maintenance windows.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `offset` | integer |  | Echoes offset pagination property. Read-only. |
| `limit` | integer |  | Echoes limit pagination property. Read-only. |
| `more` | boolean |  | Indicates if there are additional records to return. Read-only. |
| `total` | integer \| null |  | The total number of records matching the given query. Read-only. |
| `maintenance_windows` | array of object | yes |  |
| `maintenance_windows[].id` | string |  | Read-only. |
| `maintenance_windows[].summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `maintenance_windows[].type` | string | yes | The type of object being created. One of: `maintenance_window`. Default: `maintenance_window`. |
| `maintenance_windows[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `maintenance_windows[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `maintenance_windows[].sequence_number` | integer |  | The order in which the maintenance window was created. Read-only. |
| `maintenance_windows[].start_time` | string (date-time) | yes | This maintenance window's start time. This is when the services will stop creating incidents. If this date is in the past, it will be updated to be the current time. |
| `maintenance_windows[].end_time` | string (date-time) | yes | This maintenance window's end time. This is when the services will start creating incidents again. This date must be in the future and after the `start_time`. |
| `maintenance_windows[].description` | string |  | A description for this maintenance window. |
| `maintenance_windows[].created_by` | object |  |  |
| `maintenance_windows[].created_by.id` | string | yes | Read-only. |
| `maintenance_windows[].created_by.summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `maintenance_windows[].created_by.type` | string | yes | One of: `user_reference`. |
| `maintenance_windows[].created_by.self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `maintenance_windows[].created_by.html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `maintenance_windows[].services` | array of object | yes |  |
| `maintenance_windows[].services[].id` | string | yes | Read-only. |
| `maintenance_windows[].services[].summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `maintenance_windows[].services[].type` | string | yes | One of: `service_reference`. |
| `maintenance_windows[].services[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `maintenance_windows[].services[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `maintenance_windows[].teams` | array of object |  | Read-only. |
| `maintenance_windows[].teams[].id` | string | yes | Read-only. |
| `maintenance_windows[].teams[].summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `maintenance_windows[].teams[].type` | string | yes | One of: `team_reference`. |
| `maintenance_windows[].teams[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `maintenance_windows[].teams[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |

Example: Response Example

```json
{
  "maintenance_windows": [
    {
      "id": "PW98YIO",
      "type": "maintenance_window",
      "summary": "Immanentizing the eschaton",
      "self": "https://api.pagerduty.com/maintenance_windows/PW98YIO",
      "html_url": "https://subdomain.pagerduty.com/service-directory/maintenance-windows/PW98YIO",
      "sequence_number": 1,
      "start_time": "2015-11-09T20:00:00-05:00",
      "end_time": "2015-11-09T22:00:00-05:00",
      "description": "Immanentizing the eschaton",
      "services": [
        {
          "id": "PIJ90N7",
          "type": "service_reference",
          "summary": "My Mail Service",
          "self": "https://api.pagerduty.com/services/PIJ90N7",
          "html_url": "https://subdomain.pagerduty.com/service-directory/PIJ90N7"
        }
      ],
      "teams": [
        {
          "id": "PQ9K7I8",
          "type": "team_reference",
          "summary": "Engineering",
          "self": "https://api.pagerduty.com/teams/PQ9K7I8",
          "html_url": "https://subdomain.pagerduty.com/teams/PQ9K7I8"
        }
      ],
      "created_by": {
        "id": "PXPGF42",
        "type": "user_reference",
        "summary": "Earline Greenholt",
        "self": "https://api.pagerduty.com/users/PXPGF42",
        "html_url": "https://subdomain.pagerduty.com/users/PXPGF42"
      }
    }
  ],
  "limit": 25,
  "offset": 0,
  "more": false,
  "total": null
}
```

## Response 400

Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 401

Caller did not supply credentials or did not provide the correct credentials.
If you are using an API key, it may be invalid or your Authorization header may be malformed.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 403

Caller is not authorized to view the requested resource.
While your authentication is valid, the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 429

Too many requests have been made, the rate limit has been reached.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
