---
title: "Deleted sites in the trash"
method: GET
path: "/stats/deleted-sites"
tags: ["Stats"]
---

# Deleted sites in the trash

`GET /stats/deleted-sites`

## Request

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

Admin-only. Newest first. Filters: the reason for the deletion, a minimum age in days, and a search over the name and the owner email.

## Query parameters

- `reason` 'owner' | 'expired'
- `olderThanDays` number
- `search` string
- `page` number
- `pageSize` number

## Response `200`

- APIPaginatedDeletedSitesResponse
  - `data` APIDeletedSite[], required
    - `id` string, required: The original site id (UUID).
    - `subdomain` string, required: The name the site had when it was deleted.
    - `accountId` string, nullable, required: The owning account, or null when the account is gone.
    - `ownerEmail` string, nullable, required: The account owner email at deletion.
    - `planAtDeletion` 'free' | 'basic' | 'pro' | 'max', required: The plan at deletion.
    - `reason` 'owner' | 'expired', required
    - `deletedByUserId` string, nullable, required: Who deleted it; null for the renewal job.
    - `deletedAt` string, required: Deletion time (ISO 8601).
    - `ageDays` number, required: Whole days since the deletion.
    - `fileCount` number, required: Files kept in the trash.
    - `totalBytes` number, required: Bytes kept in the trash.
    - `nameAvailable` boolean, required: True when the original name is free, so a restore needs no new name.
  - `page` number, required
  - `pageSize` number, required
  - `total` number, required
  - `totalPages` number, required

## Other responses

- `403`: Admin access required

---

[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)
