---
title: "Apply now or in a window"
url: https://docs.corefinity.com/api/apply-windows
type: page
last_updated: 2026-11-13
feature: api
---
# Apply now or in a window

Some changes can wait for the site's maintenance window instead of applying at once.

Endpoints whose change is applied in a maintenance window take an `apply` field in the JSON body. An endpoint without `apply` on its reference page cannot be queued this way.

An endpoint whose `apply` lists `now` alone always applies at once, and is not in the tables below.

## Changes that take `apply`

| Change                                                                 | What it does                                 |
| ---------------------------------------------------------------------- | -------------------------------------------- |
| `PUT /corestack/sites/{site}/mariadb-version`                          | Update a site's MariaDB version              |
| `PUT /corestack/sites/{site}/php-version`                              | Update a site's PHP version                  |
| `PUT /corestack/sites/{site}/addons`                                   | Update a site's add-ons                      |
| `POST /corestack/clusters/{cluster}/compute-family`                    | Switch a CoreCluster's server type           |
| `POST /corestack/sites/{site}/compute-family`                          | Switch a site's server type                  |
| `PATCH /corestack/sites/{site}/environment`                            | Update an environment                        |
| `POST /corestack/sites/{site}/package`                                 | Update a site's package                      |
| `PUT /corestack/sites/{site}/nginx-rules`                              | Replace a site's Nginx rules                 |
| `POST /corestack/sites/{site}/nginx-rules/copy`                        | Copy Nginx rules between environments        |
| `POST /corestack/sites/{site}/nginx-rules/revisions/{revision}/revert` | Restore an Nginx revision                    |
| `PUT /corestack/sites/{site}/node-runtime`                             | Update a site's Node.js configuration        |
| `PUT /corestack/sites/{site}/php-runtime`                              | Update a site's PHP configuration            |
| `POST /corestack/sites/{site}/php-runtime/apply-to`                    | Copy PHP configuration to other environments |
| `POST /corestack/sites/{site}/php-runtime/revert`                      | Restore a PHP configuration revision         |
| `PUT /corestack/sites/{site}/php-settings`                             | Update memory, upload and execution limits   |
| `POST /corestack/sites/{site}/runtime/adopt`                           | Move a site onto the runtime                 |
| `POST /corestack/sites/{site}/varnish`                                 | Update a site's Varnish switch by POST       |
| `PUT /corestack/sites/{site}/varnish`                                  | Update a site's Varnish switch               |
| `PUT /corestack/sites/{site}/varnish/version`                          | Update a site's Varnish version              |

## Values

| `apply`   | Meaning                                                 |
| --------- | ------------------------------------------------------- |
| `now`     | Apply at once. The default                              |
| `tonight` | Queue the change for the site's next maintenance window |
| `window`  | The same as `tonight`                                   |

`window` is accepted while maintenance windows are on for your company. Otherwise it is refused `422` on `apply`.

## The queued answer

A queued change answers `201` with no operation, because nothing has started.

A queued Varnish change answers `202` with the same body.

```json
{
  "operation": null,
  "queued": true,
  "window_date": "2026-11-04",
  "item_id": 5012,
  "window": {
    "starts_at": "2026-11-04T00:00:00Z",
    "ends_at": "2026-11-04T04:00:00Z",
    "label": "00:00–04:00 UK time",
    "source": "platform",
    "policy": "site"
  }
}
```

| Field         | Meaning                                                                                          |
| ------------- | ------------------------------------------------------------------------------------------------ |
| `window_date` | The date of the window the change waits for                                                      |
| `item_id`     | The id of the pending change, used to cancel it                                                  |
| `window`      | The window itself. Present only while maintenance windows are on for your company; may be `null` |

## Pending changes

Queued changes can be read, applied early or cancelled. These endpoints answer `404` `feature_off` when queued changes are not on for your company.

| Endpoint                                                 | Scope   | Does                                                                                             |
| -------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------ |
| `GET /corestack/sites/{site}/pending-changes`            | `read`  | Lists what waits and for which window                                                            |
| `POST /corestack/sites/{site}/pending-changes/apply-now` | `write` | Applies them all now with `{"confirm": true}` and answers an [operation](/api/long-running-work) |
| `DELETE /corestack/sites/{site}/pending-changes/{item}`  | `write` | Cancels one of your changes                                                                      |
| `GET /corestack/pending-changes/attention`               | `read`  | Lists queued changes and recent failed windows across your sites                                 |

## Refusals

| Status | `reason`                        | What to do                                                     |
| ------ | ------------------------------- | -------------------------------------------------------------- |
| `422`  | `feature_off`                   | `tonight` is not available for your company; send `apply: now` |
| `422`  | `confirm`                       | Send `{"confirm": true}` with apply-now                        |
| `409`  | `nothing_pending`               | Nothing is queued                                              |
| `409`  | `batch_window`, `batch_running` | The window is running; wait for it to finish                   |
| `409`  | `item_state`                    | The change was already applied or cancelled, or is not yours   |
