*This page
applies to **Apigee** and **Apigee hybrid**.*


*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*
![](https://fonts.gstatic.com/s/i/googlematerialicons/help/v13/gm_grey-24dp/1x/gm_help_gm_grey_24dp.png)

> [!NOTE]
> **Note:** To undeploy API proxies in environments enabled for [archive deployments](https://docs.cloud.google.com/apigee/docs/api-platform/fundamentals/environments-overview.md.txt#deployment-types), see [Deploying and managing
> archives in an Apigee environment](https://docs.cloud.google.com/apigee/docs/api-platform/deploy/manage-archive-deployments).

Undeploy an API proxy revision from your cluster as described in the following sections.

Note that when you undeploy a revision:

- Apigee does not roll the revision back to the previously deployed revision.
- After undeploying, no revisions of the API proxy are deployed in the environment.

Undeploying an API proxy is similar to [deleting an API proxy](https://docs.cloud.google.com/apigee/docs/api-platform/develop/ui-delete-proxy.md.txt), except
that when you undeploy a revision you can choose to edit it in the UI and later re-deploy it. If you
*delete* the API proxy, it is no longer available to edit.

### Apigee UI

To undeploy an API proxy using the UI:

1. In the Google Cloud console, go to the **Apigee \> Proxy Development \> API Proxies** page.

   [Go to API Proxies](https://console.cloud.google.com/apigee/proxies)
2. Select the API proxy that you want to undeploy.
   The UI displays the API proxy's **Overview** view.

3. In the **Deployments** section, click **Undeploy**.

   ![Undeploy screenshot](https://docs.cloud.google.com/static/apigee/docs/api-platform/develop/images/undeploy.png)
4. In the **Undeploy** dialog, click **Confirm**.

### Apigee API

To undeploy an API proxy, use the following API call:

```
curl "https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/apis/$API/revisions/$REV/deployments" \
  -X DELETE \
  -H "Authorization: Bearer $TOKEN"
```

Where `$TOKEN` is set to your OAuth 2.0 access token, as described in
[Obtaining an OAuth 2.0 access token](https://docs.cloud.google.com/apigee/docs/api-platform/get-started/api-get-started.md.txt#oauth20). For information about the `curl` options used in this example, see
[Using curl](https://docs.cloud.google.com/apigee/docs/api-platform/get-started/api-get-started.md.txt#curl). For a description of environment variables you can use, see
[Setting
environment variables for Apigee API requests](https://docs.cloud.google.com/apigee/docs/api-platform/get-started/api-get-started#api-environment-variables).

The following provides an example of the response output (an empty response):

```
{}
```

For more information, see the [Undeploy API proxy revision API](https://docs.cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.apis.revisions.deployments/undeploy.md.txt).

### gcloud


The following sections provide examples of using `gcloud alpha apigee` CLI commands to
undeploy API proxy revisions and validate the undeployment.

- [Undeploying an API proxy revision using the gcloud CLI](https://docs.cloud.google.com/apigee/docs/api-platform/deploy/ui-undeploy.md.txt#undeploy-api-revision-cli)
- [Validating the undeployment of an API proxy revision using the gcloud CLI](https://docs.cloud.google.com/apigee/docs/api-platform/deploy/ui-undeploy.md.txt#validate-undeployment-cli)


For more information and a description of the environment variables used in the examples,
see [Getting started using gcloud with Apigee](https://docs.cloud.google.com/apigee/docs/api-platform/get-started/gcloud-get-started.md.txt).

#### Undeploying an API proxy revision using the gcloud CLI


To undeploy an API proxy revision, use the following gcloud command:

```
gcloud alpha apigee apis undeploy $REV --api=$API --environment=$ENV
```


The following provides an example of the response:

```
Using Apigee organization `my-org`
```

#### Validating the undeployment of an API proxy revision using the gcloud CLI


To validate that the API proxy revision has been undeployed from the environment, use the following gcloud command:

```
gcloud alpha apigee deployments list --api=$API --environment=$ENV
```


The following provides an example of the response:

```
Using Apigee organization `my-org`
Listed 0 items.
```


For more information, see [List deployments CLI](https://docs.cloud.google.com/sdk/gcloud/reference/alpha/apigee/deployments/list.md.txt).