---
title: "Check a site's shared files"
url: https://docs.corefinity.com/api/reference/deployments/check-site-deployment-shared-files
type: endpoint
last_updated: 2026-11-13
feature: deployments
related:
  - https://docs.corefinity.com/guides/sites/code-and-deployments/connect-a-repository.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_shared_files_check.md
---
# Check a site's shared files

Checks that the settings file the site's platform needs is in the shared folder a deployment links it from,
and says where to create a missing one. The check only advises: deploying works as before whatever it
answers. It reads the site's files, so the site must be running.

```http
GET /api/corestack/sites/{site}/deployments/shared-files
```

- Scope: `read`
- 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

- `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.

## Query parameters

- `for` (string): What the check is for. `rehearsal` also accepts a file in an `htdocs` folder that is not in the releases layout yet.

## Request

### curl

```bash
curl https://manage.corefinity.com/api/corestack/sites/1042/deployments/shared-files \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
```

### PHP

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

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->get('https://manage.corefinity.com/api/corestack/sites/1042/deployments/shared-files');

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

### Node

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

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

## Responses

### 200 The state of each file the site needs.

```json
{
  "files": [
    {
      "message": "/var/www/harbourandfinch.example.com/shared/.env is not on this environment yet. Create it over SFTP or SSH before you deploy: without it the deployment stops at linking shared files, and the site keeps serving its current release. If your repository includes .env, the deployment keeps that copy instead.",
      "path": ".env",
      "shared_path": "/var/www/harbourandfinch.example.com/shared/.env",
      "status": "missing"
    }
  ],
  "for": "deployment",
  "message": "1 file this environment needs is missing from its shared folder. You can still start, but the deployment will stop before it goes live.",
  "state": "missing"
}
```

### 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 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 is not running (`not_running`).

```json
{
  "code": "not_running",
  "message": "The site is not running",
  "reason": "not_running"
}
```

### 422 `for` is not `deployment` or `rehearsal`.

```json
{
  "code": "invalid",
  "detail_reason": "string",
  "errors": {},
  "field": "string",
  "message": "string",
  "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
}
```

### 503 Corefinity has switched site commands off for the moment (`switched_off`, with `switch` `exec`), or the site's files could not be read (`temporarily_unavailable`). Try again in a moment.

```json
{
  "code": "switched_off",
  "message": "Site commands are switched off at the moment",
  "reason": "switched_off",
  "switch": "exec"
}
```

## 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_running` | The site, environment or deployment is not running. Read the message: where it can be started or will recover, start it or wait, then try again. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |
| 503 | `switched_off` | Corefinity has switched this action off for the moment. Try again later. |

## The same task elsewhere

- Guide: [Connect a repository](https://docs.corefinity.com/guides/sites/code-and-deployments/connect-a-repository.md)
- MCP tool: [`corestack_deployments_shared_files_check`](https://docs.corefinity.com/mcp/tools/corestack_deployments_shared_files_check.md)
