---
updatedAt: 2026-07-28T19:33:42.000Z
---

# Delete an environment

Delete an environment using its unique identifier. The default environment cannot be deleted.<br><br><a href="https://api.solace.dev/cloud/reference/authentication">Token Permissions</a>: [ <code>environments:edit</code> ]

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Platform",
    "description": "# REST API Concepts\n\nSolace PubSub+ Platform provides RESTful APIs that you can use to manage your data in PubSub+ Cloud. The REST APIs allow\nyou to model your event-driven architectures from your own client applications.\n\nThe following document describes the public REST APIs available for use. Please note that these APIs are in the Early\nAccess release stage and are available for testing and early user feedback. The APIs are subject to change until they\nare declared Generally Available.",
    "version": "2.2.2"
  },
  "servers": [
    {
      "url": "https://api.solace.cloud",
      "description": "Solace PubSub+ Cloud US EAST Region"
    },
    {
      "url": "https://api.solacecloud.com.au",
      "description": "Solace PubSub+ Cloud AU Region"
    },
    {
      "url": "https://api.solacecloud.eu",
      "description": "Solace PubSub+ Cloud EU Region"
    },
    {
      "url": "https://api.solacecloud.sg",
      "description": "Solace PubSub+ Cloud SG Region"
    }
  ],
  "security": [
    {
      "APIToken": []
    }
  ],
  "tags": [
    {
      "name": "Environments"
    }
  ],
  "paths": {
    "/api/v2/platform/environments/{id}": {
      "delete": {
        "tags": [
          "Environments"
        ],
        "summary": "Delete an environment",
        "description": "Delete an environment using its unique identifier. The default environment cannot be deleted.<br><br><a href=\"https://api.solace.dev/cloud/reference/authentication\">Token Permissions</a>: [ <code>environments:edit</code> ]",
        "operationId": "deleteEnvironmentById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique identifier of the environment",
            "required": true,
            "schema": {
              "type": "string",
              "default": ""
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Operation"
          },
          "400": {
            "description": "Unable to delete the last environment",
            "content": {}
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse",
                  "additionalProperties": {
                    "default": ""
                  },
                  "default": ""
                },
                "example": {
                  "message": "An authentication error occurred.",
                  "errorId": "618e2fb0-a198-4d9d-9219-13e51ef0ecec"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse",
                  "additionalProperties": {
                    "default": ""
                  },
                  "default": ""
                },
                "example": {
                  "message": "You do not have permissions to perform this operation.",
                  "errorId": "618e2fb0-a198-4d9d-9219-13e51ef0ecec"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {}
          },
          "502": {
            "description": "Bad Gateway - Marketplace integration error.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "default": null,
        "properties": {
          "message": {
            "type": "string",
            "default": "",
            "description": "A user-friendly message that describes the error.",
            "example": "An error occurred."
          },
          "errorId": {
            "type": "string",
            "default": "",
            "description": "The UUID (Universally Unique Identifier) that is logged with an appropriate stack trace for a WARN or ERROR log that allows support to better determine what cause the error.",
            "example": "123e4567-e89b-12d3-a456-426655440000"
          },
          "meta": {
            "type": "object",
            "additionalProperties": {},
            "default": "",
            "description": "The metadata about the error. This provides additional information about the error that occurred.",
            "example": "'object': { 'field': 'description' }"
          },
          "validationDetails": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "default": "",
            "description": "When applicable, these are the details of issues with the fields provided for the REST call.",
            "example": "'name': ['Not unique']"
          }
        }
      }
    },
    "securitySchemes": {
      "APIToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
```