{"openapi":"3.0.3","info":{"title":"SiteForge AI — Site Builder API","version":"1.0.0","description":"Create and manage AI-generated websites programmatically — the same engine behind the SiteForge AI dashboard. Every request is scoped to the account that owns the API key and counts against that account's plan (e.g. website limits) exactly like the dashboard does.\n\n### Authentication\nGenerate a key from **Dashboard → Settings → API keys**, then send it as a bearer token:\n\n```\nAuthorization: Bearer sfk_live_...\n```\n\n### Rate limits\n60 requests/minute per API key. Exceeding this returns `429`.\n\n### Errors\nAll errors share the shape `{ \"error\": { \"message\": \"...\" } }`, with a matching HTTP status code.","contact":{"name":"SiteForge AI"}},"servers":[{"url":"https://auwebs.com","description":"Current environment"}],"security":[{"apiKeyAuth":[]}],"tags":[{"name":"Sites","description":"Create, read, update, and delete AI-generated websites."},{"name":"Templates","description":"Starting-point designs a site can be built from."}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"sfk_live_...","description":"API key from Dashboard → Settings → API keys."}},"schemas":{"Site":{"type":"object","properties":{"id":{"type":"string","example":"cm123abc456"},"businessName":{"type":"string","example":"The Digital Coders"},"subdomain":{"type":"string","example":"the-digital-coders"},"url":{"type":"string","format":"uri","example":"https://the-digital-coders.aiwebsite.test"},"category":{"type":"string","example":"Coaching Institute"},"description":{"type":"string"},"ctaText":{"type":"string","example":"Get in Touch"},"seoDescription":{"type":"string"},"theme":{"type":"object","description":"Site theme — colors, fonts, design tokens. Shape may evolve; treat as opaque JSON.","additionalProperties":true},"blocks":{"type":"array","description":"Ordered content blocks (hero/about/highlights/services/faq). Treat as opaque JSON.","items":{"type":"object","additionalProperties":true}},"published":{"type":"boolean"},"templateId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","businessName","subdomain","url","category","description","ctaText","seoDescription","theme","blocks","published","templateId","createdAt","updatedAt"]},"Template":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","example":"Lumière"},"category":{"type":"string","example":"Restaurant & Fine Dining"},"tint":{"type":"string"},"accent":{"type":"string"},"style":{"type":"string","description":"Legacy field, informational only — no longer selects a rendering style."},"order":{"type":"integer"},"active":{"type":"boolean","description":"Inactive templates are hidden from this endpoint's results."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","category","tint","accent","style","order","active","createdAt","updatedAt"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]},"CreateSiteRequest":{"type":"object","properties":{"businessName":{"type":"string","example":"The Digital Coders"},"category":{"type":"string","example":"Coaching Institute"},"description":{"type":"string","example":"An IT training institute offering hands-on courses in web development and AI."},"templateId":{"type":"string","description":"A Template id — see GET /api/v1/templates.","example":"cm123templateid"}},"required":["businessName","category","description","templateId"]},"UpdateSiteRequest":{"type":"object","description":"Provide at least one field.","minProperties":1,"properties":{"businessName":{"type":"string"},"subdomain":{"type":"string","description":"1-40 chars, lowercase letters/numbers/hyphens, not a reserved word."},"published":{"type":"boolean"}}}}},"paths":{"/api/v1/templates":{"get":{"tags":["Templates"],"summary":"List templates","description":"Templates you can pass as `templateId` when creating a site.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Template"}}}}}}},"401":{"description":"Missing, invalid, or revoked API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded (60 requests/minute per key).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}}}}},"/api/v1/sites":{"get":{"tags":["Sites"],"summary":"List your sites","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Site"}}}}}}},"401":{"description":"Missing, invalid, or revoked API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded (60 requests/minute per key).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}}}},"post":{"tags":["Sites"],"summary":"Create a site","description":"Generates site copy with AI (headline, about, services, FAQ, etc.) from your description, then publishes it at a unique subdomain. Fails with 403 if you're at your plan's website limit.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSiteRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Site"}}}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, or revoked API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"403":{"description":"You've reached your plan's website limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded (60 requests/minute per key).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"502":{"description":"AI site generation failed. Try again.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}}}}},"/api/v1/sites/{id}":{"get":{"tags":["Sites"],"summary":"Get a site","parameters":[{"name":"id","in":"path","required":true,"description":"Site ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Site"}}}}}},"401":{"description":"Missing, invalid, or revoked API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"No site with that ID owned by this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded (60 requests/minute per key).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}}}},"patch":{"tags":["Sites"],"summary":"Update a site","description":"Update the business name, subdomain, and/or published status.","parameters":[{"name":"id","in":"path","required":true,"description":"Site ID.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSiteRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Site"}}}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, or revoked API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"No site with that ID owned by this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"409":{"description":"That subdomain is already taken.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded (60 requests/minute per key).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}}}},"delete":{"tags":["Sites"],"summary":"Delete a site","parameters":[{"name":"id","in":"path","required":true,"description":"Site ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"}}}}}}}},"401":{"description":"Missing, invalid, or revoked API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"No site with that ID owned by this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded (60 requests/minute per key).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["error"]}}}}}}}}}