> ## Documentation Index
> Fetch the complete documentation index at: https://docs.simplehost.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Claim a Site

> POST /api/v1/publish/:slug/claim — Transfer an anonymous site to your account

## Claim an Anonymous Site

Transfer ownership of an anonymous site to your account, making it permanent.

When you publish without an API key, the site is anonymous and expires in 24 hours. The response includes a `claimToken` that you can use later to claim the site.

```
POST /api/v1/publish/:slug/claim
```

### Path Parameters

<ParamField path="slug" type="string" required>
  The slug of the anonymous site to claim.
</ParamField>

### Headers

| Header          | Required | Description                                                      |
| --------------- | -------- | ---------------------------------------------------------------- |
| `Content-Type`  | Yes      | `application/json`                                               |
| `Authorization` | Yes      | `Bearer sh_live_...` — you must be authenticated to claim a site |

### Request Body

<ParamField body="claimToken" type="string" required>
  The claim token from the original anonymous publish response.
</ParamField>

### Example

```bash theme={null}
curl -X POST https://simplehost.dev/api/v1/publish/bright-canvas-a7k2/claim \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sh_live_your_key_here" \
  -d '{"claimToken": "550e8400-e29b-41d4-a716-446655440000"}'
```

### Response (200)

```json theme={null}
{
  "slug": "bright-canvas-a7k2",
  "siteUrl": "https://bright-canvas-a7k2.simplehost.dev/",
  "owner": "you@example.com",
  "message": "Site claimed successfully! It is now permanent and linked to your account."
}
```

After claiming, the site:

* No longer expires
* Appears in your [site list](/api-reference/list-sites)
* Can be updated and managed like any other site

### Errors

| Status | Code              | Reason                        |
| ------ | ----------------- | ----------------------------- |
| 401    | `UNAUTHORIZED`    | Invalid or missing API key    |
| 404    | `NOT_FOUND`       | Site not found                |
| 400    | `INVALID_REQUEST` | Invalid claim token           |
| 400    | `INVALID_REQUEST` | Site has already been claimed |
| 400    | `INVALID_REQUEST` | Site has expired              |
