---
title: "corestack_environment_update"
url: https://docs.corefinity.com/mcp/tools/corestack_environment_update
type: tool
last_updated: 2026-11-13
feature: environments
related:
  - https://docs.corefinity.com/api/reference/environments/update-site-environment.md
  - https://docs.corefinity.com/guides/sites/environments-and-copies/create-an-environment.md
---
# corestack_environment_update

**Change an environment's settings.** Change an environment's settings: its name (a label — the address never changes), scheduled snapshots, automatic deployment, or HTTP authentication for the whole environment. Scope: write. Long-running: answers with a task.

- Scope: `write`
- Runs as a task: yes

## When to use it

Change an environment's settings: its name (a label — the address never changes), scheduled snapshots, automatic deployment, or HTTP authentication for the whole environment.

## Inputs

- `site_id` (integer, ≥ 1, required): The environment's own row (production included).
- `name` (string, 1–40 characters): A label of 1–40 characters, without < or >, that no other environment of the site shows (production always shows as Production). The hostname never changes.
- `scheduled_snapshots` (boolean): Scheduled backups for this environment. Every staging environment starts with it off — including one moved from CoreStack Enterprise — and production starts with it on; the customer switches it on per environment here, in the Control Panel or in the API.
- `auto_deploy` (boolean): Git rows only.
- `http_auth_enabled` (boolean): The whole-environment rule; needs a / rule.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "auto_deploy": {
      "description": "Git rows only.",
      "type": "boolean"
    },
    "http_auth_enabled": {
      "description": "The whole-environment rule; needs a / rule.",
      "type": "boolean"
    },
    "name": {
      "description": "A label of 1–40 characters, without < or >, that no other environment of the site shows (production always shows as Production). The hostname never changes.",
      "maxLength": 40,
      "minLength": 1,
      "type": "string"
    },
    "scheduled_snapshots": {
      "type": "boolean"
    },
    "site_id": {
      "description": "The environment's own row (production included).",
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id"
  ],
  "type": "object"
}
```

## Refusals

- `pin_refused`: the environment shown for this site is outside the token's pins. This is checked before reading live status or changing settings, including for existing tokens when a site becomes staging-only. Add the site using the returned link, or address a covered environment by its own `site_id`. The refusal names only the requested row. A successful reply describes the environment admitted at the start of that call, even if the display environment changes while work runs; the next call checks the current display environment again.

- `managed_elsewhere` (message: "This site is managed by another control panel"): another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
- `invalid_arguments` on `name`: the name is empty, longer than 40 characters, or contains < or > ("An environment name cannot contain < or >"); another environment of the site already shows it ("Another environment of this site is already called {name}"); or the environment's deployments use its name ("This environment's deployments use its name, so it cannot be renamed. Contact support."). Nothing was changed.
- `invalid_arguments` on `http_auth_enabled` ("Rename the environment on its own, then switch HTTP authentication"): a new name and `http_auth_enabled` in one call. Rename first, then switch it in a second call. Nothing was changed.
- `invalid_arguments` on `scheduled_snapshots`: the switch was switched on for an environment whose site or cluster does not have scheduled snapshots turned on ("Snapshots are not turned on for this site. Contact support to have them turned on.", or the same sentence for the cluster). Switching it off is always accepted. Nothing was changed.
- `forbidden`: `auto_deploy` would switch automatic deployment on or off and the person's role lacks the Manage
  Deployment Source permission, or would switch it on and the role lacks the Create Deployments permission (a push that
  deploys on its own is a deployment). The message names the permission and says an owner of the company can grant it
  in Roles; `details.permission` is `manageDeploymentSource` or `createDeployments`. Nothing is changed. Sent as it
  already is, `auto_deploy` is no change.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_environment_update",
  "arguments": {
    "site_id": 4211,
    "auto_deploy": false
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_environment_update with site_id 4211, auto_deploy false. (Change an environment's settings.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [PATCH /api/corestack/sites/{site}/environment](https://docs.corefinity.com/api/reference/environments/update-site-environment.md)
- Guide: [Create an environment](https://docs.corefinity.com/guides/sites/environments-and-copies/create-an-environment.md)
