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

Copies the environment's files and database into the site, replacing everything the site holds; nothing is
written on the environment. Send the site's name as `confirm_target_site`, as the preview answers it in
`confirm`, then read the copy at `poll` until `state` is no longer `running`.

```http
POST /api/enterprise-copies
```

- Scope: `write`
- Two-factor: required on your account (all)
- Rate limit: 5 a minute
- Long-running: answers with an operation to poll
- Try it in the console: off. It overwrites data that cannot be brought back. Copy the request and run it yourself when you are sure.

## Body

- `confirm_target_site` (string, required): The site's name, as the preview answers it in `confirm`.
- `enterprise_env_id` (integer, required): The CoreStack Enterprise environment to copy from.
- `target_site_id` (integer, required): The CoreCluster site to copy into. Everything it holds is replaced.

## Request

### curl

```bash
curl -X POST https://manage.corefinity.com/api/enterprise-copies \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "confirm_target_site": "harbourandfinch-example-com-staging",
    "enterprise_env_id": 1312,
    "target_site_id": 1043
  }'
```

### PHP

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

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->post('https://manage.corefinity.com/api/enterprise-copies', [
        'confirm_target_site' => 'harbourandfinch-example-com-staging',
        'enterprise_env_id' => 1312,
        'target_site_id' => 1043,
    ]);

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

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/enterprise-copies', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    confirm_target_site: 'harbourandfinch-example-com-staging',
    enterprise_env_id: 1312,
    target_site_id: 1043,
  }),
});

// 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",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "confirm_target_site": "harbourandfinch-example-com-staging",
        "enterprise_env_id": 1312,
        "target_site_id": 1043,
    },
)

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

## Responses

### 202 The copy started. Follow it at `poll`.

```json
{
  "copy": {
    "copied": null,
    "copied_at": null,
    "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": null,
    "id": 6202,
    "operation": {
      "id": 5142,
      "status": "executing",
      "step": "protected"
    },
    "phase": "presync",
    "source_environment_id": 1312,
    "state": "running",
    "step": "guard",
    "superseded_by": null,
    "target_cluster_id": 1017,
    "target_site_id": 1043,
    "unactivated_at": null
  },
  "poll": "/api/enterprise-copies/6202"
}
```

### 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 start now. `reason` says why, and `message` is the preview's first blocker word for word. About the site: `platform_cluster` (it is not on a CoreCluster of your own), `other_company`, `target_not_ready`, `target_live`, `target_sends_mail`, `target_unprotected`, `target_crons_on`, `platform_mismatch`, `copy_exists`, `target_busy`, `target_moving`, `target_too_small`. About the environment: `source_unsupported`, `ssh_unreachable`, `source_moving`, `no_mail_neutraliser`. While copies are paused: `neutralise_off`, `consumer_hold_off`. A site with a change, a restore or a deployment under way can also answer the refusal any change to it meets, such as `busy`.

```json
{
  "code": "consumer_hold_off",
  "message": "Copies are paused at the moment. Try again later.",
  "reason": "consumer_hold_off"
}
```

### 422 An id is missing or is not a whole number from 1 to 2147483647 (`invalid`; `copy` names the id in the path), or `confirm_target_site` is missing or is not the site's name (`confirm_mismatch`).

```json
{
  "code": "confirm_mismatch",
  "field": "confirm_target_site",
  "message": "Type the site's name (harbourandfinch-example-com-trial) to confirm: the copy replaces its files and its database.",
  "reason": "confirm_mismatch"
}
```

### 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 | `consumer_hold_off` | Copies are paused at the moment. Try again later. |
| 409 | `copy_exists` | The target already has an unfinished copy. Finish or re-sync that one. |
| 409 | `neutralise_off` | Copies are paused at the moment. Try again later. |
| 409 | `platform_mismatch` | The site and the environment run different platforms. Copy into a site of the same platform. |
| 409 | `source_moving` | The environment has a move open, or has moved to CoreStack. Copy it once the move is settled, or copy from its new site. |
| 409 | `source_unsupported` | This environment cannot be copied as it is. Contact support to find out why. |
| 409 | `target_busy` | The environment to copy or restore into is busy with another change. Nothing was changed. Wait, then try again. |
| 409 | `target_crons_on` | The site to copy into has its scheduled tasks on. Switch them off before copying into it. |
| 409 | `target_live` | The site to copy into has a domain attached, and a copy never overwrites a live site. Choose a site that is not live. |
| 409 | `target_not_ready` | The site to copy into is not ready to take a copy. Read the message: wait until it is ready, or choose another site. |
| 409 | `target_too_small` | The site's disk (20.0 GiB) cannot hold this copy (40.0 GiB of files and database). |
| 409 | `target_unprotected` | The site to copy into is not protected by HTTP authentication over the whole environment. Protect it first: copied data must never be public. |
| 422 | `confirm_mismatch` | Send the confirmation exactly as the field named in `field` asks for 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)
