Create an HTML page
Creates an empty HTML page on a current site that already has a domain. Requires a paid plan. Upload index.html next. A builder page is not created by this route.
Required scope: pages:write.
Create an HTML page › Request Body
nameName shown in the pages list.
site_idSite id from GET /sites. The site must be on current hosting and already have a domain.
slugPath on the site. Empty publishes at the site root.
Create an HTML page › Responses
The created HTML page.
idPage id.
namePage name.
kindhtml.
site_idSite id.
slugPath on the site.
preview_urlAddress of the source index.html.
List HTML page files
Upload HTML page files
Send archive as a base64 zip up to 50 MB, or files for individual files. Text files use content. Images and fonts use data as base64. This body can be up to 70 MB. One HTML file is renamed to index.html and renamed_from is the original path. Several HTML files and no index.html return index_ambiguous, and details lists the paths. Send entry with the main path and call again. An upload with no HTML file is rejected until index.html exists. The upload changes the source copy. The live URL changes on POST /pages/{pageId}/html/publish. A builder page returns page_is_builder.
Required scope: pages:write.
path Parameters
pageIdHTML page id.
Upload HTML page files › Request Body
archiveBase64 zip of the site. Maximum 50 MB decoded.
Individual files. Use this or archive.
entryMain HTML file to rename to index.html. Required only when the upload has several HTML files and no index.html.
site_idSite id, when it should change.
slugPath on the site.
Upload HTML page files › Responses
The stored source files.
idPage id.
page_idPage id.
site_idSite id.
slugPath on the site.
renamed_fromOriginal path when one HTML file was renamed to index.html.
preview_urlAddress of the source index.html.
file_countFiles stored for the page.
bytesTotal size in bytes.
has_indextrue when index.html is stored.
Tags read from index.html. Null when this upload did not include it.
Read an HTML page file
Returns one text file: HTML, CSS, JavaScript, JSON, text, SVG, or XML. Up to 1 MB. Pass selectors as a JSON array to return those elements instead of the whole file. Each selector that matches nothing or more than one element returns the count and no html. html and body are refused.
Required scope: pages:read.
path Parameters
pageIdHTML page id.
query Parameters
pathFile path, such as index.html or css/app.css.
selectorsJSON array of CSS selectors, such as ["#faq","#hero-title"]. Omit it to return the whole file.
Read an HTML page file › Responses
The file text.
page_idPage id.
pathFile path.
contentFile text. Absent when selectors were requested.
One result per requested selector.
Replace an HTML page file
Replaces one text file, up to 1 MB. Images and fonts go through POST /pages/{pageId}/files. This updates the source copy. To change one element, use POST /pages/{pageId}/file/edit. When writing HTML, put a unique id on each section and on each block a person may change.
Required scope: pages:write.
path Parameters
pageIdHTML page id.
Replace an HTML page file › Request Body
pathText file to replace.
contentFull file text. Maximum 1 MB.
Replace an HTML page file › Responses
The replaced file.
page_idPage id.
pathFile path.
preview_urlAddress of the source index.html.
file_countFiles stored for the page.
bytesTotal size in bytes.
has_indextrue when index.html is stored.
Tags read when the replaced file is index.html.
Delete an HTML page file
index.html cannot be deleted. Replace it with an upload. Returns index_required if path is index.html.
Required scope: pages:write.
path Parameters
pageIdHTML page id.
Delete an HTML page file › Request Body
pathFile to remove. index.html cannot be deleted.
Delete an HTML page file › Responses
The file was removed.
page_idPage id.
successtrue when the file was removed.
preview_urlAddress of the source index.html.
file_countFiles remaining.
bytesTotal size in bytes.
has_indextrue when index.html is still stored.
Edit HTML elements by selector
Changes elements in one HTML file. The rest of the file stays as it is. edits is one change or a list of up to 20. selector must match exactly one element. action is replace, contents, before, after, or remove. replace swaps the element and should keep its id. contents swaps the inside and keeps the tag. If any selector is missing, ambiguous, or overlaps another edit, the file is not saved. This updates the source copy. Publish to update the live URL. html and body are refused.
Required scope: pages:write.
path Parameters
pageIdHTML page id.
Edit HTML elements by selector › Request Body
pathHTML file to edit, usually index.html.
The edits to apply together.
Edit HTML elements by selector › Responses
The edited source file.
page_idPage id.
pathFile path.
preview_urlAddress of the source index.html.
Edits that were applied.
file_countFiles stored for the page.
bytesTotal size in bytes.
has_indextrue when index.html is stored.
Tags read when the edited file is index.html.
Publish an HTML page
Copies the source files to the live slug, adds Atomicat tracking to that live copy, and keeps the uploaded source unchanged. Requires index.html. Each publish keeps the last five source copies. slug_taken means another page on the site already uses the slug.
Required scope: any of pages:publish, pages:write.
path Parameters
pageIdHTML page id.
Publish an HTML page › Request Body
site_idSite id. Defaults to the page site.
slugPath on the site. Defaults to the page slug.
Publish an HTML page › Responses
The live page.
idPage id.
page_idPage id.
successtrue when publish succeeded.
urlLive URL.
domainPublished domain.
slugPublished path.
preview_urlAddress of the source index.html.
revision_idId of the source copy saved by this publish.
cache_purge_failedtrue when the page was published and the cache purge failed.
restored_fromRevision id that was restored, when this publish came from a restore.
List published HTML copies
Returns up to five published source copies, newest first. The body is a JSON array.
Required scope: pages:read.
path Parameters
pageIdHTML page id.
List published HTML copies › Responses
Matching records. The body is a JSON array.
idRevision id. Send this to the restore route.
published_atISO-8601 publish time.
file_countFiles in that copy.
bytesSize of that copy.
slugSlug at publish time.
Restore a published HTML copy
Replaces the source with that published copy and publishes it. Files added after that version are removed. revision_id comes from GET /pages/{pageId}/html/revisions.
Required scope: any of pages:publish, pages:write.
path Parameters
pageIdHTML page id.
revisionIdRevision id.
Restore a published HTML copy › Responses
The restored live page.
idPage id.
page_idPage id.
successtrue when publish succeeded.
urlLive URL.
domainPublished domain.
slugPublished path.
preview_urlAddress of the source index.html.
revision_idId of the source copy saved by this publish.
cache_purge_failedtrue when the page was published and the cache purge failed.
restored_fromRevision id that was restored, when this publish came from a restore.