Undeploying an API proxy

This pageapplies toApigee andApigee hybrid.

View Apigee Edge documentation.

Note: To undeploy API proxies in environments enabled forarchive deployments, seeDeploying and managing archives in an Apigee environment.

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 todeleting an API proxy, exceptthat when you undeploy a revision you can choose to edit it in the UI and later re-deploy it. If youdelete the API proxy, it is no longer available to edit.

Apigee in Cloud console

To undeploy an API proxy using the UI:

  1. In the Google Cloud console, go to theProxy Development> API Proxies page.

    Go to API Proxies

  2. Select the API proxy that you want to undeploy. The UI displays the API proxy'sOverview view.

  3. In theDeployments section, clickUndeploy.

    Undeploy screenshot

  4. In theUndeploy dialog, clickConfirm.

Classic UI

To undeploy an API proxy using the UI:

  1. Sign in to theApigee UI.
  2. SelectDevelop > API Proxies.

    The UI displays a list of current API proxies for the selected environment:

    A list of API proxies displays that includes      the name, status, traffic over 24 hours, author, and time last modified.

  3. Select the API proxy that you want to undeploy.

    The UI displays the API proxy'sOverview view.

  4. In the desired environment row, expand theRevision drop-down list and selectUndeploy:

    Revision drop-down for prod environment showing Undeploy item

    The UI prompts you to confirm the version you want to undeploy:

    Dialog prompting to confirm undeploy action

  5. ClickUndeploy.

    The UI updates the status to show that the revision was undeployed from the cluster immediately:

    Drop-down showing API proxy is undeployed from test environment

    Note, though, that the undeployment process can take some time (in theeventually consistent model). In fact, when you clickUndeploy, Apigeebegins the process of undeploying the selected revision from that environment in the cluster.

    For information on how to check the status of the undeployed proxy, seeViewing deployment status.

Alternatively, you can undeploy the current revision that you are editing in theDevelop tab:

  1. Click theDeploy to:env_name drop-down list:

    Deployment drop-down enabling you to deploy or undeploy the current revision to each environment

    The UI displays a list of environments. In theRevision column, the UI lists the currently deployed revision (or&emdash; if none), and prompts you withDeployrevision andUndeploy buttons.

  2. Click theUndeploy button for the desired environment.

    The UI prompts you to confirm the version you want to undeploy:

    Dialog prompting to confirm the API proxy undeploy operation

  3. Click theUndeploy button.

    The UI updates the status to show that the revision was undeployed immediately. However, the undeployment process can take some time (in theeventually consistent model). When you clickUndeploy, Apigee begins the process of undeploying the selected revision from that environment.

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 inObtaining an OAuth 2.0 access token. For information about thecurl options used in this example, seeUsing curl. For a description of environment variables you can use, seeSettingenvironment variables for Apigee API requests.

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

{}

For more information, see theUndeploy API proxy revision API.

gcloud

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

For more information and a description of the environment variables used in the examples,seeGetting started using gcloud with Apigee.

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, seeList deployments CLI.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.