Infisical icon

Infisical

Interact with Infisical secrets management API

Environment → Delete

AI-generated

Summary

Delete an environment by its ID within a specified Infisical project, with an option to perform either a soft delete (default) or a hard delete that permanently removes the environment.

Inputs

  • Project ID (required) — The ID of the Infisical project the environment belongs to.
  • Environment ID (required) — The ID of the environment to delete.
  • Hard Delete — Whether to permanently delete the environment. If false or omitted, the environment is soft-deleted and can be restored later.

Output shape

a single record representing the deleted environment or deletion result

Returns the deleted environment object or a deletion confirmation as JSON. If soft-deleted, the environment remains recoverable; for a hard delete it is permanently removed.

Examples

Example 1: Delete an environment softly

Provide the Project ID and Environment ID without enabling hard delete to soft-delete the environment, allowing later restoration.

Example 2: Delete an environment permanently

Provide the Project ID and Environment ID and enable the hard delete option to permanently remove the environment without possibility of restoration.

Links

Discussion