---
title: "Restore a deleted site from the trash"
method: POST
path: "/stats/deleted-sites/{id}/restore"
tags: ["Stats"]
---

# Restore a deleted site from the trash

`POST /stats/deleted-sites/{id}/restore`

## Request

- Base URL: `https://api.nippy.host`
- URL: `https://api.nippy.host/stats/deleted-sites/{id}/restore`
- Auth: `bearer` (a scheme the document does not define)

Admin-only. Recreates the site with its original id (so its analytics re-attach) and settings, under the original name or the one given, and copies its files back. The site comes back switched off with no renewal dates — or suspended, if it was suspended for abuse. The account may go past its site limit; `overSlotLimit` says so. The trash entry is then removed. Records a site.restored_from_trash activity.

## Path parameters

- `id` string, required

## Request body

- RestoreDeletedSiteDto
  - `subdomain` string: The name to restore the site under. Leave it out to use the original name; a new name is needed when the original is taken.

## Response `200`

- APIDeletedSiteRestoreResult
  - `siteId` string, required: The restored site id — the original id.
  - `subdomain` string, required
  - `accountId` string, required
  - `status` 'pending' | 'awaiting_verification' | 'live' | 'inactive' | 'suspended', required: `inactive` (switched off) — the owner switches it on, which checks the live-site cap. `suspended` only for a site that was suspended for abuse when it was deleted.
  - `fileCount` number, required: Files copied back.
  - `overSlotLimit` boolean, required: True when the account now holds more sites than its plan allows. An admin restore is allowed past the cap.
  - `sitesInAccount` number, required: Sites the account holds now.
  - `slotLimit` number, nullable, required: The plan’s site limit; null for an unlimited plan.

## Other responses

- `400`: The given name is not a valid name
- `403`: Admin access required
- `404`: Deleted site not found
- `409`: The name is taken, or the account no longer exists
- `503`: The files could not be copied back; nothing changed

---

[API](https://skmtc.dev/nippy/apis/nippy-backend-api.md) · [All operations](https://skmtc.dev/nippy/apis/nippy-backend-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nippy/apis/nippy-backend-api/revisions/7ab23f040a55?raw)
