---
title: "Delete a space. Its pages detach to floating; they are never deleted."
method: DELETE
path: "/spaces/{idOrSlug}"
tags: ["Client spaces"]
---

# Delete a space. Its pages detach to floating; they are never deleted.

`DELETE /spaces/{idOrSlug}`

## Request

- Base URL: `https://api.stacktr.ee`
- URL: `https://api.stacktr.ee/spaces/{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`, `sites:read`)

The generated portal page and any bound hostname ARE removed — the space is the address, and a deleted space stops resolving. Archive instead to free the plan slot and close the portal while keeping the space and every page.

## Response `200`

Deleted; pages detached.

- object
  - `ok` boolean, required

## Other responses

- `404`: Resource not found.

---

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