---
title: "Long-running work"
url: https://docs.corefinity.com/api/long-running-work
type: page
last_updated: 2026-11-13
feature: api
---
# Long-running work

Changes that take time answer an operation, which you read until it finishes.

A change that cannot finish within the request answers an operation. Read the operation until its `status` is `completed` or `failed`.

## What a change answers

| Status | Body                                                 | Meaning                                                                           |
| ------ | ---------------------------------------------------- | --------------------------------------------------------------------------------- |
| `201`  | An operation, or an object with an `operation` field | The work has started                                                              |
| `202`  | An operation, or an object with an `operation` field | The work is accepted. The operation's `status` says whether it has started        |
| `200`  | `"operation": null`                                  | Nothing differed, so nothing was started                                          |
| `201`  | `"queued": true` and `"operation": null`             | The change waits for a window; see [Apply now or in a window](/api/apply-windows) |

A Varnish change answers `202` both when it has started and when it waits for a window. Check `queued` first, then the operation's `status`.

## Read an operation

`GET /corestack/operations/{operation}` needs the `read` scope. Reading checks progress first when the last check is a few seconds old, so one request every few seconds is enough.

```bash
curl https://manage.corefinity.com/api/corestack/operations/77120 \
  -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json"
```

```json
{
  "id": 77120,
  "type": "php_version",
  "status": "completed",
  "from_version": "8.2",
  "to_version": "8.3",
  "steps": [{ "key": "saved", "label": "Saved", "state": "done" }],
  "error": null,
  "created_at": "2026-10-24T09:12:03Z",
  "completed_at": "2026-10-24T09:14:41Z"
}
```

The answer carries more fields than shown here; the operation's reference page lists them all. Applying pending changes now answers a shorter operation of its own shape.

## Statuses

| `status`      | `status_label`           | Final |
| ------------- | ------------------------ | ----- |
| `pending`     | Saving change            | No    |
| `committed`   | Waiting for the platform | No    |
| `rolling_out` | Applying change          | No    |
| `executing`   | Running                  | No    |
| `completed`   | Done                     | Yes   |
| `failed`      | Failed                   | Yes   |

While an operation is not final, another change to the same site is refused `409` `busy`.

A new site or environment can wait before its work starts: its `status` stays `pending` and its `status_label` reads `Waiting for the platform` or `Waiting for DNS`. It carries on by itself, so do not create it again.

## When an operation fails

`error` says why in plain words, and `failure_reason` carries a stable code where there is one.

Not every failed operation can be retried: read its `can_retry`. While it is `true`, `POST /corestack/operations/{operation}/retry` carries on from where the operation stopped.

When `retry_requires` is `acknowledge_env`, check the site's `.env` file first and send `"acknowledge_env": true` with the retry.

While `can_retry` is `false`, a retry is refused: make the change again. The retry's reference page lists its refusals and what to do about each.

A failed site or environment creation is never retried this way, and the retry answers `422` `not_retryable`: ask Corefinity to retry it, or delete the site or environment and create it again.

## Results shown once

An operation never carries a secret. Where work creates a login, `POST /corestack/operations/{operation}/reveal` answers it once, with the `exec` scope; a second request is refused `409` `already_revealed`.

## Work followed on its own endpoint

Most changes answer an operation read with `GET /corestack/operations/{operation}`. Some areas follow their work on an endpoint of their own, which the request's reference page names.

Read it the same way: every few seconds, until its status is final.

| Read this                                                        | What it does                        |
| ---------------------------------------------------------------- | ----------------------------------- |
| `GET /corestack/operations/{operation}`                          | Get an operation                    |
| `GET /enterprise-copies/{copy}`                                  | Get an Enterprise copy              |
| `GET /environments/{environment}/deployments/{deployment}`       | Get a deployment                    |
| `GET /performance-audits/{audit}`                                | Get a performance audit             |
| `GET /performance-audits/{audit}/gtmetrix-reports`               | List an audit's GTmetrix reports    |
| `GET /corestack/sites/{site}/access/operations/{operation}`      | Get an access operation             |
| `GET /corestack/commands/{command}`                              | Get a command                       |
| `GET /corestack/sites/{site}/database/operations/{operation}`    | Get a database operation            |
| `GET /corestack/sites/{site}/deployments/rehearsals/{rehearsal}` | Get a rehearsal                     |
| `GET /corestack/sites/{site}/email/operations/{operation}`       | Get an email operation              |
| `GET /corestack/sites/{site}/error-pages/operations/{operation}` | Get an error pages operation        |
| `GET /firewall/changes/{change}`                                 | Get a firewall change               |
| `GET /corestack/logs/exports/{download}`                         | Get a logs export                   |
| `GET /corestack/clusters/{cluster}/progress`                     | Get a CoreCluster's create progress |
| `GET /corestack/sites/{site}/nginx-rules/operations/{operation}` | Get an Nginx rules operation        |
| `GET /corestack/sites/{site}/pagespeed`                          | Get a site's PageSpeed history      |
| `GET /environments/{environment}/ssh/host-keys`                  | Get an environment's host keys      |
| `GET /ssh/changes/{change}`                                      | Get an SSH change                   |
| `GET /corestack/sites/{site}/varnish/operations/{operation}`     | Get a Varnish operation             |

A snapshot is followed on its own endpoint too: read `GET /corestack/snapshots/{snapshot}` until its `status` is `ready` or `failed`.
