POST
/v1/demo/claimClaim Demo Document
Convert a temporary demo document to a permanent, owned document.
Convert a temporary demo document into a permanent document owned by your account. The page stays published at a new URL under your username and no longer expires.
This endpoint supports both API key authentication and session cookie authentication. You must be signed in to claim a document.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
claim_token | string | Yes | The claim token returned by Demo Publish |
Response
Returns the claimed document with its new permanent URL.
| Field | Type | Description |
|---|---|---|
id | string | Document UUID |
title | string | Document title |
published_url | string | New permanent URL under your username |
slug | string | URL slug (auto-generated from title) |
template_id | string | Template applied to the document |
What Happens When You Claim
- The document is transferred to your account.
- A new slug is generated under your username namespace.
- The expiration is removed. The page is now permanent.
- The original demo URL redirects to the new location.
- The claim token is invalidated and cannot be reused.
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Missing claim_token |
| 401 | unauthorized | Authentication required |
| 404 | not_found | Demo document not found or already claimed |
| 410 | expired | Demo page has expired (past 72 hours) |
| 500 | internal_error | Unexpected server error |
curl -X POST https://api.unmarkdown.com/v1/demo/claim \
-H "Authorization: Bearer um_your_key" \
-H "Content-Type: application/json" \
-d '{
"claim_token": "f0e1d2c3-b4a5-6789-0fed-cba987654321"
}'
const res = await fetch('https://api.unmarkdown.com/v1/demo/claim', {
method: 'POST',
headers: {
'Authorization': 'Bearer um_your_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
claim_token: 'f0e1d2c3-b4a5-6789-0fed-cba987654321'
})
});
const data = await res.json();
console.log(data.published_url); // permanent URL
import requests
res = requests.post(
'https://api.unmarkdown.com/v1/demo/claim',
headers={'Authorization': 'Bearer um_your_key'},
json={
'claim_token': 'f0e1d2c3-b4a5-6789-0fed-cba987654321'
}
)
data = res.json()
print(data['published_url'])
Response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"title": "Quick Demo",
"published_url": "https://unmarkdown.com/u/jane/quick-demo",
"slug": "quick-demo",
"template_id": "swiss"
}
Full workflow: demo to permanent
# Step 1: Publish without auth
RESPONSE=$(curl -s -X POST https://api.unmarkdown.com/v1/demo/publish \
-H "Content-Type: application/json" \
-d '{"content": "# My Post", "title": "My Post"}')
# Step 2: Extract the claim token
TOKEN=$(echo $RESPONSE | jq -r '.claim_token')
# Step 3: Claim with your API key
curl -X POST https://api.unmarkdown.com/v1/demo/claim \
-H "Authorization: Bearer um_your_key" \
-H "Content-Type: application/json" \
-d "{\"claim_token\": \"$TOKEN\"}"