{"openapi": "3.1.0", "info": {"title": "Warasoft Pages", "version": "1.3.0", "description": "Publish static websites (up to 5 pages) at https://<subdomain>.warasoft.com/. Every site has a Spanish and an English version, served by the visitor's device language with a switch (?lang=es / ?lang=en). Warasoft appends a 'Built with warasoft.com' banner to every page."}, "servers": [{"url": "https://warasoft.com"}], "paths": {"/api/pages/": {"post": {"operationId": "createSite", "summary": "Publish a new site. Returns its URLs and an edit key for future updates.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["email", "title", "html", "title_en", "html_en"], "properties": {"email": {"type": "string", "format": "email", "description": "Owner email. Links the site to its owner."}, "title": {"type": "string", "maxLength": 160, "description": "Spanish title of the home page (title_es is also accepted)."}, "html": {"type": "string", "description": "Spanish home page (html_es is also accepted). Complete page markup: HTML with CSS inside <style> tags. No JavaScript: scripts, event handlers, iframes and forms are removed. Images: https URLs or uploaded files referenced as /assets/<name>. Link between pages with /<slug>/."}, "title_en": {"type": "string", "maxLength": 160, "description": "English title of the home page."}, "html_en": {"type": "string", "description": "English home page. Complete page markup: HTML with CSS inside <style> tags. No JavaScript: scripts, event handlers, iframes and forms are removed. Images: https URLs or uploaded files referenced as /assets/<name>. Link between pages with /<slug>/."}, "pages": {"type": "array", "maxItems": 4, "items": {"type": "object", "required": ["slug", "title", "html", "title_en", "html_en"], "properties": {"slug": {"type": "string", "description": "Path of the page, e.g. 'servicios' for /servicios/ (same for both languages)."}, "title": {"type": "string", "maxLength": 160, "description": "Spanish title."}, "html": {"type": "string", "description": "Spanish version. Complete page markup: HTML with CSS inside <style> tags. No JavaScript: scripts, event handlers, iframes and forms are removed. Images: https URLs or uploaded files referenced as /assets/<name>. Link between pages with /<slug>/."}, "title_en": {"type": "string", "maxLength": 160, "description": "English title."}, "html_en": {"type": "string", "description": "English version. Complete page markup: HTML with CSS inside <style> tags. No JavaScript: scripts, event handlers, iframes and forms are removed. Images: https URLs or uploaded files referenced as /assets/<name>. Link between pages with /<slug>/."}}}, "description": "Up to 4 extra pages (5 pages in total). On update, replaces all extra pages."}, "redirect_url": {"type": "string", "description": "Optional https:// address. When set, the site redirects there."}, "subdomain": {"type": "string", "description": "Optional name, e.g. 'perrobonito' for perrobonito.warasoft.com."}}}}}}, "responses": {"201": {"description": "Published"}, "409": {"description": "Subdomain taken; see suggestion"}}}}, "/api/pages/availability/": {"get": {"operationId": "checkSubdomain", "summary": "Check whether a subdomain is free.", "parameters": [{"name": "subdomain", "in": "query", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Availability and a suggestion when taken"}}}}, "/api/pages/{subdomain}/": {"patch": {"operationId": "updateSite", "summary": "Update a site. With the edit key it publishes now; without it the owner must confirm by email.", "parameters": [{"name": "subdomain", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["email"], "properties": {"email": {"type": "string", "format": "email", "description": "Owner email. Links the site to its owner."}, "title": {"type": "string", "maxLength": 160, "description": "Spanish title of the home page (title_es is also accepted)."}, "html": {"type": "string", "description": "Spanish home page (html_es is also accepted). Complete page markup: HTML with CSS inside <style> tags. No JavaScript: scripts, event handlers, iframes and forms are removed. Images: https URLs or uploaded files referenced as /assets/<name>. Link between pages with /<slug>/."}, "title_en": {"type": "string", "maxLength": 160, "description": "English title of the home page."}, "html_en": {"type": "string", "description": "English home page. Complete page markup: HTML with CSS inside <style> tags. No JavaScript: scripts, event handlers, iframes and forms are removed. Images: https URLs or uploaded files referenced as /assets/<name>. Link between pages with /<slug>/."}, "pages": {"type": "array", "maxItems": 4, "items": {"type": "object", "required": ["slug", "title", "html", "title_en", "html_en"], "properties": {"slug": {"type": "string", "description": "Path of the page, e.g. 'servicios' for /servicios/ (same for both languages)."}, "title": {"type": "string", "maxLength": 160, "description": "Spanish title."}, "html": {"type": "string", "description": "Spanish version. Complete page markup: HTML with CSS inside <style> tags. No JavaScript: scripts, event handlers, iframes and forms are removed. Images: https URLs or uploaded files referenced as /assets/<name>. Link between pages with /<slug>/."}, "title_en": {"type": "string", "maxLength": 160, "description": "English title."}, "html_en": {"type": "string", "description": "English version. Complete page markup: HTML with CSS inside <style> tags. No JavaScript: scripts, event handlers, iframes and forms are removed. Images: https URLs or uploaded files referenced as /assets/<name>. Link between pages with /<slug>/."}}}, "description": "Up to 4 extra pages (5 pages in total). On update, replaces all extra pages."}, "redirect_url": {"type": "string", "description": "Optional https:// address. When set, the site redirects there."}, "edit_key": {"type": "string", "description": "Key returned on creation (wpk_...)."}}}}}}, "responses": {"200": {"description": "Updated"}, "202": {"description": "Waiting for owner confirmation"}, "403": {"description": "Wrong email or edit key"}}}}, "/api/pages/{subdomain}/assets/": {"post": {"operationId": "uploadImages", "summary": "Upload PNG, JPEG, GIF or WebP images (max 3 MB each, 20 per site) as files, or send JSON with an image URL. They are served at /assets/<name>.", "parameters": [{"name": "subdomain", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"type": "object", "required": ["email", "edit_key", "files"], "properties": {"email": {"type": "string", "format": "email"}, "edit_key": {"type": "string"}, "files": {"type": "array", "items": {"type": "string", "format": "binary"}}}}}, "application/json": {"schema": {"type": "object", "required": ["email", "edit_key", "url"], "properties": {"email": {"type": "string", "format": "email"}, "edit_key": {"type": "string"}, "url": {"type": "string", "description": "Public https:// URL of the image; Warasoft downloads it."}, "filename": {"type": "string", "description": "Optional name, e.g. 'logo'. The extension follows the image format."}}}}}}, "responses": {"201": {"description": "Uploaded; returns the public URL of each image"}, "403": {"description": "Wrong email or edit key"}}}}}}