---
title: "Delete a site"
method: DELETE
path: "/sites/{id}"
tags: ["Sites"]
---

# Delete a site

`DELETE /sites/{id}`

## Request

- Base URL: `https://api.hypamoon.com/api/v1`
- URL: `https://api.hypamoon.com/api/v1/sites/{id}`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://app.hypamoon.com/oauth/authorize`, token URL `https://api.hypamoon.com/oauth/token`, scopes: `sites:write`)

Takes the site offline right away and removes it from the list. Its files and versions are kept for 30 days: POST /sites/{id}/restore puts it back, and GET /sites/deleted lists what can still be restored. After 30 days everything is erased for good. With permanent=true everything is erased right away and the site cannot be restored, also for a site that was already deleted; use it only when the owner explicitly asks for that. The slug stays taken, so an old link never shows someone else's site. Deleting it again returns 204 as well. A site Hypamoon took offline (taken_offline) cannot be deleted: 403 site_offline.

## Path parameters

- `id` string, uuid, required

## Query parameters

- `permanent` boolean

## Response `202`

Four-eyes approval is on: the deletion waits for another owner or builder. Nothing has changed on the live site yet.

- DeployApproval: Four-eyes approval is on for this project: the deploy waits until another owner or builder approves it in the portal (or with approve_deploy). Nothing changed on the live site yet.
  - `object` 'deploy_approval', required
  - `id` string, uuid, required: The id of the request; pass it as approval_id to approve_deploy or reject_deploy.
  - `status` 'pending' | 'processing' | 'approved' | 'rejected' | 'failed' | 'superseded' | 'expired', required: pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days.
  - `kind` 'new_site' | 'site_update' | 'site_delete' | 'app_deploy' | 'app_rollback', required: app_deploy and app_rollback: server code of an app (deploy_app, rollback_app); files and bytes are its modules.
  - `site_id` string, uuid, nullable, required
  - `name` string, nullable, required
  - `slug` string, nullable, required
  - `url` string, nullable, required: The address of the site. For an update or deletion it still shows the live version until approval.
  - `files` integer, required
  - `bytes` integer, required
  - `password_change` 'none' | 'remove' | 'set', required
  - `requested_by` object, required
    - `user_id` string, uuid, nullable, required
    - `via` string, required
    - `app` string, nullable, required
  - `requested_at` string, required
  - `expires_at` string, required
  - `reviewed_by` string, uuid, nullable, required
  - `reviewed_at` string, nullable, required
  - `reason` string, nullable, required
  - `result` object, nullable, required

## Other responses

- `204`: Deleted. Without permanent the site can be restored for 30 days.
- `401`: Unauthorized: unauthorized, missing_api_key, invalid_api_key, api_key_revoked, project_deleted.
- `403`: Forbidden: project_not_enabled, key_mode_mismatch, missing_scope, verification_required, site_offline.
- `404`: Not Found: not_found.
- `429`: Too Many Requests: rate_limited.
- `500`: Internal Server Error: internal_error.
- `503`: Service Unavailable: service_unavailable.

---

[API](https://skmtc.dev/hypamoon/apis/hypamoon-api.md) · [All operations](https://skmtc.dev/hypamoon/apis/hypamoon-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hypamoon/apis/hypamoon-api/revisions/9f0b90004c06?raw)
