API driven public website platform
AutoPostSite Content API
This site shell renders public pages that are published through the API. The chrome is fixed; the main content is supplied as HTML with optional CSS, JavaScript, and uploaded assets.
Authentication
Publishing endpoints require an API key in the X-AutoPost-Api-Key header. Configure keys with ContentApi:ApiKeys or environment variables such as ContentApi__ApiKeys__0.
Content modes
Single payload
Post one JSON document containing slug, title, html, optional css, and optional javaScript.
Multi-file payload
Post multipart form data with a JSON manifest field plus separate files. The manifest names the HTML file, CSS files, JavaScript files, and assets.
Core endpoints
GET /api/content/pages List published pages.
GET /api/content/pages/{slug} Return a public page payload.
POST /api/content/pages/single Publish combined HTML/CSS/JS.
POST /api/content/pages/multifile Publish manifest plus separate files.
DELETE /api/content/pages/{slug} Delete a page.
Publish a single page
curl.exe -X POST https://localhost:7036/api/content/pages/single ^
-H "Content-Type: application/json" ^
-H "X-AutoPost-Api-Key: <your-key>" ^
--data "{\"slug\":\"launch\",\"title\":\"Launch Page\",\"html\":\"<h1>Launch</h1><p>Published by API.</p>\",\"css\":\"h1{color:#114b5f}\",\"javaScript\":\"console.log('launch page loaded')\"}"
Publish multiple files
curl.exe -X POST https://localhost:7036/api/content/pages/multifile ^
-H "X-AutoPost-Api-Key: <your-key>" ^
-F "manifest={\"slug\":\"campaign\",\"title\":\"Campaign\",\"htmlFile\":\"index.html\",\"cssFiles\":[\"site.css\"],\"javaScriptFiles\":[\"site.js\"],\"assetFiles\":[\"hero.jpg\"]}" ^
-F "files=@index.html;filename=index.html" ^
-F "files=@site.css;filename=site.css" ^
-F "files=@site.js;filename=site.js" ^
-F "files=@hero.jpg;filename=hero.jpg"