> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/infrastructure-as-code-management/platform/workspaces/delete-workspace.md).

# 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 has several confirmation steps to ensure that workspaces aren't mistakenly deleted.

{% hint style="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](/infrastructure-as-code-management/platform/workspaces/destroy-workspaces.md).
{% endhint %}

#### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* Ensure that the resources associated with your workspace are no longer needed.
* Your workspace must be in an `inactive` status

{% tabs %}
{% tab title="Interactive guide" %}
{% embed url="<https://app.tango.us/app/embed/70b44fb7-9de7-44ec-a033-e2cc3296e325>" %}
{% endtab %}

{% tab title="API" %}
If your workspace already has an `inactive` status, you can delete a workspace via the [Harness API destroy-workspace endpoint](https://apidocs.harness.io/openapi-merged/workspaces/workspaces_destroy-workspace).

```bash
curl -i -X DELETE \
https://apidocs.harness.io/openapi-merged/iacm/api/orgs/{org_id}/projects/{project_id}/workspaces/{workspace_id} \
-H 'Harness-Account: {harness_account_id}' \
-H 'x-api-key: {api_key}'
```

***

{% hint style="info" %}
**DEACTIVATE WORKSPACE**

If your workspace is still active, deactivate it before calling the above endpoint with a [destroy-workspace pipeline](/infrastructure-as-code-management/platform/workspaces/destroy-workspaces.md).
{% endhint %}
{% endtab %}
{% endtabs %}
