---
title: "Restore a deleted site"
url: https://docs.corefinity.com/api/reference/sites/restore-deleted-site
type: endpoint
last_updated: 2026-11-13
feature: restore-deleted
related:
  - https://docs.corefinity.com/mcp/tools/corestack_site_restore_deleted.md
---
# Restore a deleted site

Brings a deleted site back while it can still be restored. The site counts against its CoreCluster again, so
the restore is checked as a create is and may grow the CoreCluster when automatic upgrades are on. Only a
restore that is accepted counts towards the rate limit.

```http
POST /api/corestack/sites/{site}/restore-deleted
```

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

## Path parameters

- `site` (integer, required): The id of a site row. A website's production site and each of its environments has its own id. Digits only.

## Request

### curl

```bash
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/restore-deleted \
  -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/corestack/sites/1042/restore-deleted');

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

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/restore-deleted', {
  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/corestack/sites/1042/restore-deleted",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
)

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

## Responses

### 200 The site, restored.

```json
{
  "site": {
    "deleted": null,
    "domain": "harbourandfinch.example.com",
    "health": "unknown",
    "id": 1042,
    "kind": "corecluster",
    "lifecycle": "active",
    "limits": {
      "cpu_millicores": 2000,
      "disk_bytes": 10737418240,
      "memory_bytes": 4294967296
    },
    "mariadb": {
      "version": "11.8"
    },
    "mode": "production",
    "mode_label": "Domain attached",
    "operation": null,
    "php": {
      "version": "8.3"
    },
    "primary_url": "https://harbourandfinch.example.com",
    "removed": false,
    "tier": "S",
    "usage": {
      "cpu_millicores": null,
      "disk_used_bytes": null,
      "memory_bytes": null,
      "observed_at": null,
      "source": null
    }
  }
}
```

### 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 site cannot be restored now. `reason` says why.

```json
{
  "code": "capacity_blocked",
  "dimension": "memory",
  "message": "Not enough capacity left on this cluster for a M WordPress site (adds about 1536 MB; 29.4 of 32 GB in use over the last 24 h). Upgrade the package.",
  "reason": "capacity_blocked"
}
```

### 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
}
```

### 502 The site was restored but could not be started.

```json
{
  "message": "The site was restored but could not be started. Contact Corefinity support to have it started."
}
```

### 503 Corefinity has switched this action off for the moment. Try again later.

```json
{
  "code": "switched_off",
  "message": "Deleting is switched off at the moment",
  "reason": "switched_off",
  "switch": "delete"
}
```

## 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 | `capacity_blocked` | The cluster does not have room for this. Free some capacity, choose a smaller size, or move to a larger package. |
| 409 | `cluster_deleting` | The cluster is being deleted. Nothing can be changed on it. |
| 409 | `conflict` | The action conflicts with the object's present state. Read the message. |
| 409 | `deleted` | The site, environment or copy has been deleted, or is being deleted. Nothing can be changed on it. Restore a deleted site first if it can still be restored. |
| 409 | `deletion_in_progress` | The site is still being deleted. Try again once it shows as deleted. |
| 409 | `managed_elsewhere` | This site is read-only here. Change it in the control panel that manages it. |
| 409 | `not_restorable` | A deleted environment cannot be restored: environments are removed at once. Recreate it from its final snapshot. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |
| 502 |  | Read the message; it says what happened. |
| 503 | `switched_off` | Corefinity has switched this action off for the moment. Try again later. |

## The same task elsewhere

- MCP tool: [`corestack_site_restore_deleted`](https://docs.corefinity.com/mcp/tools/corestack_site_restore_deleted.md)
