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


This document outlines the steps to immediately delete an Apigee or Apigee hybrid
organization without a soft-deletion data retention period.


You can perform an immediate deletion of an Apigee or Apigee hybrid organization
by calling the Apigee API
[`organizations.delete`](https://docs.cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations/delete.md.txt)
method and setting the `retention` query parameter to `NO_RETENTION`.

> [!WARNING]
> **Note:** You will NOT be able to restore the Apigee organization when using the `NO_RETENTION` option as it will be immediately deleted.

## Instructions


Follow these steps to start and track the immediate deletion of an Apigee or
Apigee hybrid organization.

1.
   Issue the immediate delete request by calling the
   [`organizations.delete`](https://docs.cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations/delete.md.txt)
   API with the `retention=NO_RETENTION` query parameter:

   ```
   curl -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     'https://apigee.googleapis.com/v1/organizations/ORG_NAME?retention=NO_RETENTION'
   ```


   Where <var translate="no">ORG_NAME</var> is the name of the Apigee organization that you want to
   delete.


   When the immediate deletion request starts successfully, the command returns a long-running
   operation similar to the following output:

   ```json
   {
     "name": "organizations/shreypaidapgx/operations/29b3280b-4287-46dc-8a08-069daf9f9bd4",
     "metadata": {
       "@type": "type.googleapis.com/google.cloud.apigee.v1.OperationMetadata",
       "operationType": "DELETE",
       "targetResourceName": "organizations/shreypaidapgx",
       "state": "IN_PROGRESS"
     }
   }
   ```
2.
   Track the status of the delete operation using the operation ID returned in the output of the
   previous command. The deletion is expected to take at most 2 hours.


   In the following commands, replace <var translate="no">ORG_NAME</var> with the name of your Apigee
   organization and <var translate="no">OPERATION_ID</var> with the operation ID from the previous step (for
   example, `29b3280b-4287-46dc-8a08-069daf9f9bd4`).
   -
     While the deletion is in progress, polling the operation returns a `state` of
     `IN_PROGRESS`:

     ```
     curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \
       'https://apigee.googleapis.com/v1/organizations/ORG_NAME/operations/OPERATION_ID'
     ```

     ```json
     {
       "name": "organizations/shreypaidapgx/operations/29b3280b-4287-46dc-8a08-069daf9f9bd4",
       "metadata": {
         "@type": "type.googleapis.com/google.cloud.apigee.v1.OperationMetadata",
         "operationType": "DELETE",
         "targetResourceName": "organizations/shreypaidapgx",
         "state": "IN_PROGRESS"
       }
     }
     ```
   -
     When the deletion is completed, polling the operation returns a `state` of
     `FINISHED` and `"done": true`:

     ```
     curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \
       'https://apigee.googleapis.com/v1/organizations/ORG_NAME/operations/OPERATION_ID'
     ```

     ```json
     {
       "name": "organizations/shreypaidapgx/operations/29b3280b-4287-46dc-8a08-069daf9f9bd4",
       "metadata": {
         "@type": "type.googleapis.com/google.cloud.apigee.v1.OperationMetadata",
         "operationType": "DELETE",
         "targetResourceName": "organizations/shreypaidapgx",
         "state": "FINISHED"
       },
       "done": true,
       "response": {
         "@type": "type.googleapis.com/google.protobuf.Empty"
       }
     }
     ```

## Troubleshooting immediate delete


If the operation `state` stays `IN_PROGRESS` for more than 2 hours, contact
[Google Cloud Support](https://docs.cloud.google.com/apigee/docs/support/getting-started-with-support.md.txt) for
investigation.