# WebsitePublisher.ai > AI-powered website publishing. You build it, we host it. WebsitePublisher.ai enables AI assistants to create, manage, and publish complete websites through a simple REST API. Users provide you with an API token, you build their website. ## Quick Start 1. User creates account at websitepublisher.ai 2. User creates a project and receives an API token 3. User gives YOU the token 4. You use PAPI to build and publish their website ## Authentication All API requests require a Bearer token: ``` Authorization: Bearer {token} ``` The token is tied to a specific project. Users will provide both. ## API Base URL ``` https://api.websitepublisher.ai ``` ## Core Endpoints ### Create a Page ``` POST /project/{project_id}/pages Content-Type: application/json { "slug": "index.html", "content": "...", "meta": {"title": "Page Title"} } ``` ### Upload an Asset ``` POST /project/{project_id}/assets Content-Type: application/json { "slug": "images/logo.png", "content": "{base64_encoded_data}", "alt": "Logo" } ``` ### List All Pages ``` GET /project/{project_id}/pages ``` ### Update a Page ``` PUT /project/{project_id}/pages/{slug} ``` ### Delete a Page ``` DELETE /project/{project_id}/pages/{slug} ``` ## Building a Complete Website Here's a typical workflow: 1. **Create the homepage** ``` POST /project/{id}/pages {"slug": "index.html", "content": "...", "meta": {"title": "Home"}} ``` 2. **Create additional pages** ``` POST /project/{id}/pages {"slug": "about.html", "content": "...", "meta": {"title": "About"}} ``` 3. **Upload images and assets** ``` POST /project/{id}/assets {"slug": "images/hero.jpg", "content": "{base64}", "alt": "Hero image"} ``` 4. **Verify your work** ``` GET /project/{id}/status ``` ## Response Format Success: ```json {"success": true, "data": {...}} ``` Error: ```json {"success": false, "error": {"message": "...", "code": 400}} ``` ## Important Notes - Slugs are file paths: `index.html`, `blog/post1.html`, `images/logo.png` - Slugs cannot be changed after creation (delete and recreate instead) - Assets are served via CDN at `https://cdn.websitepublisher.ai/` - HTML content should be complete documents (include DOCTYPE, html, head, body) ## Full Documentation - PAPI Reference: https://websitepublisher.ai/docs/papi.html - MAPI Reference: https://websitepublisher.ai/docs/mapi.html - Quick Start Guide: https://websitepublisher.ai/docs/quickstart.html ## Contact - Website: https://websitepublisher.ai - Platform powered by: https://websumo.com