---
title: "Finish an Enterprise copy"
url: https://docs.corefinity.com/api/reference/enterprise/finish-enterprise-copy
type: endpoint
last_updated: 2026-11-13
feature: enterprise-copies
related:
  - https://docs.corefinity.com/guides/corestack-enterprise/websites-and-environments.md
---
# Finish an Enterprise copy

Ends a copy whose run has ended, while the site is still protected, its scheduled tasks are off and no
domain is attached; the site stays an ordinary protected site with the copied data. A finished copy cannot
be finished again, but while it is the site's latest copy it can still be re-synced, which makes a new copy.

```http
POST /api/enterprise-copies/{copy}/finish
```

- Scope: `write`
- Two-factor: required on your account (all)
- Rate limit: 5 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

- `copy` (integer, required): The id of a copy, as a start or a re-sync answers it. Digits only; 0 or an id above 2147483647 is refused `422`.

## Request

### curl

```bash
curl -X POST https://manage.corefinity.com/api/enterprise-copies/6201/finish \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
```

### PHP

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

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->post('https://manage.corefinity.com/api/enterprise-copies/6201/finish');

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

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/enterprise-copies/6201/finish', {
  method: 'POST',
  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.post(
    "https://manage.corefinity.com/api/enterprise-copies/6201/finish",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
)

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

## Responses

### 200 The copy is finished.

```json
{
  "copy": {
    "copied": {
      "at": "2026-11-03T12:41:07+00:00",
      "dangling_links": 0,
      "db_bytes": 10522669875,
      "duration_seconds": 2467,
      "files_bytes": 31876710400,
      "neutralised_at": "2026-11-03T12:40:12+00:00",
      "unreadable_files": 0
    },
    "copied_at": "2026-11-03T12:41:07+00:00",
    "copy_of": null,
    "created_at": "2026-11-03T12:00:00+00:00",
    "database_bytes": 10737418240,
    "error": null,
    "failure_reason": null,
    "files_bytes": 32212254720,
    "finishable": false,
    "finished_at": "2026-11-03T15:02:44+00:00",
    "id": 6201,
    "operation": {
      "id": 5141,
      "status": "completed",
      "step": "checked"
    },
    "phase": "done",
    "source_environment_id": 1311,
    "state": "waiting",
    "step": "finished",
    "superseded_by": null,
    "target_cluster_id": 1017,
    "target_site_id": 1081,
    "unactivated_at": "2026-11-03T12:41:05+00:00"
  }
}
```

### 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), or your company requires two-factor authentication and you have not set it up. For routes outside Managed Clusters.

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

### 404 The id does not exist, or it is something you cannot see. Both answer the same body.

```json
{
  "message": "Not found."
}
```

### 409 The copy cannot be finished now. `copy_running` (its run has not ended), `copy_ended` (it is finished, failed or followed by a newer copy), `copy_unchecked` (its checks did not complete: re-sync it), the site's own checks (`target_live`, `target_sends_mail`, `target_unprotected`, `target_crons_on`), `target_not_ready` (the site is gone) or `managed_elsewhere`.

```json
{
  "code": "copy_ended",
  "message": "This copy has ended already.",
  "reason": "copy_ended"
}
```

### 422 The copy's id in the path is not a whole number from 1 to 2147483647.

```json
{
  "code": "invalid",
  "errors": {
    "copy": [
      "The copy must be a whole number from 1 to 2147483647."
    ]
  },
  "field": "copy",
  "message": "The copy must be a whole number from 1 to 2147483647.",
  "reason": "invalid"
}
```

### 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 |  | Check the id. You see only what your account can reach. |
| 409 | `copy_ended` | The copy has ended already. Start a new copy. |
| 409 | `copy_running` | The copy is still running. Wait for its run to end. |
| 409 | `copy_unchecked` | The copy's checks did not complete, so it cannot be finished. Re-sync it. |
| 409 | `target_crons_on` | The site to copy into has its scheduled tasks on. Switch them off before copying into it. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Websites and environments](https://docs.corefinity.com/guides/corestack-enterprise/websites-and-environments.md)
