*This page
applies to **Apigee** , but not to **Apigee hybrid**.*


*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*
![](https://fonts.gstatic.com/s/i/googlematerialicons/help/v13/gm_grey-24dp/1x/gm_help_gm_grey_24dp.png)

This section has procedures for finding and setting maintenance windows for Apigee resources. To learn more about how and why Apigee performs maintenance, see [Maintenance overview](https://docs.cloud.google.com/apigee/docs/api-platform/system-administration/maintenance.md.txt).

## Set a preferred window for maintenance

If a resource is already undergoing maintenance or has a scheduled maintenance event, any changes you make to the maintenance window setting (including changing the day/time, changing the update order, or clearing the settings) do not apply to the pending event. The scheduled maintenance proceeds as planned, and your changes apply only to future maintenance rollouts.

If you've opted in to maintenance notifications, then Apigee sends you notifications after a resource has been scheduled for maintenance, with the exact date and time when the maintenance is scheduled to happen. Apigee sends these notifications based on your resource maintenance window order of update settings, as follows:

**Note:** "Week 1" and "Week 2" refer to the rollout phases and notification lead times (1 week versus 2 weeks). They do **not** refer to the first or second calendar week of the month. For example, a "Week 2" rollout does not necessarily happen in the second week of a calendar month. It happens one week after the "Week 1" rollout for that specific release.

- If the order of update setting is set to Week 1, then Apigee sends maintenance notifications at least one week in advance.
- If the order of update setting is set to Week 2, then Apigee sends maintenance notifications at least two weeks in advance.

You can only specify one maintenance window per Apigee instance. Requests with more than one maintenance window will be rejected.

If you would like to set maintenance windows for multiple instances in the same organization you should ensure at least 12 hours between the maintenance windows to avoid overlapping maintenance operations.

When updating the maintenance window, the previous window will be overwritten.

> [!NOTE]
> To perform this task, you must have the [Apigee Organization Admin](https://cloud.google.com/iam/docs/roles-permissions/apigee) role (`roles/apigee.admin`) or a role that includes the `apigee.instances.update` permission.

    AUTH="Authorization: Bearer $(gcloud auth print-access-token)"
    curl -X PATCH \
      -H "$AUTH" \
      -H "Content-Type: application/json" \
      -d '{
        "maintenanceUpdatePolicy": {
          "maintenanceWindows": [
            {
              "day": "SUNDAY",
              "startTime": {
                "hours": 23
              }
            }
          ],
          "maintenanceChannel": "WEEK1"
        }
      }' \
      "https://apigee.googleapis.com/v1/organizations/ORGANIZATION_ID/instances/INSTANCE_ID?updateMask=maintenanceUpdatePolicy.maintenanceWindows,maintenanceUpdatePolicy.maintenanceChannel"


Where:

- Maintenance `startTime` is configured in UTC.
- `maintenanceChannel`: The maintenance channel/order of update setting (e.g., `WEEK1` or `WEEK2`).
- **<var translate="no">ORGANIZATION_ID</var>** is your Apigee organization ID.
- **<var translate="no">INSTANCE_ID</var>** is your Apigee instance ID.

<br />

## Find existing maintenance settings and maintenance schedules

You can retrieve your current maintenance settings and view any upcoming maintenance by checking the `maintenanceUpdatePolicy` and `scheduledMaintenance` fields, as shown in the following API example:

> [!NOTE]
> To perform this task, you must have a role that includes the `apigee.instances.get` permission.

    AUTH="Authorization: Bearer $(gcloud auth print-access-token)"
    curl -H "$AUTH" \
      "https://apigee.googleapis.com/v1/organizations/ORGANIZATION_ID/instances/INSTANCE_ID"

Where:

- **<var translate="no">ORGANIZATION_ID</var>** is your Apigee organization ID.
- **<var translate="no">INSTANCE_ID</var>** is your Apigee instance ID.

<br />

Example output

```
{
  ...
  "scheduledMaintenance": {
    "startTime": "2025-01-28T23:00:00Z"
  },
  "maintenanceUpdatePolicy": {
    "maintenanceWindows": [
      {
        "day": "SUNDAY",
        "startTime": {
          "hours": 23
        }
      }
    ],
    "maintenanceChannel": "WEEK1"
  }
}
```

## Clear maintenance settings

If you no longer require maintenance settings you can clear them by following the instructions below.

> [!NOTE]
> To perform this task, you must have the [Apigee Organization Admin](https://cloud.google.com/iam/docs/roles-permissions/apigee) role (`roles/apigee.admin`) or a role that includes the `apigee.instances.update` permission.

    AUTH="Authorization: Bearer $(gcloud auth print-access-token)"
    curl -X PATCH \
      -H "$AUTH" \
      -H "Content-Type: application/json" \
      -d '{
        "maintenanceUpdatePolicy": null
      }' \
      "https://apigee.googleapis.com/v1/organizations/ORGANIZATION_ID/instances/INSTANCE_ID?updateMask=maintenanceUpdatePolicy"

Where:

- **<var translate="no">ORGANIZATION_ID</var>** is your Apigee organization ID.
- **<var translate="no">INSTANCE_ID</var>** is your Apigee instance ID.

<br />

## Opt-in to maintenance notifications

Before you opt-in for maintenance notifications, you must
[set a preferred window for maintenance](https://docs.cloud.google.com/apigee/docs/api-platform/system-administration/maintenance-windows.md.txt#set-a-preferred-window-for-maintenance) on a resource.

1. In the Google Cloud console, go to the **User preferences \> Communication** page.

   [Go to Communications](https://console.cloud.google.com/user-preferences/communication)
2. In the row for **Apigee, Maintenance window** , select the radio button under **Email** to turn it **On**.

Each user that needs to receive notifications must opt in separately by following the
above instructions.