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

FieldTypeRequiredDescription
htmlstringHTML modeRaw HTML content
contentstringMD modeMarkdown source
format"html" | "md"NoDefault html
templatestringNoMarkdown template (clean, etc.)
titlestringNoPage title override
customSlugstringNoCustom /p/[slug]
expiresAtstring | nullNoISO 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": "…" }.