Claiming Demo Documents
Convert a temporary demo document to a permanent, owned document.
Claiming Demo Documents
Demo documents expire after 72 hours. To keep a demo document permanently, claim it by transferring ownership to your account.
Prerequisites
- A demo document published via
POST /v1/demo/publish - The
claim_tokenfrom the demo publish response - An Unmarkdown™ account with an API key
Claim a demo document
curl -X POST https://api.unmarkdown.com/v1/demo/claim \
-H "Authorization: Bearer um_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"claim_token": "a1b2c3d4-5678-9abc-def0-123456789abc"
}'
const response = await fetch(
"https://api.unmarkdown.com/v1/demo/claim",
{
method: "POST",
headers: {
"Authorization": "Bearer um_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
claim_token: "a1b2c3d4-5678-9abc-def0-123456789abc",
}),
}
);
const data = await response.json();
console.log(data.published_url);
// https://unmarkdown.com/u/yourname/quick-demo
import requests
response = requests.post(
"https://api.unmarkdown.com/v1/demo/claim",
headers={"Authorization": "Bearer um_your_key_here"},
json={
"claim_token": "a1b2c3d4-5678-9abc-def0-123456789abc",
},
)
data = response.json()
print(data["published_url"])
# https://unmarkdown.com/u/yourname/quick-demo
Response
When a document is claimed, it moves from the temporary demo URL to a permanent URL under your username:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Quick Demo",
"published_url": "https://unmarkdown.com/u/yourname/quick-demo",
"slug": "quick-demo",
"template_id": "github"
}
The original demo URL (/p/...) will redirect to the new permanent URL.
What happens when you claim
- The document is transferred to your account
- It gets a new URL under your username (
/u/yourname/slug) - The 72-hour expiration is removed
- You can edit, update, and manage the document like any other
- The claim token becomes invalid (it can only be used once)
WARNING
If the demo document has already expired, claiming will fail with a 410 (Gone) response. Claim tokens must be used within the 72-hour window.
Error cases
| Status | Code | Meaning |
|---|---|---|
| 400 | validation_error | Missing or invalid claim_token |
| 401 | unauthorized | Missing or invalid API key |
| 404 | not_found | No document found for this claim token |
| 410 | expired | The demo document has expired |
Full workflow: demo to permanent
Here is the complete flow using a demo document and then claiming it:
# Step 1: Publish without auth
RESPONSE=$(curl -s -X POST https://api.unmarkdown.com/v1/demo/publish \
-H "Content-Type: application/json" \
-d '{"content": "# Hello World", "template_id": "swiss"}')
# Step 2: Extract claim token
CLAIM_TOKEN=$(echo $RESPONSE | jq -r '.claim_token')
# Step 3: Claim with auth
curl -X POST https://api.unmarkdown.com/v1/demo/claim \
-H "Authorization: Bearer um_your_key_here" \
-H "Content-Type: application/json" \
-d "{\"claim_token\": \"$CLAIM_TOKEN\"}"
Next steps
- Demo Publish: Learn more about the demo publish flow
- Publish Your First Document: Publish directly with authentication