API reference
Everything in the dashboard is available over HTTPS with JSON. Authenticate with an API key from Settings. Prefer natural language? Use the MCP server.
Authentication
Send your key as a bearer token. Keys start with htk_live_ and can be revoked anytime.
Authorization: Bearer htk_live_YOUR_KEY
Publish in one call
curl -X POST https://htmltoolz.com/api/v1/sites \
-H "Authorization: Bearer $HTMLTOOLZ_KEY" \
-H "Content-Type: application/json" \
-d '{"html": "<h1>Hello, Acme</h1>", "title": "Acme preview", "access": "password", "password": "acme-q4"}'Upload a folder as JSON files ([{"path":"index.html","content":"…"},{"path":"img/logo.png","content":"…base64…","encoding":"base64"}]) or send a .zip as multipart file.
{
"id": "k3Vq9TbXw2LmPa",
"slug": "acme-preview",
"url": "https://acme-preview.htmltoolz.page/",
"title": "Acme preview",
"access": "password",
"status": "live",
"version": 1,
"score": 94,
"checks": { "score": 94, "grade": "A", "issues": [] },
"fixed": []
}
You can also send the page as a raw text/html body, or a .zip body with Content-Type: application/zip. Add "autofix": true to apply safe launch-check fixes (viewport, title, social tags…) before publishing.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/sites | Publish a new link. JSON body with html or files[], or multipart with a file / .zip. |
| GET | /api/v1/sites | List your links. Filters: ?query=, ?client= |
| GET | /api/v1/sites/{slug} | One link, including the latest launch checks. |
| PUT | /api/v1/sites/{slug} | Publish a new version to the same URL (same body as create, optional note). |
| PATCH | /api/v1/sites/{slug} | Update title, client, access (+password) and feature flags. |
| DELETE | /api/v1/sites/{slug} | Delete a link and everything attached to it. |
| GET | /api/v1/sites/{slug}/versions | Version history with launch-check scores. |
| POST | /api/v1/sites/{slug}/restore | Make an earlier version live again: {"version": 3} |
| GET | /api/v1/sites/{slug}/feedback | Comments, approvals and the current decision. |
| GET | /api/v1/sites/{slug}/activity | Totals, daily series, recent opens and known viewers. ?days= |
| GET | /api/v1/sites/{slug}/submissions | Form submissions. ?limit= |
Errors & limits
Errors return a JSON body {"error": {"code": "…", "message": "…"}} with a meaningful status: 401 bad key, 402 the feature needs a higher plan, 404 not your link, 409 slug taken, 413 upload too large, 422 invalid or blocked content, 429 daily request limit (see Retry-After).
Free accounts get 200 API requests a day; paid plans get 10,000. Size, file and link limits follow your plan.
MCP
The remote MCP endpoint is https://htmltoolz.com/mcp (Streamable HTTP, same bearer key). Setup for Claude Code, Claude Desktop and Cursor is on the MCP page.