---
title: "corestack_deployment_rollback"
url: https://docs.corefinity.com/mcp/tools/corestack_deployment_rollback
type: tool
last_updated: 2026-11-13
feature: deployments
related:
  - https://docs.corefinity.com/api/reference/deployments/roll-back-site-deployment.md
  - https://docs.corefinity.com/guides/sites/code-and-deployments/connect-a-repository.md
---
# corestack_deployment_rollback

**Roll back a deployment.** Go back to an earlier deployment's release. It runs as a new deployment. Scope: write. Long-running: answers with a task.

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

## When to use it

Go back to an earlier deployment's release. It runs as a new deployment.

After a converted site's first Git deployment, `corestack_deployments_get` can offer the site's files from before that deployment as `releases.previous` with `before_git: true` (its `id` is usually `initial`). Roll back to them with `deployment_id` = the current deployment and `release_id` = that `id`. It runs as a new deployment too, named "Rollback to the release before Git deployments". It is accepted only while it is offered.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `deployment_id` (integer, ≥ 1, required): The deployment to go back to.
- `release_id` (string, up to 64 characters): A release of that deployment; its own when left out. Or the `releases.previous` id `corestack_deployments_get` offers with `before_git` (the site's files from before its first Git deployment).

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "deployment_id": {
      "description": "The deployment to go back to.",
      "minimum": 1,
      "type": "integer"
    },
    "release_id": {
      "description": "A release of that deployment; its own when left out. Or the releases.previous id corestack_deployments_get offers with before_git (the site's files from before its first Git deployment).",
      "maxLength": 64,
      "type": "string"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id",
    "deployment_id"
  ],
  "type": "object"
}
```

## Refusals

- `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`. Nothing is changed.
- `invalid_arguments` "There is no earlier release to roll back to": the release is not one you can roll back to now — not a kept successful deployment's, the current one, or a `before_git` release that is no longer offered. Read `corestack_deployments_get` again.
- `artifact_pruned`: that deployment's archive was removed after 30 days, so it can't be rolled back to. Deploy again from the branch or commit (`corestack_deployment_trigger`). Archives are kept for 30 days, and always for a site's 10 most recent deployments and its newest successful one.
- `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.
- 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_deployment_rollback",
  "arguments": {
    "site_id": 4211,
    "deployment_id": 6610
  }
}
```

The files from before the first Git deployment, while `corestack_deployments_get` offers them:

```json
{
  "name": "corestack_deployment_rollback",
  "arguments": {
    "site_id": 4211,
    "deployment_id": 6612,
    "release_id": "initial"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_deployment_rollback with site_id 4211, deployment_id 6610. (Roll back a deployment.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [POST /api/corestack/sites/{site}/deployments/{deployment}/rollback](https://docs.corefinity.com/api/reference/deployments/roll-back-site-deployment.md)
- Guide: [Connect a repository](https://docs.corefinity.com/guides/sites/code-and-deployments/connect-a-repository.md)
