Pages API
Publish, list, update, and delete pages via /api/v1/pages.
Last updated June 2, 2026
Publish a page
POST /api/v1/pages
Request body
| Field | Type | Required | Description |
|---|---|---|---|
html | string | HTML mode | Raw HTML content |
content | string | MD mode | Markdown source |
format | "html" | "md" | No | Default html |
template | string | No | Markdown template (clean, etc.) |
title | string | No | Page title override |
customSlug | string | No | Custom /p/[slug] |
expiresAt | string | null | No | ISO expiry datetime |
Example (HTML)
curl -X POST https://htmldrop.in/api/v1/pages \
-H "Authorization: Bearer hd_live_…" \
-H "Content-Type: application/json" \
-d '{
"format": "html",
"html": "<!DOCTYPE html><html><body><h1>Demo</h1></body></html>",
"title": "Demo page"
}'
Example (Markdown)
curl -X POST https://htmldrop.in/api/v1/pages \
-H "Authorization: Bearer hd_live_…" \
-H "Content-Type: application/json" \
-d '{
"format": "md",
"content": "# Hello\n\nFrom the API.",
"template": "clean"
}'
Response
{
"slug": "demo-page",
"url": "https://htmldrop.in/p/demo-page",
"title": "Demo page",
"format": "html",
"template": "clean",
"wordCount": 12,
"readingTimeMin": 1,
"passwordProtected": false,
"expiresAt": null,
"createdAt": "2026-06-02T12:00:00.000Z",
"updatedAt": "2026-06-02T12:00:00.000Z",
"permanent": true
}
List pages
GET /api/v1/pages?limit=20&cursor=…
Returns { pages: [...], nextCursor }. Cursor format: createdAt|id.
Get a page
GET /api/v1/pages/[slug]
Returns metadata (not raw HTML body).
Update a page
PATCH /api/v1/pages/[slug]
Same body fields as publish. Respects format lock (cannot switch HTML → Markdown).
Delete a page
DELETE /api/v1/pages/[slug]
Returns { "deleted": true, "slug": "…" }.