Quickstart
Publish your first page with the API in two minutes.
Create an API key
Sign in to the dashboard, open Settings, and create a key under API keys. It starts with fpk_ and is shown once, so copy it now. Then put it in your shell:
export FLATPAGE_API_KEY=fpk_...Check it works
curl https://flatpage.app/v1/me -H "Authorization: Bearer $FLATPAGE_API_KEY"{
"email": "[email protected]",
"plan": "free",
"sites": 0,
"maxSites": 1,
"uploadsToday": 0,
"uploadsPerDay": 3,
...
}Publish a page
Send an HTML file as the body. linkName is optional; leave it out for a random name.
curl -X POST "https://flatpage.app/v1/sites?linkName=spring-menu" \
-H "Authorization: Bearer $FLATPAGE_API_KEY" \
-H "Content-Type: text/html" \
--data-binary @index.htmlThe call waits while the page is scanned and published, usually a few seconds, and answers with the live link:
HTTP/1.1 201 Created
{
"uploadId": "8d0c6f1e-…",
"status": "published",
"site": {
"id": "3f5e2a90-…",
"slug": "spring-menu",
"url": "https://spring-menu.flatpage.page",
"kind": "html",
"status": "active",
"version": 1,
...
}
}Update it at the same link
curl -X PUT "https://flatpage.app/v1/sites/spring-menu" \
-H "Authorization: Bearer $FLATPAGE_API_KEY" \
-H "Content-Type: text/html" \
--data-binary @index.htmlThe link doesn't change, so anything you already shared (an email, a QR code) shows the new version.
Next
- Publishing: zips, PDFs, JSON bodies and link names.
- JavaScript and Python examples.
- Errors and limits.