---
title: "Take a page down. Restorable for 30 days."
method: DELETE
path: "/sites/{idOrSlug}"
tags: ["Sites"]
---

# Take a page down. Restorable for 30 days.

`DELETE /sites/{idOrSlug}`

## Request

- Base URL: `https://api.stacktr.ee`
- URL: `https://api.stacktr.ee/sites/{idOrSlug}`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.stacktr.ee/oauth/authorize`, token URL `https://api.stacktr.ee/oauth/token`, scopes: `sites:write`)
  - API key in header `Authorization`

The page stops serving immediately: the link is dead for everyone holding it, and the plan slot is freed at once. The content is then KEPT for 30 days, during which POST /sites/{idOrSlug}/restore puts it back at the same URL with the same id, token, slug and read history. After that window the R2 objects and the row are destroyed and nothing can bring them back. Deleting a page that is already down is not an error: the response carries `already_deleted: true` and the same `restorable_until`. On Free this does not return a page slot: the lifetime cap counts publishes, not live pages, and a restore does not spend a second one either. A page published WITHOUT an account is deleted with its own claim token (`Authorization: Claim <claim_token>`, while it is unclaimed). That delete is final: there is no account to restore it to, and its keep link stops working, so the response has no `restorable_until`.

## Response `200`

Stopped serving. `restorable_until` is present only when the delete is genuinely undoable; a client that does not see it must not promise an undo.

- object
  - `ok` boolean, required
  - `restorable_until` integer: Unix epoch seconds until which POST /sites/{idOrSlug}/restore works.
  - `already_deleted` boolean: True when the page was already down; this call changed nothing.
  - `message` string: Claim-token deletes: one sentence saying the page is down for good.

## Other responses

- `403`: `invalid_claim_token`: the claim token is wrong, the page has been claimed (it answers to the account now), or no such page (indistinguishable on purpose). `wallet_blocked` / `blocked`: the actor is on the abuse blocklist.
- `404`: Resource not found.
- `429`: Too many requests, or the daily publish cap for the plan (plan_upload_limit_exceeded). Carries Retry-After plus the RateLimit-Limit/-Remaining/-Reset headers.

---

[API](https://skmtc.dev/stacktr/apis/stacktree-api.md) · [All operations](https://skmtc.dev/stacktr/apis/stacktree-api/llms.txt) · [OpenAPI document](https://skmtc.dev/stacktr/apis/stacktree-api/revisions/5878cce46977?raw)
