---
title: "Cancel a copy that waits its turn"
url: https://docs.corefinity.com/api/reference/environments/cancel-queued-copy
type: endpoint
last_updated: 2026-11-13
feature: copies
related:
  - https://docs.corefinity.com/guides/sites/environments-and-copies/clone-a-site.md
  - https://docs.corefinity.com/mcp/tools/corestack_queued_copy_cancel.md
---
# Cancel a copy that waits its turn

Cancels a queued copy while its `state` is `waiting`, so nothing is copied. A copy that is being started
(`starting`), has started, or ended without starting answers `409` here; one that has started runs to its end.

```http
DELETE /api/corestack/copy-queue/{queued}
```

- Scope: `write`
- Two-factor: required on your account (all)
- Rate limit: 10 a minute
- Try it in the console: off. It has not been cleared for the console. Copy the request and run it yourself when you are sure.

## Path parameters

- `queued` (integer, required): The id of the waiting copy, `queued.id` in the answer that queued it. Digits only.

## Request

### curl

```bash
curl -X DELETE https://manage.corefinity.com/api/corestack/copy-queue/1 \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->delete('https://manage.corefinity.com/api/corestack/copy-queue/1');

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/copy-queue/1', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
  },
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.delete(
    "https://manage.corefinity.com/api/corestack/copy-queue/1",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
)

data = res.json() if res.content else None
```

## Responses

### 200 The copy was cancelled before it started.

```json
{
  "queued": {
    "ahead": null,
    "deadline_at": "2026-11-03T13:00:00Z",
    "ended_at": "2026-11-03T07:02:31Z",
    "id": 6120,
    "message": "Cancelled before it started.",
    "operation_id": null,
    "queued_at": "2026-11-03T07:00:00Z",
    "reason": "cancelled",
    "source": {
      "id": 1042,
      "name": "Production"
    },
    "state": "cancelled",
    "target": {
      "id": 1043,
      "name": "Staging"
    }
  }
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the scope (`scope_required`, with the `scope` to use), your company requires two-factor authentication and you have not set it up, or your account has no company that can use Managed Clusters, for example because the company was closed (`company_unavailable` or `company_not_enabled`, whichever the route checks first). For Managed Clusters routes; any other route uses `ForbiddenScopeOrTwoFactor`.

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 404 The id does not exist or is something you cannot see, or the feature is not on for your company (`feature_off`).

```json
{
  "code": "feature_off",
  "message": "Not found.",
  "reason": "feature_off"
}
```

### 409 The copy is no longer waiting (`not_waiting`): it is being started, has started, or ended without starting. `queued` carries the entry as it stands now.

```json
{
  "code": "not_waiting",
  "message": "This copy is no longer waiting, so it cannot be cancelled.",
  "queued": {
    "ahead": null,
    "deadline_at": "2026-11-03T13:00:00Z",
    "ended_at": "2026-11-03T07:02:31Z",
    "id": 6120,
    "message": "Cancelled before it started.",
    "operation_id": null,
    "queued_at": "2026-11-03T07:00:00Z",
    "reason": "cancelled",
    "source": {
      "id": 1042,
      "name": "Production"
    },
    "state": "cancelled",
    "target": {
      "id": 1043,
      "name": "Staging"
    }
  },
  "reason": "not_waiting"
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | Send a valid token as `Authorization: Bearer <token>`. |
| 403 | `company_unavailable` | Your company is unavailable. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 403 | `two_factor_required` | Turn on two-factor on your account, then send again. |
| 404 | `feature_off` | This feature is not on for your organisation yet. |
| 409 | `not_waiting` | This copy is no longer waiting, so it cannot be cancelled. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Clone an environment](https://docs.corefinity.com/guides/sites/environments-and-copies/clone-a-site.md)
- MCP tool: [`corestack_queued_copy_cancel`](https://docs.corefinity.com/mcp/tools/corestack_queued_copy_cancel.md)
