---
title: "Delete a project (confirm with its exact name); its previews go with it and one backup copy is kept 30 days for disaster recovery"
method: DELETE
path: "/projects/{projectId}"
tags: ["Projects"]
---

# Delete a project (confirm with its exact name); its previews go with it and one backup copy is kept 30 days for disaster recovery

`DELETE /projects/{projectId}`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/projects/{projectId}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

Removes the previews of the project and releases its domains. A one-click app, WordPress site or app with volumes is stopped at once (its site goes offline) and its data is copied into the single backup copy before the server deletes it. Databases attached to the project stay (detached) unless `deleteDatabases` lists them. See GET /projects/{projectId}/deletion-impact for what this project would lose.

## Path parameters

- `projectId` string, uuid, required

## Request body

- object
  - `confirm` string, required: must equal the project name
  - `deleteDatabases` string[]: ids of databases attached to this project that are deleted together with it (their data and their backups are lost for good; needs databases:write). Databases that are not listed stay, detached from the project, and keep running.

## Response `200`

Deleted

- object
  - `deleted` true, required
  - `previewsRemoved` integer
  - `finalBackup` object: present when a final backup copy of the project was requested: it is kept for keptDays days, for disaster recovery only
    - `keptDays` integer, required
    - `includesData` boolean, required
  - `databases` object: present when deleteDatabases was given: which databases were deleted, and which could not be (they stay, detached, and can be deleted from the Databases page)
    - `deleted` string[], required
    - `failed` object[], required
      - `id` string, uuid, required
      - `name` string, required

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Conflicting state (code conflict)
- `429`: Too many requests (code rate_limited); see Retry-After
- `503`: Hosting engine unavailable (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
