Docs Menu
Docs Home
/ /
Atlas App Services
/

Delete an App

You can delete an App Services App from the App Services UI, CLI, or Admin API.

You will need the following to delete an App in the Atlas UI:

  • A MongoDB Atlas account with Project Owner permissions. To learn how to sign up for a free account, see Get Started with Atlas.

You will need the following to delete an App in the CLI:

  • A MongoDB Atlas account with Project Owner permissions. To learn how to sign up for a free account, see Get Started with Atlas.

  • A MongoDB Atlas Admin API public/private key pair. The API key must have Project Owner permissions to work with App Services Admin API.

  • A copy of App Services CLI installed and added to your local system PATH. To learn how, see Install App Services CLI.

  • Your App's client App ID. This is the unique string that contains your App name, e.g. "myapp-abcde". To learn how to find your App ID, see Get App Metadata.

You will need the following to delete an App with the Admin API:

  • A MongoDB Atlas account with Project Owner permissions. To learn how to sign up for a free account, see Get Started with Atlas.

  • A MongoDB Atlas Admin API public/private key pair. The API key must have Project Owner permissions to work with App Services Admin API.

  • Your App's internal ObjectId hex string and the Project ID of the Atlas Project that contains your App. To learn how to find these, see Get App Metadata.

1

Go to the Project Dashboard where you want to delete the App. Select the App Services tab.

2

To delete an app, click the ... menu at the upper right corner of the tile for the app you want to delete.

Then, select Delete App from the drop-down menu that appears.

The page prompts you to confirm that you want to delete this app. Click Delete App to confirm and delete the App.

App tile with Delete App option showing
1

Use your MongoDB Atlas Admin API Key to log in to the CLI:

appservices login --api-key="<my api key>" --private-api-key="<my private api key>"
2

The CLI can delete one or more apps with the following command:

appservices apps delete

If you have more than one App, you will be prompted to select one or more apps that you would like to delete from a list of all your Apps.

If you already know the name or id of the app you would like to delete, you can specify it with the --app flag:

appservices apps delete --app <App ID | App Name>

Tip

See also:

For more details and additional flags, see the CLI documentation for the app delete command.

1

Call the admin user authentication endpoint with your MongoDB Atlas API key pair:

curl -X POST \
https://services.cloud.mongodb.com/api/admin/v3.0/auth/providers/mongodb-cloud/login \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"username": "<Public API Key>",
"apiKey": "<Private API Key>"
}'

If authentication succeeds, the response body contains a JSON object with an access_token value:

{
"access_token": "<access_token>",
"refresh_token": "<refresh_token>",
"user_id": "<user_id>",
"device_id": "<device_id>"
}

The access_token grants access to the App Services Admin API. You must include it as a Bearer token in the Authorization header for all Admin API requests.

2

Send a request to the Delete an App endpoint.

Make sure to include your Admin API access_token, the groupId of the Atlas project containing your App, and the App's internal appId hex string:

curl --request DELETE 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json'

If your application deletes successfully, App Services returns a 204 response.

Back

Copy an App