---
title: "corestack_deployments_template_restore"
url: https://docs.corefinity.com/mcp/tools/corestack_deployments_template_restore
type: tool
last_updated: 2026-11-13
feature: deployment-templates
related:
  - https://docs.corefinity.com/api/reference/deployments/restore-deploy-template.md
  - https://docs.corefinity.com/guides/sites/code-and-deployments/deployment-templates.md
---
# corestack_deployments_template_restore

**Restore a deployment template version.** Restore an earlier revision of your company's deployment template, or Corefinity's default, as a new revision written into every environment it reaches. Call it with dry_run first. Scope: write.

- Scope: `write`
- Confirmation: `confirm_production`, `confirm_count`, `confirm_targets`
- Runs as a task: no

## When to use it

Restore an earlier revision of your company's deployment template (`version_id`, from `corestack_deployments_template_versions_list`), or every stage back to Corefinity's default (`version: "corefinity"`). It is saved as a new revision equal to the chosen one and written into every environment it reaches, as a save is. Call it with `dry_run: true` first and confirm production as a stage save does. Restoring needs write only. It applies to the whole company.

The same action in the public REST API, with the same checks, refusals and scope: `POST /api/corestack/companies/{company}/deploy-templates/{platform}/restore`.

## Inputs

- `platform` (string, required)
- `version_id` (integer, ≥ 1): The revision to restore (corestack_deployments_template_versions_list).
- `version` (string, one of `corefinity`): Instead of version_id: every stage back to Corefinity's default.
- `revision` (integer, ≥ 0, required): The template revision you read.
- `dry_run` (boolean): Answer the reach; write nothing.
- `keep_on` (array of integer): site_ids that keep their own stage: every cannot_take one.
- `confirm_production` (boolean)
- `confirm_count` (integer, ≥ 0): The production count of the dry run.
- `confirm_targets` (array of integer): The dry run's production[].site_id.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "confirm_count": {
      "description": "The production count of the dry run.",
      "minimum": 0,
      "type": "integer"
    },
    "confirm_production": {
      "type": "boolean"
    },
    "confirm_targets": {
      "description": "The dry run's production[].site_id.",
      "items": {
        "minimum": 1,
        "type": "integer"
      },
      "type": "array"
    },
    "dry_run": {
      "description": "Answer the reach; write nothing.",
      "type": "boolean"
    },
    "keep_on": {
      "description": "site_ids that keep their own stage: every cannot_take one.",
      "items": {
        "minimum": 1,
        "type": "integer"
      },
      "type": "array"
    },
    "platform": {
      "enum": [
        "magento2",
        "laravel",
        "wordpress",
        "shopware5"
      ],
      "type": "string"
    },
    "revision": {
      "description": "The template revision you read.",
      "minimum": 0,
      "type": "integer"
    },
    "version": {
      "description": "Instead of version_id: every stage back to Corefinity's default.",
      "enum": [
        "corefinity"
      ],
      "type": "string"
    },
    "version_id": {
      "description": "The revision to restore (corestack_deployments_template_versions_list).",
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "platform",
    "revision"
  ],
  "type": "object"
}
```

## Refusals

- `forbidden`: the person's role lacks the Edit Environment Deployment Pipeline permission, which every change to the
  company's templates, variables and registry secrets needs (they reach every environment that follows the template). The
  message names it and says an owner of the company can grant it in Roles; `details.permission` is
  `editEnvironmentDeploymentPipeline`. Nothing is changed.
- `version_unavailable`: that revision is not kept for this template.
- `stale`: the template changed since you read it; read it again and resend.
- `template_locked`: Corefinity has locked this template.
- `reach_changed`: the production environments changed since your dry run; run it again and confirm the new list.
- `confirm`: production is reached; send the confirmation from the dry run.
- `template_refused_on`: an environment cannot take it; add it to `keep_on`.
- 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_deployments_template_restore",
  "arguments": {
    "platform": "magento2",
    "version_id": 3,
    "revision": 5,
    "dry_run": true
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_deployments_template_restore with platform magento2, version_id 3, revision 5, dry_run true. (Restore a deployment template version.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [POST /api/corestack/companies/{company}/deploy-templates/{platform}/restore](https://docs.corefinity.com/api/reference/deployments/restore-deploy-template.md)
- Guide: [Deployment templates](https://docs.corefinity.com/guides/sites/code-and-deployments/deployment-templates.md)
