---
title: "Update a site's deployment options"
url: https://docs.corefinity.com/api/reference/deployments/update-site-deployment-options
type: endpoint
last_updated: 2026-11-13
feature: deployment-pipeline
related:
  - https://docs.corefinity.com/guides/sites/code-and-deployments/pipeline-stages.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_options_update.md
---
# Update a site's deployment options

Changes the deployment options you send and keeps the rest: the extra paths kept between releases, the paths a
build may read, the check before the switch, the warm-up and the cache purges. A list is sent whole and
replaces the saved one. Your role needs the Edit Environment Deployment Pipeline permission.

```http
PUT /api/corestack/sites/{site}/deployments/options
```

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

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

## Body

- `build_reads` (array of strings): The whole list of paths a build may read from the live site, at most 50, each named once.
- `cloudflare_purge` (boolean): Purge Cloudflare's cache after the switch.
- `extra_shared_paths` (array of strings or objects): The whole list of extra paths kept between releases, at most 50, each named once: a folder's path, or `{path, kind}`. No path may equal, hold or sit inside another, or one the platform itself keeps (`platform_shared` in the answer).
  - `kind` (string): A folder (`dir`, the default) or a file. One of `dir`, `file`.
  - `path` (string, required): A path inside the site, relative to its root: no leading slash, no `.` or `..` segment, of letters, digits and `. _ / @ + -`, at most 255 characters.
  - `shared` (string or any or null): Where the path's data is kept between releases, relative to the shared folder. Leave it out to keep the saved place, or the default for a new path.
- `pre_switch_check` (boolean or object): Check the new release answers before visitors are switched to it. Off (`false`), on (`true`), or on with up to five paths to request.
- `snapshot_before_upgrade` (boolean): Magento 2 only.
- `varnish_purge` (boolean): Magento 2 only. Purge Varnish after the switch.
- `warm_up` (boolean or object): Request pages of the new release before the switch. Off (`false`), on (`true`), or on with up to ten paths to request.

## Request

### curl

```bash
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/deployments/options \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "cloudflare_purge": false,
    "extra_shared_paths": [
      "public/uploads",
      "var/exports"
    ]
  }'
```

### PHP

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

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->put('https://manage.corefinity.com/api/corestack/sites/1042/deployments/options', [
        'cloudflare_purge' => false,
        'extra_shared_paths' => [
            'public/uploads',
            'var/exports',
        ],
    ]);

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

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/deployments/options', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    cloudflare_purge: false,
    extra_shared_paths: [
      'public/uploads',
      'var/exports',
    ],
  }),
});

// 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.put(
    "https://manage.corefinity.com/api/corestack/sites/1042/deployments/options",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "cloudflare_purge": False,
        "extra_shared_paths": [
            "public/uploads",
            "var/exports",
        ],
    },
)

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

## Responses

### 200 The deployment options after the change.

```json
{
  "build_reads": [],
  "cloudflare_purge": false,
  "extra_shared_paths": [
    {
      "kind": "dir",
      "path": "public/uploads"
    },
    {
      "kind": "dir",
      "path": "var/exports"
    }
  ],
  "migrate": false,
  "platform_shared": [
    {
      "kind": "dir",
      "path": "storage"
    },
    {
      "kind": "file",
      "path": ".env"
    }
  ],
  "pre_switch_check": false,
  "snapshot_before_upgrade": false,
  "warm_up": false
}
```

### 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: `write`, or `exec` when the change brings a command the pipeline does not run now), your company requires two-factor authentication and you have not set it up, or your role lacks the Edit Environment Deployment Pipeline permission (`forbidden`, with `permission`).

```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 managed by another control panel, so it cannot be changed here.

```json
{
  "code": "managed_elsewhere",
  "message": "This site is managed by another control panel",
  "reason": "managed_elsewhere"
}
```

### 422 An option is not a value it takes (`invalid`, with the `field`): a switch that is neither true nor false, a path that is not one, a list longer than it may be (50 extra paths, 50 paths a build may read, five paths to check, ten to warm up), or an extra path that overlaps another. Or the option is one only a Magento 2 site has (`wrong_platform`): `snapshot_before_upgrade` and `varnish_purge`.

```json
{
  "code": "invalid",
  "errors": {
    "build_reads": [
      "Enter at most 50 paths."
    ]
  },
  "field": "build_reads",
  "message": "Enter at most 50 paths.",
  "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 | `forbidden` | The person is not allowed to do this. |
| 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 | `managed_elsewhere` | This site is read-only here. Change it in the control panel that manages it. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 422 | `wrong_platform` | This is not available for the site's platform. Use it on a site of the platform it is for. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Pipeline](https://docs.corefinity.com/guides/sites/code-and-deployments/pipeline-stages.md)
- MCP tool: [`corestack_deployments_options_update`](https://docs.corefinity.com/mcp/tools/corestack_deployments_options_update.md)
