Skip to content

Deleting Environments

You can delete an environment to permanently remove its database and all associated configuration. This action cannot be undone.


The following rules apply when deleting an environment:

  • The master environment cannot be deleted. It serves as the root of your project and must always exist.
  • An environment with active child branches cannot be deleted. You must first delete or archive all child environments before removing a parent.
  • An environment undergoing a merge cannot be deleted. Wait for the merge to complete or cancel it before attempting deletion.

When you delete an environment, Archie Core performs a complete cleanup of all dedicated resources:

  1. Permanent Data Removal: The dedicated PostgreSQL database and all its associated security credentials are permanently deleted.
  2. Configuration Cleanup: All environment-specific settings — including file providers, authentication methods, and security policies (CORS, Rate Limits) — are removed from the project.
  3. API & Gateway Removal: Any custom API gateway routes and API management configurations scoped to the environment are decommissioned.
  4. Platform Unregistration: The environment is removed from the project hierarchy, and its context is no longer available across the platform.

mutation DeleteEnvironment($input: DeleteEnvironmentInput!) {
deleteEnvironment(input: $input) {
success
message
}
}

Variables:

{
"input": {
"projectId": "f7e4a264-d659-4719-91e8-c2d74654e529",
"environmentName": "staging"
}
}

Response:

{
"data": {
"deleteEnvironment": {
"success": true,
"message": "Environment deleted successfully"
}
}
}