1. Docs
  2. API Reference
  3. Delete an Environment

Delete an Environment

DELETE/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}

Authentication

  • Bearer Token Authorization

    JWT access token

Path Parameters

Name Required Type Description
envSlugRequiredstring

Code samples

cURLJavaScriptPythonGo
curl -X DELETE "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/value" \
  -H "Authorization: Bearer $CANOPY_TOKEN"

Responses

204 Environment deleted
400 Cannot delete the last Environment in this Application — an App must have at least one Environment at all times. Cannot delete the App's `default_environment_id` until the customer points it elsewhere.
401 Invalid or expired token
403 This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)
404 Environment not found in this Application
On this page

Related endpoints

GETList Environments in an Application
POSTCreate a new Environment in an Application
GETGet a single Environment by slug
PATCHRename or re-slug an Environment
GETExport an Environment's configuration as JSON
POSTReplace an Environment's configuration from a JSON payload (destructive)
GETGet the Environment's access model
PUTSwitch the Environment's access model
GETGet hierarchy schema for the active Environment
PATCHUpdate hierarchy schema for the active Environment
POSTRevert this Environment from hierarchy to flat