BUILDER API ENDPOINTS ===================== 1. Get Tenant Metadata ---------------------- Method: GET Route: /api/builder/meta Request: - No body Response (200): { "success": true, "data": { "tenantId": "tenant1", "theme": "theme1", "mode": "light", "layout": { "nav": { "logo": "https://example.com/logo.png", "items": [ { "label": "Home", "href": "/", "isExternal": false }, { "label": "Products", "href": "/products", "isExternal": true, "children": [ { "label": "item1", "href": "/item1", "isExternal": true } ] } ], "style": "default" }, "footer": { "columns": [ { "title": "Company", "links": [ { "label": "About", "href": "/about" }, { "label": "Contact", "href": "/contact" } ] } ], "copyright": "© 2024 Company. All rights reserved." } }, "pages": [ { "name": "home", "title": "Home Page", "isPublished": true, "updatedAt": "2024-01-06T10:00:00Z" }, { "name": "blog", "title": "Blog", "isPublished": true, "updatedAt": "2025-12-22T06:15:15.488Z" } ] } } 2. Get Page Data ---------------- Method: GET Route: /api/builder/page/:pageName Request: - Path param: pageName (e.g., "home") - No body Response (200) - Static Page: { "success": true, "data": { "pageName": "home", "sections": [ { "id": "section-1", "type": "Hero", "variant": "centered", "data": { "title": "Welcome to Our Site", "subtitle": "Build amazing experiences", "buttonText": "Get Started", "buttonLink": "/signup", "backgroundImage": "https://example.com/hero-bg.jpg" } }, { "id": "section-2", "type": "Features", "variant": "grid", "data": { "title": "Our Features", "features": [ { "icon": "star", "title": "Fast", "description": "Lightning fast performance" } ] } } ], "updatedAt": "2024-01-06T10:00:00Z", "isDraft": true, "isDynamic": false } } Response (200) - Dynamic Page Template: { "success": true, "data": { "pageName": "blog-post", "sections": [ { "id": "section-1", "type": "BlogPost", "variant": "default", "data": { "title": "{{title}}", "content": "{{content}}", "author": "{{author}}", "publishedDate": "{{publishedDate}}", "image": "{{featuredImage}}" } } ], "updatedAt": "2024-01-06T10:00:00Z", "isDraft": true, "isDynamic": true, "dynamicConfig": { "routePattern": "blog/:slug", "paramName": "slug", "dataSource": "/api/mock/posts", "dataMatchField": "slug" } } } 4. Save Page Data ----------------- Method: PUT Route: /api/builder/page/:pageName Request: - Path param: pageName (e.g., "home") Request Payload (JSON): { "sections": [ { "id": "section-1", "type": "Hero", "variant": "centered", "data": { "title": "Updated Welcome", "subtitle": "New subtitle" } } ] } Response (200): { "success": true, "message": "Page saved successfully", "data": { "pageName": "home", "updatedAt": "2024-01-06T10:30:00Z" } } 5. Publish Page --------------- Method: POST Route: /api/builder/page/:pageName/publish Request: - Path param: pageName (e.g., "home") - No body Response (200): { "success": true, "message": "Page published successfully", "publishedAt": "2024-01-06T10:35:00Z" } 6. Publish All Pages -------------------- Method: POST Route: /api/builder/publish Request: - No body Response (200): { "success": true, "message": "All changes published successfully", "publishedAt": "2024-01-06T10:40:00Z", "publishedItems": { "pages": ["home", "about", "contact"], "header": true, "footer": true } } 7. Save Header Layout --------------------- Method: PUT Route: /api/builder/header Request Payload (JSON): { "logo": "https://example.com/logo.png", "items": [ { "label": "Home", "href": "/", "type": "link" }, { "label": "Products", "href": "/products", "type": "dynamic", "dataSource": "/api/menus?scheme=products" } ], "style": "default" } Response (200): { "success": true, "message": "Header saved successfully" } 8. Publish Header ----------------- Method: POST Route: /api/builder/header/publish Request: - No body Response (200): { "success": true, "message": "Header published successfully" } 9. Save Footer Layout --------------------- Method: PUT Route: /api/builder/footer Request Payload (JSON): { "columns": [ { "title": "Company", "links": [ { "label": "About", "href": "/about" }, { "label": "Contact", "href": "/contact" } ] }, { "title": "Legal", "links": [ { "label": "Privacy", "href": "/privacy" }, { "label": "Terms", "href": "/terms" } ] } ], "copyright": "© 2024 Company. All rights reserved.", "socialLinks": [ { "platform": "twitter", "url": "https://twitter.com/company" }, { "platform": "linkedin", "url": "https://linkedin.com/company/company" } ] } Response (200): { "success": true, "message": "Footer saved successfully" } 10. Publish Footer ------------------ Method: POST Route: /api/builder/footer/publish Request: - No body Response (200): { "success": true, "message": "Footer published successfully" } PUBLISHED API ENDPOINTS ======================= 1. Get Published Metadata ------------------------- Method: GET Route: /api/published/meta Request: - No body Response (200): { "success": true, "data": { "tenantId": "tenant1", "theme": "theme1", "mode": "light", "layout": { "nav": { ... }, "footer": { ... } }, "pages": [ { "name": "home", "title": "Home Page", "isPublished": true, "updatedAt": "2024-01-06T10:00:00Z" }, { "name": "blog", "title": "Blog", "isPublished": true, "updatedAt": "2025-12-22T06:15:15.488Z" } ], "updatedAt": "2024-01-06T10:00:00Z" } } 2. Get Published Page --------------------- Method: GET Route: /api/published/page/:pageName Request: - Path param: pageName (e.g., "home") - No body Response (200) - Static Page: { "success": true, "data": { "pageName": "home", "sections": [ ... ], "updatedAt": "2024-01-06T10:00:00Z", "isDraft": false, "isDynamic": false } } Response (200) - Dynamic Page: { "success": true, "data": { "pageName": "blog-post", "sections": [ { "id": "section-1", "type": "BlogPost", "data": { "title": "{{title}}", "content": "{{content}}", "author": "{{author}}" } } ], "isDraft": false, "isDynamic": true, "dynamicConfig": { "routePattern": "blog/:slug", "paramName": "slug", "dataSource": "/api/blog/posts", "dataMatchField": "slug" } } } DYNAMIC DATA ENDPOINTS ====================== 1. Get Menu Items ----------------- Method: GET Route: /api/menus Request: - Query params: - scheme (e.g., "products") Example Request: GET /api/menus?scheme=products Response (200): { "success": true, "data": { "menuItems": [ { "label": "Product A", "href": "/products/product-a", "icon": "box" }, { "label": "Product B", "href": "/products/product-b", "icon": "box" } ] } } 2. Get Blog Posts (Example) --------------------------- Method: GET Route: /api/blog/posts Request: - Optional query param: - slug (e.g., "my-first-post") Example Request (single post): GET /api/blog/posts?slug=my-first-post Response (200) - Single Post: { "success": true, "data": { "slug": "my-first-post", "title": "My First Post", "content": "
This is the full post content...
", "author": "John Doe", "publishedDate": "2024-01-05", "featuredImage": "https://example.com/post-image.jpg", "tags": ["react", "nextjs"] } } Response (200) - All Posts: { "success": true, "data": [ { "slug": "my-first-post", "title": "My First Post", "excerpt": "Short description...", "author": "John Doe", "publishedDate": "2024-01-05" }, { "slug": "second-post", "title": "Second Post", "excerpt": "Another post...", "author": "Jane Smith", "publishedDate": "2024-01-04" } ] } 3. Get Products (Example) ------------------------- Method: GET Route: /api/mock/products Request: - Optional query param: - id (e.g., "product-123") Example Request: GET /api/mock/products?id=product-123 Response (200): { "success": true, "data": { "id": "product-123", "name": "Awesome Product", "description": "Product description here", "price": 99.99, "image": "https://example.com/product.jpg", "category": "Electronics" } }