> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://zuora.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://zuora.ferndocs.com/_mcp/server.

# Revert a deployment

POST https://rest.test.zuora.com/deployment-manager/deployments/{migrationId}/revert

Revert a deployment.


Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/deployment-manager/metadata-deployment/revert-deployment

## Authentication

- `Authorization` header (bearer token, required) — Use `Bearer {{token}}` in the `Authorization` header for authentication.

## Servers

- `https://rest.test.zuora.com` (US Developer & Central Sandbox (incl. Test Drive), default)
- `https://rest.sandbox.na.zuora.com` (US API Sandbox Cloud 1)
- `https://rest.apisandbox.zuora.com` (US API Sandbox Cloud 2)
- `https://rest.na.zuora.com` (US Production Cloud 1)
- `https://rest.zuora.com` (US Production Cloud 2)
- `https://rest.test.eu.zuora.com` (EU Developer & Central Sandbox)
- `https://rest.sandbox.eu.zuora.com` (EU API Sandbox)
- `https://rest.eu.zuora.com` (EU Production)
- `https://rest.test.ap.zuora.com` (APAC Developer & Central Sandbox)
- `https://rest.ap.zuora.com` (APAC Production)

## Request

### Path parameters

- `migrationId` (string, required) — The unique ID of a migration.

### Headers

- `Zuora-Entity-Ids` (string, optional) — An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header.

## Response

### 200

OK

- `id` (string, optional) — ID of the Deployment Manager migration process.
- `name` (string, optional) — Name of the Deployment Manager migration process.
- `description` (string, optional) — Description of the Deployment Manager migration process.
- `sourceTenantName` (string, optional) — Name of the source Tenant.
- `sourceTenantDescription` (string, optional) — Description of the source Tenant.
- `status` (enum, optional) — Status of the Deployment Manager migration process.
  - Allowed values: `DEPLOYING`, `REVERTING`, `PARTIALLY-REVERTED`, `FAILED`, `ROLLBACK-FAILED`, `REVERTED`, `COMPARING`, `SUBMITTED`, `SKIPPED`, `IDENTICAL`, `COMPARE-DONE`, `COMPARE-FAILED`, `CANCELLED`
- `startTime` (string, optional) — start timestamp of the Deployment Manager migration process.
- `endTime` (string, optional) — end timestamp of the Deployment Manager migration process.
- `migratedBy` (string, optional) — User who initiated the Deployment Manager migration process.
- `type` (string, optional) — Type of the Deployment Manager migration process.
- `environment` (string, optional) — Environment of the Deployment Manager migration process.
- `emailIds` (string, optional) — emailIds notified of the Deployment Manager migration process.
- `productCatalog` (boolean, optional) — Boolean flag specifies if the migration process includes product catalog module.
- `errors` (string, optional) — Errors of the Deployment Manager migration process.

## Examples

**Response**

```json
{
  "id": "2122b60e-49ca-4b16-ae1c-f7f315ff0010",
  "name": "Migrate - Custom objects",
  "description": "Migrate - Custom objects",
  "sourceTenantName": "Test Sandbox",
  "sourceTenantDescription": "Sample Source Tenant",
  "status": "REVERTING",
  "startTime": "2023-08-30 04:35:19.080000+00:00",
  "endTime": "2023-08-29 15:49:41.986000+00:00",
  "migratedBy": "Admin",
  "type": "Tenant",
  "environment": "US-API-Sandbox",
  "emailIds": "admin@zuora.com",
  "productCatalog": false,
  "errors": "-"
}
```

**SDK Code**

```python Metadata Deployment_RevertDeployment_example
import requests

url = "https://rest.test.zuora.com/deployment-manager/deployments/migrationId/revert"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Metadata Deployment_RevertDeployment_example
const url = 'https://rest.test.zuora.com/deployment-manager/deployments/migrationId/revert';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Metadata Deployment_RevertDeployment_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/deployment-manager/deployments/migrationId/revert"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Metadata Deployment_RevertDeployment_example
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/deployment-manager/deployments/migrationId/revert")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Metadata Deployment_RevertDeployment_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/deployment-manager/deployments/migrationId/revert")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Metadata Deployment_RevertDeployment_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/deployment-manager/deployments/migrationId/revert', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Metadata Deployment_RevertDeployment_example
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/deployment-manager/deployments/migrationId/revert");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Metadata Deployment_RevertDeployment_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/deployment-manager/deployments/migrationId/revert")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```