Publish (create or replace) a site
const url = 'https://example.com/ingest/sites';const form = new FormData();form.append('meta', '{ "group": "example", "slug": "example", "title": "example", "description": "example", "date": "example", "tags": [ "example" ], "repo": "example", "preview": "example", "hidden": true }');form.append('bundle', 'file');form.append('index', 'file');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/ingest/sites \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form 'meta={ "group": "example", "slug": "example", "title": "example", "description": "example", "date": "example", "tags": [ "example" ], "repo": "example", "preview": "example", "hidden": true }' \ --form bundle=@file \ --form index=@fileRequires the publish capability on the target group (admin keys always
pass). Idempotent: the same group/slug replaces the existing site.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”multipart/form-data with a JSON meta part and either a bundle
(a .tar.gz or .zip archive containing an index.html) or an
index (a single self-contained HTML document). The archive format is
detected from its magic bytes, not the field or file name.
object
The meta part of a publish request.
object
A .tar.gz or .zip archive containing a top-level index.html.
For .zip, if every file lives under one common top-level directory
(e.g. a zipped folder site/index.html), that directory is stripped
so index.html lands at the site root.
A single self-contained HTML document (becomes index.html).
Responses
Section titled “ Responses ”The published site.
object
Examplegenerated
{ "url": "https://example.com", "group": "example", "slug": "example", "updated_at": "2026-04-15T12:00:00Z"}Invalid request (bad path, malformed body, or missing content).
object
Examplegenerated
{ "error": "example"}Missing or invalid credentials.
object
Examplegenerated
{ "error": "example"}Authenticated, but not permitted for this target/capability.
object
Examplegenerated
{ "error": "example"}