---
title: "Toggle Automatic Deferral of Maintenance for One Project"
method: POST
path: "/api/atlas/v2/groups/{groupId}/maintenanceWindow/autoDefer"
tags: ["Maintenance Windows"]
---

# Toggle Automatic Deferral of Maintenance for One Project

`POST /api/atlas/v2/groups/{groupId}/maintenanceWindow/autoDefer`

Toggles automatic deferral of the maintenance window for the specified project. When automatic deferral is enabled, all maintenance windows are deferred for one week. This endpoint controls the same underlying feature as the `autoDeferOnceEnabled` field in the PATCH `/maintenanceWindow` endpoint. The difference is that this endpoint toggles the current value (switches from enabled to disabled or vice versa), while the `autoDeferOnceEnabled` field allows you to set a specific value. For most use cases, the PATCH endpoint with `autoDeferOnceEnabled` is recommended because it allows setting an explicit value rather than toggling.

## Path parameters

- `groupId` string, required

## Query parameters

- `envelope` boolean

## Response `200`

OK

## Other responses

- `400` — Bad Request.
- `401` — Unauthorized.
- `403` — Forbidden.
- `404` — Not Found.
- `429` — Too Many Requests.
- `500` — Internal Server Error.

---

[API](https://skmtc.dev/mongodb/apis/atlas-admin-api.md) · [All operations](https://skmtc.dev/mongodb/apis/atlas-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mongodb/atlas-admin-api/revisions/e37e8ef8429f/schema)
