Publish a new site
Publish an HTML page, a zipped static site (with index.html at the top level) or a PDF as a new site. The call waits up to about 20 seconds for scanning and publishing, so it usually answers 201 with the live URL.
An API key from Settings in the dashboard (fpk_...), or an OAuth access token from the MCP sign-in.
In: header
Query Parameters
Link name for the new site: 3 to 63 lowercase letters, digits and hyphens. Leave it out for a random name.
Only needed when the Content-Type doesn't say what the file is (for example application/octet-stream): the extension (.html, .zip, .pdf) decides.
The page or file. Send the raw file with its Content-Type, or JSON with an html field (an AI chat reply is fine: a ```html fence and text around it are stripped). Up to 25 MB; bigger files use the two-step upload.
The page. A reply pasted from an AI chat is fine: a ```html fence and text around it are stripped.
New sites only: the link name. Null or missing picks a random one.
Response Body
curl -X POST "https://flatpage.app/v1/sites?linkName=spring-menu&filename=site.zip" \ -H "Content-Type: application/json" \ -d '{ "html": "<!doctype html><title>Spring menu</title><h1>Spring menu</h1>", "linkName": "spring-menu" }'{
"uploadId": "8d0c6f1e-2b7a-4f0e-b1c4-5e9a7d3c2f10",
"status": "published",
"site": {
"id": "3f5e2a90-6b1d-4c1e-9a43-0d6c2f8e7b21",
"slug": "spring-menu",
"title": "Spring menu",
"kind": "html",
"status": "active",
"url": "https://spring-menu.flatpage.page",
"version": 1,
"bytes": 48213,
"updatedAt": "2026-11-02T15:40:00Z",
"views": 128,
"passwordProtected": false,
"noindex": false,
"share": {
"title": "string",
"description": "string",
"image": "string",
"imagePending": true,
"faviconPending": true,
"preview": {
"title": "string",
"description": "string",
"imageUrl": "string",
"faviconUrl": "string"
}
},
"notifyUnlock": true,
"spaMode": "auto",
"pdfDownload": true,
"emailGate": {
"enabled": true,
"headline": "string",
"consent": "string"
},
"feedbackMode": true,
"formsEnabled": true,
"routing": {
"spaDetected": true,
"has404": true,
"redirects": 0,
"warnings": [
"string"
]
}
},
"warnings": [
"string"
]
}{
"uploadId": "8d0c6f1e-2b7a-4f0e-b1c4-5e9a7d3c2f10",
"status": "published",
"site": {
"id": "3f5e2a90-6b1d-4c1e-9a43-0d6c2f8e7b21",
"slug": "spring-menu",
"title": "Spring menu",
"kind": "html",
"status": "active",
"url": "https://spring-menu.flatpage.page",
"version": 1,
"bytes": 48213,
"updatedAt": "2026-11-02T15:40:00Z",
"views": 128,
"passwordProtected": false,
"noindex": false,
"share": {
"title": "string",
"description": "string",
"image": "string",
"imagePending": true,
"faviconPending": true,
"preview": {
"title": "string",
"description": "string",
"imageUrl": "string",
"faviconUrl": "string"
}
},
"notifyUnlock": true,
"spaMode": "auto",
"pdfDownload": true,
"emailGate": {
"enabled": true,
"headline": "string",
"consent": "string"
},
"feedbackMode": true,
"formsEnabled": true,
"routing": {
"spaDetected": true,
"has404": true,
"redirects": 0,
"warnings": [
"string"
]
}
},
"warnings": [
"string"
]
}{
"error": "site not found"
}{
"error": "site not found"
}{
"error": "site not found"
}{
"error": "site not found"
}{
"error": "site not found"
}{
"error": "site not found"
}{
"error": "site not found"
}{
"error": "site not found"
}API overview
Every endpoint of the Flatpage REST API, generated from its OpenAPI spec.
Update a site PUT
Replace a site's content with a new version. The link stays the same, so anything already shared (a QR code, an email) shows the update. Same body as publishing; `linkName` isn't allowed here (rename with `PUT /sites/{site}/link-name`).