htmlkin.io
Sign in
For developers

REST API documentation

Publish and update HTML pages straight from code and AI pipelines. Publish and update static sites and HTML pages from code and AI pipelines. Available on every plan, including Free, with an API key.

Create an API key →Download OpenAPI

Authentication

Every request needs an API key in the Authorization header. Create the key in your dashboard on the “API keys” page — it is shown only once. A request without a valid key is rejected with 401 invalid_api_key.

The base address of every endpoint is https://htmlkin.io/api/v1. Add this header to each request:

"Authorization: Bearer <api_key>"

The API is available on every plan, including Free. Create a key in your dashboard on the “API keys” page — it is shown only once.

Rate limits

Request rates are limited by plan, per account: all its keys share one counter. Over the limit you get 429 rate_limit_exceeded with a Retry-After header.

PlanLimit
Free10 requests per minute, up to 60 site uploads an hour together with the dashboard, one update per site a minute
Pro60 requests per minute
Business120 requests per minute

Endpoints

POST/api/v1/pages

Publish a page

Uploads an HTML file or a static site ZIP and publishes it on its own subdomain. Send exactly one of html_file and site_archive. A random subdomain is assigned by default; set your own in the subdomain field.

Request body multipart/form-data
FieldTypeRequiredDescription
html_filefilenoA single HTML file, saved as index.html. Exactly one content source.
site_archivefilenoA static site ZIP: the entry page is the root index.html or the first HTML file in the archive root. The unpacked site must be up to 200 MB and fit in the free storage space.
subdomainstringnoPreferred subdomain ({subdomain}.htmlkin.io), 3–63 characters a-z, 0-9, “-” (not at the ends). 409 if taken.
pinstringnoA 4-digit PIN (0000–9999) to protect viewing. On paid plans.
visibilitystringnoWho can open the site: public — anyone, search engines index it; link — anyone with the link, not indexed; team — the account's team members after signing in, on the Business plan; private — only the account owner after signing in. Defaults to public.
Example request
curl -X POST https://htmlkin.io/api/v1/pages \
  -H "Authorization: Bearer $HTMLKIN_API_KEY" \
  -F "html_file=@index.html" \
  -F "subdomain=mypage"
Response 201
{
  "id": "abc123",
  "url": "https://mypage.htmlkin.io",
  "expires_at": null,
  "created_at": "2026-06-14T07:00:00Z",
  "updated_at": "2026-06-14T07:00:00Z",
  "file_count": 1,
  "entry_path": "index.html",
  "visibility": "public"
}
PUT/api/v1/pages/{id}

Update a page

Replaces the whole site with new HTML or ZIP at the same address and/or changes the PIN and visibility. The page URL stays the same. Send at most one of html_file and site_archive; you can send only pin and/or visibility to change just protection or visibility.

Request body multipart/form-data
FieldTypeRequiredDescription
html_filefilenoA new HTML file (optional; not together with site_archive).
site_archivefilenoA new complete site ZIP; all previous files are replaced.
pinstringno4 digits set or change the PIN; an empty string removes it.
visibilitystringnoWho can open the site: public — anyone, search engines index it; link — anyone with the link, not indexed; team — the account's team members after signing in, on the Business plan; private — only the account owner after signing in.
Example request
curl -X PUT https://htmlkin.io/api/v1/pages/abc123 \
  -H "Authorization: Bearer $HTMLKIN_API_KEY" \
  -F "html_file=@index.html"
Response 200
{
  "id": "abc123",
  "url": "https://mypage.htmlkin.io",
  "expires_at": null,
  "created_at": "2026-06-14T07:00:00Z",
  "updated_at": "2026-06-14T07:10:00Z",
  "size_bytes": 12345,
  "file_count": 8,
  "entry_path": "index.html",
  "pin_protected": false,
  "visibility": "public"
}
GET/api/v1/pages/{id}

Get page details

Returns page metadata: address, site size, file count, entry point, lifetime, PIN protection and visibility.

Path parameters
ParameterDescription
idPage ID.
Example request
curl -X GET https://htmlkin.io/api/v1/pages/abc123 \
  -H "Authorization: Bearer $HTMLKIN_API_KEY"
Response 200
{
  "id": "abc123",
  "url": "https://mypage.htmlkin.io",
  "expires_at": null,
  "created_at": "2026-06-14T07:00:00Z",
  "updated_at": "2026-06-14T07:10:00Z",
  "size_bytes": 12345,
  "file_count": 8,
  "entry_path": "index.html",
  "pin_protected": false,
  "visibility": "public"
}
DELETE/api/v1/pages/{id}

Delete a page

Deletes the page permanently. If a custom domain was attached to the page, the domain stays in the account — only its link to this page is removed.

Path parameters
ParameterDescription
idPage ID.
Example request
curl -X DELETE https://htmlkin.io/api/v1/pages/abc123 \
  -H "Authorization: Bearer $HTMLKIN_API_KEY"
Response 200
{
  "id": "abc123",
  "deleted": true
}

Error codes

The error body is always the same: { "error": "<code>", "message": "<description>" }.

HTTPerrorDescription
400invalid_fileThe single file doesn't look like HTML.
400invalid_siteInvalid combination of sources or an invalid set of site files.
400invalid_archiveThe ZIP is damaged, encrypted or uses an unsupported format.
400invalid_pathInvalid, unsafe or duplicate file path.
400missing_entry_fileThere is no HTML file in the site root.
400too_many_filesThe site has more than 500 useful files.
400banner_removalA site file contains code that removes the htmlkin promo bar; the bar goes away on a paid plan.
400invalid_pinThe PIN is not 4 digits.
400invalid_visibilityvisibility is not one of public, link, team, private.
400invalid_subdomainThe subdomain has invalid characters (allowed: a-z, 0-9, “-”).
401invalid_api_keyInvalid or missing API key.
403account_bannedThe account has been blocked for violating the terms of service.
403team_visibility_requires_planteam is available on the Business plan.
403content_blockedThe entry page (index.html) is byte-for-byte identical to a page of a site blocked for violating the terms of service.
403dangerous_linkThe page links to a URL that Google Web Risk flags as phishing or malware.
403page_limit_exceededThe plan's active site limit has been reached.
404not_foundThe page was not found or belongs to another owner.
409subdomain_takenThe requested subdomain is already taken.
413file_too_largeThe unpacked site is larger than 200 MB, the limit for a single upload.
413storage_limit_exceededThe site doesn't fit in the storage: together with the account's other active sites it would exceed the plan's storage. On update, the space of the site's current version counts as free.
429rate_limit_exceededToo many requests; the response has a Retry-After header.

Testing and client generation

The API is described by a machine-readable OpenAPI 3.1 spec. Import it to send requests interactively and generate a ready-made client for your language:

  • Swagger UI / Postman — paste https://htmlkin.io/api/v1/openapi.json, set the Bearer key and call endpoints right from your browser.
  • openapi-generator — generate an SDK for Python, TypeScript, Go and other languages with a single command from the same spec.

Publishing from AI assistants (MCP)

The same API is available through the MCP server https://htmlkin.io/mcp — Claude and other assistants publish and update sites right from the chat, with your API key. Nothing to install or run.

Set up the MCP server →