POST/v1/demo/claim

Claim 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

ParameterTypeRequiredDescription
claim_tokenstringYesThe claim token returned by Demo Publish

Response

Returns the claimed document with its new permanent URL.

FieldTypeDescription
idstringDocument UUID
titlestringDocument title
published_urlstringNew permanent URL under your username
slugstringURL slug (auto-generated from title)
template_idstringTemplate applied to the document

What Happens When You Claim

  1. The document is transferred to your account.
  2. A new slug is generated under your username namespace.
  3. The expiration is removed. The page is now permanent.
  4. The original demo URL redirects to the new location.
  5. The claim token is invalidated and cannot be reused.

Errors

StatusCodeDescription
400validation_errorMissing claim_token
401unauthorizedAuthentication required
404not_foundDemo document not found or already claimed
410expiredDemo page has expired (past 72 hours)
500internal_errorUnexpected 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\"}"