# Delete a project

Delete an Error Tracking project with its DSN keys, issues and events.

Replace _project-id_ with the project's id.

**Warning:**
Deleting a project cannot be undone. Its issues, events, alert rules and settings are gone, and SDKs
still sending with its DSN are refused.

## Prerequisites

- Permission for `errors:DeleteProject` on the project. Without it, the console shows
  **Delete project** as unavailable, with the note "Deleting needs errors:DeleteProject on this
  project."
- In the console, also `errors:ListProjects` on the project to open it (without it the project is
  not found).
- Disconnect the apps connected to the project first (see [Connect an app](connect-an-app.md)): a
  connected app's build or rollout fails until the deletion has finished in the background.

## Delete the project

**Console**
1. Open the project, then the **Settings** tab.
2. Under **Danger zone**, choose **Delete project**.
3. Enter the project's name, then choose **Delete project**.

The console returns to **Projects**.

**CLI**
```sh
dcloud errors projects delete project-id
```

**API**
```http
DELETE /errors/api/projects/project-id
```

The answer is `200` with the project's `id`; `404` when it does not exist.

**Terraform**
Remove the `dcloud_errors_project` resource and run `terraform apply`.

## Result

- Every DSN key of the project is revoked at once; the ingest refuses them within seconds.
- The project's source-map uploader is removed, so upload tokens handed out for it stop working.
- Its slug is free for a new project.
- Its issues, events, transactions, profiles, sessions and alert rules are deleted in the
  background, and its connections to apps and CI environments are removed with them.

The managed DSN entry in Secrets, when the project had one, is not deleted with it.

## Related

- [Create a project](create-a-project.md)
- `errors.projects.delete` · `dcloud errors projects delete` · `dcloud_errors_project`
