---
title: "corestack_enterprise_deployment_rollback"
url: https://docs.corefinity.com/mcp/tools/corestack_enterprise_deployment_rollback
type: tool
last_updated: 2026-11-13
feature: enterprise-deployments
related:
  - https://docs.corefinity.com/guides/corestack-enterprise/deployments-and-pipelines.md
---
# corestack_enterprise_deployment_rollback

**Roll back to a CoreStack Enterprise deployment.** Put an earlier successful CoreStack Enterprise deployment live again by deploying its commit once more. Scope: write. Long-running: answers with a task.

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

## When to use it

Put an earlier successful CoreStack Enterprise deployment live again: the deployments list's Rollback. Its commit is
deployed once more, built from the pipeline as it is now. A release that was deployed by image digest is put back
from the images it recorded instead, without a new build. Use `corestack_enterprise_deployments_list` to find it: a
`succeeded` deployment with a `git_commit` that is not `is_current`.

A task follows the deployment to its end. The public API's
`POST /api/environments/{environment}/deployments/{deployment}/rollback` answers the same.

On pipeline v1 the rollback never reuses the old release folder on the server: the commit is built and deployed into a
new release. So it still works once that folder has been removed by old-release pruning, which, where it is switched
on, keeps an environment's newest releases (3 by default, the live one included) and removes older folders after each
successful deployment. What pruning does take away is pointing `htdocs` back at an old `releases/` folder by hand over
SSH: for an older release, roll back here instead.

## Inputs

- `enterprise_env_id` (integer, ≥ 1, required)
- `deployment_id` (integer, ≥ 1, required): the earlier successful deployment to go back to

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "deployment_id": {
      "minimum": 1,
      "type": "integer"
    },
    "enterprise_env_id": {
      "description": "A CoreStack Enterprise environment's id; for CoreStack or CoreCluster use the corestack_deployment_* tools.",
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "enterprise_env_id",
    "deployment_id"
  ],
  "type": "object"
}
```

## Refusals

- `stale`: that deployment cannot be rolled back to: it did not succeed, has no commit, is already the live release,
  or (pipeline v2) its image is no longer kept, or (deployed by image digest) the images it ran are no longer all
  recorded; or it moved on since it was read.
- `artifact_pruned`: that deployment's archive was removed after 30 days, so it can't be rolled back to. Deploy again
  from the commit (`corestack_enterprise_deployment_trigger`). Archives are kept for 30 days, and always for an
  environment's 10 most recent deployments and its newest successful one.
- `busy`: the same rollback is still being applied. `forbidden`: the person's role lacks the Rollback Deployments
  permission. The message names it and says an owner of the company can grant it in Roles; `details.permission` is
  `rollbackDeployments`.
- `invalid_arguments` (field `enterprise_env_id`): a CoreStack or CoreCluster environment; use
  `corestack_deployment_rollback` by `site_id`.
- `tenant_mismatch`, `pin_refused`, and the refusals every tool can answer: `scope_required`, `rate_limited`,
  `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_enterprise_deployment_rollback",
  "arguments": {
    "enterprise_env_id": 1530,
    "deployment_id": 185101
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_enterprise_deployment_rollback with enterprise_env_id 1530, deployment_id 185101. (Roll back to a CoreStack Enterprise deployment.) Tell me what it returned.
```

## The same task elsewhere

- Guide: [Deployments and pipelines](https://docs.corefinity.com/guides/corestack-enterprise/deployments-and-pipelines.md)
