---
title: "Claim an anonymous site into your account."
method: POST
path: "/sites/{idOrSlug}/claim"
tags: ["Sites"]
---

# Claim an anonymous site into your account.

`POST /sites/{idOrSlug}/claim`

## Request

- Base URL: `https://api.stacktr.ee`
- URL: `https://api.stacktr.ee/sites/{idOrSlug}/claim`
- 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`)

Adopt an anonymously-published site (no account, 24h TTL) into the authenticated account using the single-use claim_token returned at publish time. Single-use, and only while the site is still unowned and unexpired. A claim is a publish: it counts against the plan's page cap, and the page is given the longest life that plan allows: permanent on a paid plan, 7 days from now on Free. A claimed page keeps its passcode on every plan; the response `expires_at` is authoritative for what the page actually got.

## Request body

- object
  - `claim_token` string, required: The secret claim token from the publish response.
  - `via` string: Optional: the surface that sent the claimer here (the `via` on the claim link). Analytics only.

## Response `200`

Claimed.

- object
  - `ok` boolean
  - `id` string
  - `expires_at` integer, nullable: Unix epoch seconds after the plan ceiling was applied; null = permanent.

## Other responses

- `402`: A plan ceiling was hit. The feature or the quota is not on this plan; the caller needs a different plan or an x402 unlock.
- `403`: Invalid claim token.
- `409`: Already claimed by another account.
- `410`: Expired; can no longer be claimed.
- `429`: Active-page cap reached (plan_site_limit_exceeded). The claim link stays valid until the page expires.

---

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