Delete Workspace
In cases where your workspace has become redundant and you no longer need it, you can delete it from your Harness account. As a safeguard, Harness have several confirmation steps to ensure that workspaces aren't mistakenly deleted.
warning
Deleting a workspace will remove your workspace, along with it's associated state file from Harness, but will not remove any of your resources.
Resources are only destroyed if you run your workspace through a destroy pipeline.
Prerequisites
- Ensure that the resources associated with your workspace are no longer needed.
- Your workspace must be in an
inactive
status
- Interactive guide
- API
If your workspace already has an inactive
status, you can delete a workspace via the Harness API destroy-workspace endpoint.
curl -i -X DELETE \
'https://app.harness.io/iacm/api/orgs/{org}/projects/{project}/workspaces/{identifier}' \
-H 'Harness-Account: <YOUR_HARNESS_ACCOUNT_ID>' \
-H 'x-api-key: <YOUR_API_KEY_HERE>'
deactivate workspace
If your workspace is still active, deactivate it before calling the above endpoint with a destroy-workspace pipeline.