{"openapi":"3.1.0","info":{"title":"Lindo Unified API","version":"1.0.0","description":"Unified API for Lindo.ai - Includes workspace management, websites, pages, blogs, workflows, credits, and analytics"},"servers":[{"url":"https://api.lindo.ai","description":"Lindo API Server"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Client Management","description":"Manage workspace clients"},{"name":"Website Management","description":"Manage websites"},{"name":"Page Management","description":"Manage website pages"},{"name":"Blog Management","description":"Manage website blogs"},{"name":"Workspace Management","description":"Workspace settings and team management"},{"name":"Workflows","description":"AI workflow management"},{"name":"Credits","description":"Credit balance and usage"},{"name":"Analytics","description":"Website and workspace analytics"}],"paths":{"/v1/workspace/client/create":{"post":{"tags":["Client Management"],"summary":"Create new workspace client","description":"Creates a new client for a workspace with specified email and permissions","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCreateRequest"}}}},"responses":{"200":{"description":"Client created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCreateResponse"}}}},"400":{"description":"Bad request - validation error or client already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/client/list":{"get":{"tags":["Client Management"],"summary":"List all workspace clients","description":"Retrieves a paginated list of all clients associated with the current workspace","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Page number for pagination","example":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","description":"Search term to filter clients","example":"john"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Client list retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientListResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/client/update":{"put":{"tags":["Client Management"],"summary":"Update workspace client","description":"Updates an existing client's information including website limits and suspension status","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientUpdateRequest"}}}},"responses":{"200":{"description":"Client updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientUpdateResponse"}}}},"400":{"description":"Bad request - validation error or update failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/client/delete":{"delete":{"tags":["Client Management"],"summary":"Delete workspace client","description":"Removes a client from the workspace and revokes their access","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientDeleteRequest"}}}},"responses":{"200":{"description":"Client deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientDeleteResponse"}}}},"400":{"description":"Bad request - client not found or deletion failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/client/magic-link":{"post":{"tags":["Authentication"],"summary":"Create magic link for workspace authentication","description":"Generates a magic link and verification code for passwordless authentication in a workspace","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkCreateRequest"}}}},"responses":{"200":{"description":"Magic link created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkCreateResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"403":{"description":"Forbidden - user does not have access to this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Not found - workspace not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/list":{"get":{"tags":["Website Management"],"summary":"List all workspace websites","description":"Retrieves a paginated list of all websites associated with the current workspace","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Page number for pagination","example":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","description":"Search term to filter websites","example":"example.com"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Website list retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteListResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/update":{"patch":{"tags":["Website Management"],"summary":"Update website information","description":"Updates website details using PATCH semantics. Undefined fields are not modified, null values clear the field. Supports business_name, business_description, custom_code_header, custom_code_footer, robots, language, and activated fields.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsitePatchRequest"}}}},"responses":{"200":{"description":"Website updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsitePatchResponse"}}}},"400":{"description":"Bad request - validation error or update failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/delete":{"delete":{"tags":["Website Management"],"summary":"Delete website","description":"Permanently deletes a website and all associated data","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteDeleteRequest"}}}},"responses":{"200":{"description":"Website deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteDeleteResponse"}}}},"400":{"description":"Bad request - deletion failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/assign":{"post":{"tags":["Website Management"],"summary":"Assign website to client","description":"Assigns a website to a client","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteAssignRequest"}}}},"responses":{"200":{"description":"Website assigned to client successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteAssignResponse"}}}},"400":{"description":"Bad request - website or client not found in workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}":{"get":{"tags":["Website Management"],"summary":"Get website details","description":"Retrieves detailed information about a specific website including settings, integrations, and configuration.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"website_abc123"},"required":true,"name":"website_id","in":"path"}],"responses":{"200":{"description":"Website details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteDetailsResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/settings":{"put":{"tags":["Website Management"],"summary":"Update website settings","description":"Updates website settings including business name, description, language, theme, and custom code.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"website_abc123"},"required":true,"name":"website_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteSettingsUpdateRequest"}}}},"responses":{"200":{"description":"Website settings updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteSettingsUpdateResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/domain":{"post":{"tags":["Website Management"],"summary":"Add custom domain","description":"Initiates custom domain setup for a website. Returns agent-ready DNS records with instructions.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"website_abc123"},"required":true,"name":"website_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteDomainAddRequest"}}}},"responses":{"200":{"description":"Custom domain setup initiated with DNS records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteDomainAddResponse"}}}},"400":{"description":"Bad request - domain already in use or validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"delete":{"tags":["Website Management"],"summary":"Remove custom domain","description":"Removes the custom domain from a website, reverting to the default domain.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"website_abc123"},"required":true,"name":"website_id","in":"path"}],"responses":{"200":{"description":"Custom domain removed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteDomainRemoveResponse"}}}},"400":{"description":"Bad request - website has no custom domain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/team":{"post":{"tags":["Website Management"],"summary":"Add team member","description":"Adds a team member to a website with Editor or Commenter role.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"website_abc123"},"required":true,"name":"website_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteTeamMemberAddRequest"}}}},"responses":{"200":{"description":"Team member added successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteTeamMemberAddResponse"}}}},"400":{"description":"Bad request - email already exists or validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"get":{"tags":["Website Management"],"summary":"Get website team list","description":"Retrieves a paginated list of website team members. Verifies website ownership before returning team list.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"website_abc123"},"required":true,"name":"website_id","in":"path"}],"responses":{"200":{"description":"Website team list retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamListResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/team/{member_id}":{"delete":{"tags":["Website Management"],"summary":"Remove team member","description":"Removes a team member from a website.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"website_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the team member","example":"member_abc123"},"required":true,"name":"member_id","in":"path"}],"responses":{"200":{"description":"Team member removed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteTeamMemberRemoveResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website or team member not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/analytics":{"get":{"tags":["Analytics"],"summary":"Get website analytics","description":"Retrieves analytics data for a specific website including traffic metrics, visitor counts, and performance data. Supports optional date range filtering.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"website_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Start date for analytics data (ISO timestamp)","example":"2024-01-01T00:00:00Z"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","description":"End date for analytics data (ISO timestamp)","example":"2024-01-31T23:59:59Z"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Website analytics retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteAnalyticsResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/pages/list":{"get":{"tags":["Page Management"],"summary":"List all website pages","description":"Retrieves a paginated list of all pages (template_type = 'Web Page') for a website. Supports search filtering by name or path.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":["number","null"],"default":1,"description":"Page number for pagination","example":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","description":"Search term to filter pages by name or path","example":"home"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Page list retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageListResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/pages/{page_id}":{"get":{"tags":["Page Management"],"summary":"Get page details","description":"Retrieves detailed information about a specific page including SEO metadata, settings, and data fields.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the page","example":"page_abc123"},"required":true,"name":"page_id","in":"path"}],"responses":{"200":{"description":"Page details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDetailsResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Page not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"patch":{"tags":["Page Management"],"summary":"Update a page","description":"Updates a page using PATCH semantics. Accepts lang_code (e.g., 'en', 'es') for language and converts to display format for storage. Undefined fields are not modified, null clears the field.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the page","example":"page_abc123"},"required":true,"name":"page_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageUpdateRequest"}}}},"responses":{"200":{"description":"Page updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageUpdateResponse"}}}},"400":{"description":"Bad request - validation error or invalid language code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Page not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"delete":{"tags":["Page Management"],"summary":"Delete a page","description":"Permanently deletes a page. If the page was published, also removes the HTML file from storage and purges the cache.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the page","example":"page_abc123"},"required":true,"name":"page_id","in":"path"}],"responses":{"200":{"description":"Page deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDeleteResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Page not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/pages/create":{"post":{"tags":["Page Management"],"summary":"Create a new page","description":"Creates a new page and publishes it with full HTML content. Parses HTML to extract title, SEO metadata, and custom codes.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageCreateRequest"}}}},"responses":{"200":{"description":"Page created and published successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageCreateResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/pages/{page_id}/update":{"post":{"tags":["Page Management"],"summary":"Update a page","description":"Updates and publishes a page with full HTML content. Parses HTML to extract title, SEO metadata, and custom codes. Uses should_convert model for processing.","x-excluded":true,"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the page","example":"page_abc123"},"required":true,"name":"page_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagePublishRequest"}}}},"responses":{"200":{"description":"Page updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagePublishResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Page not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/pages/{page_id}/unpublish":{"post":{"tags":["Page Management"],"summary":"Unpublish a page","description":"Unpublishes a page by clearing the publish_date, removing it from public access.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the page","example":"page_abc123"},"required":true,"name":"page_id","in":"path"}],"responses":{"200":{"description":"Page unpublished successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageUnpublishResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Page not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/pages/{page_id}/html":{"get":{"tags":["Page Management"],"summary":"Get page HTML for editing","description":"Returns the editable HTML content of a page. Used by CLI for live editing.","x-excluded":true,"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the page","example":"page_abc123"},"required":true,"name":"page_id","in":"path"}],"responses":{"200":{"description":"Page HTML retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"result":{"type":"object","properties":{"page_id":{"type":"string"},"html":{"type":"string"},"path":{"type":"string"},"name":{"type":"string"},"seo":{"type":"object","properties":{"page_title":{"type":"string"},"meta_description":{"type":"string"}}},"settings":{"type":"object","properties":{"theme":{"type":"object","properties":{"mode":{"type":"string"},"direction":{"type":"string"},"main_classes":{"type":"string"}}}}}},"required":["page_id","html","path","name"]}},"required":["success","result"]}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Page not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/blogs/list":{"get":{"tags":["Blog Management"],"summary":"List all website blogs","description":"Retrieves a paginated list of all blogs (template_type = 'Blog Post') for a website. Supports search filtering by name or path.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":["number","null"],"default":1,"description":"Page number for pagination","example":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","description":"Search term to filter blogs by name or path","example":"announcement"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Blog list retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogListResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/blogs/{blog_id}":{"get":{"tags":["Blog Management"],"summary":"Get blog details","description":"Retrieves detailed information about a specific blog including SEO metadata, blog_settings, and data fields.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the blog","example":"blog_abc123"},"required":true,"name":"blog_id","in":"path"}],"responses":{"200":{"description":"Blog details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogDetailsResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Blog not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"patch":{"tags":["Blog Management"],"summary":"Update a blog","description":"Updates a blog using PATCH semantics. Accepts lang_code (e.g., 'en', 'es') for language and converts to display format for storage. Undefined fields are not modified, null clears the field.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the blog","example":"blog_abc123"},"required":true,"name":"blog_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogUpdateRequest"}}}},"responses":{"200":{"description":"Blog updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogUpdateResponse"}}}},"400":{"description":"Bad request - validation error or invalid language code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Blog not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"delete":{"tags":["Blog Management"],"summary":"Delete a blog","description":"Permanently deletes a blog. If the blog was published, also removes the HTML file from storage and purges the cache.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the blog","example":"blog_abc123"},"required":true,"name":"blog_id","in":"path"}],"responses":{"200":{"description":"Blog deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogDeleteResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Blog not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/blogs/create":{"post":{"tags":["Blog Management"],"summary":"Create a new blog","description":"Creates a new blog and publishes it with markdown content. Blog content is converted to HTML via generateBlogHtml.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogCreateRequest"}}}},"responses":{"200":{"description":"Blog created and published successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogCreateResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/blogs/{blog_id}/update":{"post":{"tags":["Blog Management"],"summary":"Update a blog","description":"Updates and publishes a blog with markdown content. Blog content is converted to HTML via generateBlogHtml.","x-excluded":true,"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the blog","example":"blog_abc123"},"required":true,"name":"blog_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPublishRequest"}}}},"responses":{"200":{"description":"Blog updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPublishResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Blog not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/blogs/{blog_id}/unpublish":{"post":{"tags":["Blog Management"],"summary":"Unpublish a blog","description":"Unpublishes a blog by clearing the publish_date, removing it from public access.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the blog","example":"blog_abc123"},"required":true,"name":"blog_id","in":"path"}],"responses":{"200":{"description":"Blog unpublished successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogUnpublishResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Blog not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/blogs/{blog_id}/html":{"get":{"tags":["Blog Management"],"summary":"Get blog content for editing","description":"Returns the editable content of a blog including blog_content, SEO, and blog_settings. Used by CLI for live editing.","x-excluded":true,"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"},{"schema":{"type":"string","description":"Unique identifier of the blog","example":"blog_abc123"},"required":true,"name":"blog_id","in":"path"}],"responses":{"200":{"description":"Blog content retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"result":{"type":"object","properties":{"blog_id":{"type":"string"},"blog_content":{"type":"string"},"path":{"type":"string"},"name":{"type":"string"},"seo":{"type":"object","additionalProperties":{}},"blog_settings":{"type":"object","additionalProperties":{}}},"required":["blog_id","blog_content","path","name"]}},"required":["success","result"]}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Blog not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/media/upload":{"post":{"tags":["Media Management"],"summary":"Upload a media file","description":"Uploads a single media file (image, video, document, or font) to the website's CDN storage. Returns the public CDN URL.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUploadRequest"}}}},"responses":{"200":{"description":"File uploaded successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUploadResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/website/{website_id}/media/upload/batch":{"post":{"tags":["Media Management"],"summary":"Upload multiple media files","description":"Uploads multiple media files in a single request (max 20 files). Returns CDN URLs for all uploaded files with individual success/failure status.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the website","example":"ws_abc123"},"required":true,"name":"website_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaBatchUploadRequest"}}}},"responses":{"200":{"description":"Files processed (check individual results for success/failure)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaBatchUploadResponse"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Website not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace":{"get":{"tags":["Workspace Management"],"summary":"Get workspace details","description":"Retrieves detailed information about the current workspace including settings and integrations.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Workspace details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDetailsResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"patch":{"tags":["Workspace Management"],"summary":"Update workspace settings","description":"Updates workspace settings using PATCH semantics. Accepts lang_code (e.g., 'en', 'es') for workspace_language and converts to display format for storage. Undefined fields are not modified, null clears the field.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUpdateRequest"}}}},"responses":{"200":{"description":"Workspace updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUpdateResponse"}}}},"400":{"description":"Bad request - validation error or invalid language code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/team":{"post":{"tags":["Workspace Management"],"summary":"Add team member","description":"Adds a team member to the workspace with 'Team' role.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTeamMemberAddRequest"}}}},"responses":{"200":{"description":"Team member added successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTeamMemberAddResponse"}}}},"400":{"description":"Bad request - email already exists or validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"get":{"tags":["Workspace Management"],"summary":"Get workspace team list","description":"Retrieves a paginated list of workspace team members. Verifies workspace ownership via API key.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Workspace team list retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamListResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/team/{member_id}":{"delete":{"tags":["Workspace Management"],"summary":"Remove team member","description":"Removes a team member from the workspace.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Unique identifier of the team member","example":"member_abc123"},"required":true,"name":"member_id","in":"path"}],"responses":{"200":{"description":"Team member removed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTeamMemberRemoveResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Team member not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/workspace/analytics":{"get":{"tags":["Analytics"],"summary":"Get workspace analytics","description":"Retrieves analytics data for the workspace including traffic metrics, visitor counts, and performance data. Supports optional date range filtering.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Start date for analytics data (ISO timestamp)","example":"2024-01-01T00:00:00Z"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","description":"End date for analytics data (ISO timestamp)","example":"2024-01-31T23:59:59Z"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Workspace analytics retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceAnalyticsResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/v1/ai/workspace/website":{"post":{"tags":["Workflows"],"summary":"Create website with AI prompt","description":"Starts an AI-driven website creation workflow. Returns a `workflow_id` you can poll via `GET /v1/ai/workspace/website/status/{workflow_id}`.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebsiteWorkflowRequest"}}}},"responses":{"200":{"description":"Workflow started successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponse"}}}},"400":{"description":"Invalid request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowErrorResponse"}}}}}}},"/v1/ai/workspace/website/{website_id}/page":{"post":{"tags":["Workflows"],"summary":"Create page with AI prompt","description":"Starts an AI-driven page creation workflow on an existing website. Requires website ownership verification. Returns a `workflow_id` you can poll via `GET /v1/ai/workspace/page/status/{workflow_id}`.","parameters":[{"schema":{"type":"string","description":"The ID of the website to create the page on","example":"website_abc123"},"required":true,"description":"The ID of the website to create the page on","name":"website_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePageWorkflowRequest"}}}},"responses":{"200":{"description":"Workflow started successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponse"}}}},"400":{"description":"Invalid request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - website does not belong to workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowErrorResponse"}}}}}}},"/v1/ai/workspace/website/{website_id}/blog":{"post":{"tags":["Workflows"],"summary":"Create blog with AI prompt","description":"Starts an AI-driven blog creation workflow on an existing website. Requires website ownership verification. Returns a `workflow_id` you can poll via `GET /v1/ai/workspace/blog/status/{workflow_id}`.","parameters":[{"schema":{"type":"string","description":"The ID of the website to create the blog on","example":"website_abc123"},"required":true,"description":"The ID of the website to create the blog on","name":"website_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBlogWorkflowRequest"}}}},"responses":{"200":{"description":"Workflow started successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponse"}}}},"400":{"description":"Invalid request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - website does not belong to workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowErrorResponse"}}}}}}},"/v1/ai/workspace/page/status/{workflow_id}":{"get":{"tags":["Workflows"],"summary":"Check status of a page-creation workflow","description":"Poll the status of a page-creation workflow started via `POST /v1/ai/workspace/website/{website_id}/page`. Returns an agent-friendly envelope with `done`, `status`, `message`, and (when complete) the published `result`.","parameters":[{"schema":{"type":"string","description":"The workflow_id returned by the create-page endpoint","example":"wf_abc123xyz789"},"required":true,"description":"The workflow_id returned by the create-page endpoint","name":"workflow_id","in":"path"}],"responses":{"200":{"description":"Status retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageWorkflowStatusResponse"}}}},"400":{"description":"workflow_id exists but isn't a page workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/workspace/blog/status/{workflow_id}":{"get":{"tags":["Workflows"],"summary":"Check status of a blog-creation workflow","description":"Poll the status of a blog-creation workflow started via `POST /v1/ai/workspace/website/{website_id}/blog`. Returns an agent-friendly envelope with `done`, `status`, `message`, and (when complete) the published `result`.","parameters":[{"schema":{"type":"string","description":"The workflow_id returned by the create-blog endpoint","example":"wf_abc123xyz789"},"required":true,"description":"The workflow_id returned by the create-blog endpoint","name":"workflow_id","in":"path"}],"responses":{"200":{"description":"Status retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogWorkflowStatusResponse"}}}},"400":{"description":"workflow_id exists but isn't a blog workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/workspace/website/status/{workflow_id}":{"get":{"tags":["Workflows"],"summary":"Check status of a website-creation workflow","description":"Poll the status of a website-creation workflow started via `POST /v1/ai/workspace/website`. Aggregates the home page plus every additional page: `status` is only `complete` when every page has succeeded, `partial` if the website exists but one or more pages failed.","parameters":[{"schema":{"type":"string","description":"The workflow_id returned by the create-website endpoint","example":"wf_abc123xyz789"},"required":true,"description":"The workflow_id returned by the create-website endpoint","name":"workflow_id","in":"path"}],"responses":{"200":{"description":"Status retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteWorkflowStatusResponse"}}}},"400":{"description":"workflow_id exists but isn't a website workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/workspace/website/batch":{"post":{"tags":["Workflows"],"summary":"Create multiple websites with AI (batch, max 25)","description":"Start up to 25 website-creation workflows in one request. Each returns its own `workflow_id` that can be polled via `/v1/ai/workspace/website/status/{workflow_id}`. Credits are deducted upfront and refunded per-failure.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCreateWebsiteRequest"}}}},"responses":{"200":{"description":"Batch processed. Check per-item `success`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCreateResponse"}}}},"400":{"description":"Invalid request or insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowErrorResponse"}}}}}}},"/v1/ai/workspace/website/{website_id}/page/batch":{"post":{"tags":["Workflows"],"summary":"Create multiple pages on a website with AI (batch, max 25)","description":"Start up to 25 page-creation workflows on a single website in one request. Each returns a `workflow_id` that can be polled via `/v1/ai/workspace/page/status/{workflow_id}`.","parameters":[{"schema":{"type":"string","description":"The ID of the website to create the pages on","example":"website_abc123"},"required":true,"description":"The ID of the website to create the pages on","name":"website_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCreatePageRequest"}}}},"responses":{"200":{"description":"Batch processed. Check per-item `success`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCreateResponse"}}}},"400":{"description":"Invalid request or insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"website_id does not belong to this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowErrorResponse"}}}}}}},"/v1/ai/workspace/website/{website_id}/blog/batch":{"post":{"tags":["Workflows"],"summary":"Create multiple blog posts on a website with AI (batch, max 25)","description":"Start up to 25 blog-creation workflows on a single website in one request. Each returns a `workflow_id` that can be polled via `/v1/ai/workspace/blog/status/{workflow_id}`.","parameters":[{"schema":{"type":"string","description":"The ID of the website to create the blog posts on","example":"website_abc123"},"required":true,"description":"The ID of the website to create the blog posts on","name":"website_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCreateBlogRequest"}}}},"responses":{"200":{"description":"Batch processed. Check per-item `success`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCreateResponse"}}}},"400":{"description":"Invalid request or insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"website_id does not belong to this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowErrorResponse"}}}}}}},"/v1/ai/workspace/website/status/batch":{"post":{"tags":["Workflows"],"summary":"Check status of up to 25 website workflows at once","description":"Poll the status of many website-creation workflows in one request. Returns an overall rollup `status` (scheduled / running / complete / partial / errored) plus a per-item array.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchStatusRequest"}}}},"responses":{"200":{"description":"Batch status retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchWebsiteStatusResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/workspace/page/status/batch":{"post":{"tags":["Workflows"],"summary":"Check status of up to 25 page workflows at once","description":"Poll the status of many page-creation workflows in one request. Returns an overall rollup `status` plus a per-item array.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchStatusRequest"}}}},"responses":{"200":{"description":"Batch status retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchPageStatusResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/workspace/blog/status/batch":{"post":{"tags":["Workflows"],"summary":"Check status of up to 25 blog workflows at once","description":"Poll the status of many blog-creation workflows in one request. Returns an overall rollup `status` plus a per-item array.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchStatusRequest"}}}},"responses":{"200":{"description":"Batch status retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchBlogStatusResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/credits":{"get":{"tags":["Credits"],"summary":"Get workspace credits","description":"Get credit balance for the workspace associated with the API key","responses":{"200":{"description":"Credits retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsResponse"}}}}}}},"/v1/ai/credits/client":{"get":{"tags":["Credits"],"summary":"Get client credits","description":"Get credit balance for a specific client. Requires client_id query parameter.","parameters":[{"schema":{"type":"string"},"required":true,"name":"client_id","in":"query"}],"responses":{"200":{"description":"Client credits retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsResponse"}}}},"403":{"description":"Forbidden - client does not belong to workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/credits/client/allocate":{"post":{"tags":["Credits"],"summary":"Allocate credits to a client","description":"Allocates credits from the workspace to a specific client. Requires client ownership verification.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocateClientCreditsRequest"}}}},"responses":{"200":{"description":"Credits allocated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocateClientCreditsResponse"}}}},"400":{"description":"Invalid request - missing fields or invalid values","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - client does not belong to workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ClientCreateResult":{"type":"object","properties":{"client_id":{"type":"string","description":"Unique identifier of the created client","example":"client_abc123"},"email":{"type":"string","description":"Client email address","example":"client@example.com"},"full_name":{"type":"string","description":"Client full name","example":"John Doe"},"suspended":{"type":"boolean","description":"Whether the client is suspended","example":false},"website_limit":{"type":"number","description":"Maximum websites allowed","example":1},"credit_limit":{"type":"number","description":"Credit limit for client","example":100},"created_date":{"type":"string","description":"Date when the client was created","example":"2024-01-15T10:30:00Z"}},"required":["client_id","email","created_date"]},"ClientCreateResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/ClientCreateResult"}},"required":["success","result"]},"ApiErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Indicates the operation failed","example":false},"errors":{"type":"array","items":{"type":"string"},"description":"Array of error messages","example":["Client already exists"]},"message":{"type":"string","description":"Optional error message","example":"Validation failed"}},"required":["success","errors"]},"ClientCreateRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Client email address","example":"client@example.com"},"website_limit":{"type":"number","default":1,"description":"Maximum websites allowed for this client","example":1},"full_name":{"type":"string","description":"Client full name","example":"John Doe"},"credit_limit":{"type":"number","description":"Credit limit for client","example":100},"send_invitation":{"type":"boolean","default":false,"description":"Send invitation email to the client. Defaults to false.","example":false}},"required":["email"]},"ClientListItem":{"type":"object","properties":{"client_id":{"type":"string","description":"Unique identifier of the client","example":"client_abc123"},"email":{"type":"string","description":"Client email address","example":"client@example.com"},"full_name":{"type":"string","description":"Client full name","example":"John Doe"},"created_date":{"type":"string","description":"Date when the client was created","example":"2024-01-15T10:30:00Z"},"website_limit":{"type":"number","description":"Maximum websites allowed for this client","example":5},"suspended":{"type":"boolean","description":"Whether the client is suspended","example":false}},"required":["client_id","email","created_date"]},"ClientListResult":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/ClientListItem"},"description":"Array of client items"},"total":{"type":"number","description":"Total number of clients","example":25}},"required":["list","total"]},"ClientListResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/ClientListResult"}},"required":["success","result"]},"ClientUpdateResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Client updated successfully"},"client_id":{"type":"string","description":"Unique identifier of the updated client","example":"client_abc123"},"website_limit":{"type":"number","description":"Updated website limit","example":5},"suspended":{"type":"boolean","description":"Updated suspension status","example":false},"full_name":{"type":"string","description":"Updated full name","example":"John Doe"}},"required":["message","client_id"]},"ClientUpdateResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/ClientUpdateResult"}},"required":["success","result"]},"ClientUpdateRequest":{"type":"object","properties":{"client_id":{"type":"string","description":"Unique identifier of the client to update","example":"client_abc123"},"website_limit":{"type":"number","description":"Maximum websites allowed for this client","example":5},"suspended":{"type":"boolean","description":"Whether the client is suspended","example":false},"full_name":{"type":"string","description":"Client full name","example":"John Doe"}},"required":["client_id"]},"ClientDeleteResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Client deleted successfully"},"client_id":{"type":"string","description":"Unique identifier of the deleted client","example":"client_abc123"},"revoked":{"type":"boolean","description":"Whether the client access was revoked","example":true}},"required":["message","client_id","revoked"]},"ClientDeleteResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/ClientDeleteResult"}},"required":["success","result"]},"ClientDeleteRequest":{"type":"object","properties":{"client_id":{"type":"string","description":"Unique identifier of the client to delete","example":"client_abc123"}},"required":["client_id"]},"MagicLinkCreateResult":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Email address the magic link was sent to","example":"user@example.com"},"magic_link":{"type":"string","format":"uri","description":"The generated magic link URL for authentication","example":"https://example.com/callback?callback_type=magic-link&login_id=abc123&code=123456"},"expires_in":{"type":"string","description":"Time until the magic link expires","example":"5 minutes"},"created_date":{"type":"string","description":"Date when the magic link was created","example":"2024-01-15T10:30:00Z"}},"required":["email","magic_link","expires_in","created_date"]},"MagicLinkCreateResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/MagicLinkCreateResult"}},"required":["success","result"]},"MagicLinkCreateRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Email address to send magic link to","example":"user@example.com"}},"required":["email"]},"WebsiteListItem":{"type":"object","properties":{"website_id":{"type":"string","description":"Unique identifier of the website","example":"website_abc123"},"website_name":{"type":"string","description":"Name of the website","example":"My Business Website"},"domain":{"type":"string","description":"Domain URL of the website","example":"https://example.com"},"activated":{"type":"boolean","description":"Whether the website is activated","example":true},"created_date":{"type":"string","description":"Date when the website was created","example":"2024-01-15T10:30:00Z"},"language":{"type":["string","null"],"description":"Language code of the website (e.g., 'en', 'es')","example":"en"}},"required":["website_id","website_name","domain","activated","created_date","language"]},"WebsiteListResult":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/WebsiteListItem"},"description":"Array of website items"},"total":{"type":"number","description":"Total number of websites","example":10}},"required":["list","total"]},"WebsiteListResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WebsiteListResult"}},"required":["success","result"]},"WebsitePatchResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Website updated successfully"},"website_id":{"type":"string","description":"Unique identifier of the updated website","example":"website_abc123"},"business_name":{"type":["string","null"],"description":"Updated business name","example":"My Business"},"business_description":{"type":["string","null"],"description":"Updated business description","example":"A great business providing excellent services"},"custom_code_header":{"type":["string","null"],"description":"Updated custom header code","example":"<script>console.log('header');</script>"},"custom_code_footer":{"type":["string","null"],"description":"Updated custom footer code","example":"<script>console.log('footer');</script>"},"robots":{"type":["string","null"],"description":"Updated robots.txt content","example":"User-agent: *\nAllow: /"},"language":{"type":["string","null"],"description":"Updated language code","example":"en"},"activated":{"type":"boolean","description":"Updated activation status","example":true}},"required":["message","website_id"]},"WebsitePatchResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WebsitePatchResult"}},"required":["success","result"]},"WebsitePatchRequest":{"type":"object","properties":{"website_id":{"type":"string","description":"Unique identifier of the website to update","example":"website_abc123"},"business_name":{"type":["string","null"],"description":"Business name for the website. Set to null to clear.","example":"My Business"},"business_description":{"type":["string","null"],"description":"Business description for the website. Set to null to clear.","example":"A great business providing excellent services"},"custom_code_header":{"type":["string","null"],"description":"Custom code to inject in the header. Set to null to clear.","example":"<script>console.log('header');</script>"},"custom_code_footer":{"type":["string","null"],"description":"Custom code to inject in the footer. Set to null to clear.","example":"<script>console.log('footer');</script>"},"robots":{"type":["string","null"],"description":"Robots.txt content for the website. Set to null to clear.","example":"User-agent: *\nAllow: /"},"language":{"type":["string","null"],"description":"Language code for the website (e.g., 'en', 'es'). Set to null to clear.","example":"en"},"activated":{"type":"boolean","description":"Whether the website is activated","example":true}},"required":["website_id"]},"WebsiteDeleteResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Website deleted successfully"},"website_id":{"type":"string","description":"Unique identifier of the deleted website","example":"website_abc123"},"deleted":{"type":"boolean","description":"Whether the website was deleted","example":true}},"required":["message","website_id","deleted"]},"WebsiteDeleteResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WebsiteDeleteResult"}},"required":["success","result"]},"WebsiteDeleteRequest":{"type":"object","properties":{"website_id":{"type":"string","description":"Unique identifier of the website to delete","example":"website_abc123"}},"required":["website_id"]},"WebsiteAssignResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Website assigned to client successfully"},"website_id":{"type":"string","description":"Unique identifier of the assigned website","example":"website_abc123"},"client_id":{"type":"string","description":"Unique identifier of the client","example":"client_abc123"}},"required":["message","website_id","client_id"]},"WebsiteAssignResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WebsiteAssignResult"}},"required":["success","result"]},"WebsiteAssignRequest":{"type":"object","properties":{"website_id":{"type":"string","description":"Unique identifier of the website to assign","example":"website_abc123"},"client_id":{"type":"string","description":"Unique identifier of the client to assign the website to","example":"client_abc123"}},"required":["website_id","client_id"]},"IntegrationSummary":{"type":"object","properties":{"name":{"type":"string","description":"Name of the integration","example":"stripe"},"ready":{"type":"boolean","description":"Whether the integration is ready/configured","example":false},"value":{"type":"string","description":"Integration value (e.g., account ID)","example":"acct_1SwQ4AIJUp1O1efL"}},"required":["name","ready","value"]},"WebsiteDetailsResult":{"type":"object","properties":{"website_id":{"type":"string","description":"Unique identifier of the website","example":"website_abc123"},"business_name":{"type":"string","description":"Business name for the website","example":"My Business"},"business_description":{"type":"string","description":"Business description","example":"A great business providing excellent services"},"preview_url":{"type":"string","description":"Preview URL of the website","example":"https://preview.example.com"},"custom_domain":{"type":["string","null"],"description":"Custom domain configured for the website","example":"www.mybusiness.com"},"verified_domain":{"type":["string","null"],"description":"Verified domain for the website","example":"www.mybusiness.com"},"language":{"type":"string","description":"Language of the website","example":"en"},"activated":{"type":"boolean","description":"Whether the website is activated","example":true},"theme":{"type":"object","additionalProperties":{},"description":"Theme configuration for the website including font and title_font","example":{"primaryColor":"#007bff","font":"Inter","title_font":"Poppins"}},"theme_md":{"type":["string","null"],"description":"Markdown description of the website's design style, tone, and visual guidelines","example":"Modern minimalist design with sky blue accents. Clean typography, generous whitespace."},"integrations":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationSummary"},"description":"Integrations configured for the website in format [{name, ready, value}]","example":[{"name":"matomo","ready":true,"value":"123"}]},"socials":{"type":"object","additionalProperties":{},"description":"Social media links for the website","example":{"twitter":"https://twitter.com/mybusiness"}},"fonts":{"type":"object","additionalProperties":{},"description":"Font configuration for the website","example":{"heading":"Roboto","body":"Open Sans"}},"created_date":{"type":"string","description":"Date when the website was created","example":"2024-01-15T10:30:00Z"},"global_header":{"type":["string","null"],"description":"Global header HTML shared across all pages","example":"<nav>Header content</nav>"},"global_footer":{"type":["string","null"],"description":"Global footer HTML shared across all pages","example":"<footer>Footer content</footer>"},"custom_codes":{"type":"object","properties":{"header":{"type":["string","null"],"description":"Custom code to inject in the header","example":"<style>/* custom styles */</style>"},"footer":{"type":["string","null"],"description":"Custom code to inject in the footer","example":"<script>/* custom scripts */</script>"}},"required":["header","footer"],"description":"Custom code snippets for header and footer injection"}},"required":["website_id","business_name","business_description","preview_url","custom_domain","verified_domain","language","activated","theme","theme_md","integrations","socials","fonts","created_date","global_header","global_footer","custom_codes"]},"WebsiteDetailsResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WebsiteDetailsResult"}},"required":["success","result"]},"WebsiteSettingsUpdateResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Website settings updated successfully"},"website_id":{"type":"string","description":"Unique identifier of the updated website","example":"website_abc123"},"business_name":{"type":"string","description":"Updated business name","example":"My Business"},"business_description":{"type":"string","description":"Updated business description","example":"A great business providing excellent services"},"language":{"type":"string","description":"Updated language","example":"en"},"theme":{"type":"object","additionalProperties":{},"description":"Updated theme configuration","example":{"primaryColor":"#007bff"}},"robots":{"type":"string","description":"Updated robots.txt content","example":"User-agent: *\nAllow: /"},"custom_code_header":{"type":"string","description":"Updated custom header code","example":"<script>console.log('header');</script>"},"custom_code_footer":{"type":"string","description":"Updated custom footer code","example":"<script>console.log('footer');</script>"},"socials":{"type":"object","additionalProperties":{},"description":"Updated social media links","example":{"twitter":"https://twitter.com/mybusiness"}},"fonts":{"type":"object","additionalProperties":{},"description":"Updated font configuration","example":{"heading":"Roboto","body":"Open Sans"}}},"required":["message","website_id"]},"WebsiteSettingsUpdateResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WebsiteSettingsUpdateResult"}},"required":["success","result"]},"WebsiteSettingsUpdateRequest":{"type":"object","properties":{"business_name":{"type":"string","description":"Business name for the website","example":"My Business"},"business_description":{"type":"string","description":"Business description","example":"A great business providing excellent services"},"language":{"type":"string","description":"Language of the website","example":"en"},"theme":{"type":"object","additionalProperties":{},"description":"Theme configuration for the website","example":{"primaryColor":"#007bff"}},"robots":{"type":"string","description":"Robots.txt content for the website","example":"User-agent: *\nAllow: /"},"custom_code_header":{"type":"string","description":"Custom code to inject in the header","example":"<script>console.log('header');</script>"},"custom_code_footer":{"type":"string","description":"Custom code to inject in the footer","example":"<script>console.log('footer');</script>"},"socials":{"type":"object","additionalProperties":{},"description":"Social media links for the website","example":{"twitter":"https://twitter.com/mybusiness"}},"fonts":{"type":"object","additionalProperties":{},"description":"Font configuration for the website","example":{"heading":"Roboto","body":"Open Sans"}}}},"DNSRecord":{"type":"object","properties":{"record_type":{"type":"string","enum":["CNAME","TXT","A"],"description":"Type of DNS record","example":"CNAME"},"host":{"type":"string","description":"Host/name for the DNS record","example":"www"},"value":{"type":"string","description":"Value for the DNS record","example":"proxy.example.com"},"purpose":{"type":"string","description":"Purpose of this DNS record","example":"Points your domain to our servers"},"ttl":{"type":"number","description":"Time to live in seconds","example":3600}},"required":["record_type","host","value","purpose","ttl"]},"WebsiteDomainAddResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Custom domain setup initiated"},"domain":{"type":"string","description":"The domain being configured","example":"www.mybusiness.com"},"dns_records":{"type":"array","items":{"$ref":"#/components/schemas/DNSRecord"},"description":"DNS records that need to be configured"},"instructions":{"type":"string","description":"Human-readable instructions for DNS setup","example":"Add the following DNS records to your domain registrar to complete the setup."}},"required":["message","domain","dns_records","instructions"]},"WebsiteDomainAddResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WebsiteDomainAddResult"}},"required":["success","result"]},"WebsiteDomainAddRequest":{"type":"object","properties":{"domain":{"type":"string","description":"Custom domain to add to the website","example":"www.mybusiness.com"}},"required":["domain"]},"WebsiteDomainRemoveResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Custom domain removed successfully"},"website_id":{"type":"string","description":"Unique identifier of the website","example":"website_abc123"}},"required":["message","website_id"]},"WebsiteDomainRemoveResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WebsiteDomainRemoveResult"}},"required":["success","result"]},"WebsiteTeamMemberAddResult":{"type":"object","properties":{"member_id":{"type":"string","description":"Unique identifier of the team member","example":"member_abc123"},"email":{"type":"string","description":"Email address of the team member","example":"team@example.com"},"role":{"type":"string","description":"Role assigned to the team member","example":"Editor"},"created_date":{"type":"string","description":"Date when the team member was added","example":"2024-01-15T10:30:00Z"}},"required":["member_id","email","role","created_date"]},"WebsiteTeamMemberAddResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WebsiteTeamMemberAddResult"}},"required":["success","result"]},"WebsiteTeamMemberAddRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Email address of the team member to add","example":"team@example.com"},"role":{"type":"string","enum":["Editor","Commenter"],"description":"Role for the team member","example":"Editor"}},"required":["email","role"]},"WebsiteTeamMemberRemoveResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Team member removed successfully"},"member_id":{"type":"string","description":"Unique identifier of the removed team member","example":"member_abc123"}},"required":["message","member_id"]},"WebsiteTeamMemberRemoveResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WebsiteTeamMemberRemoveResult"}},"required":["success","result"]},"TeamMember":{"type":"object","properties":{"member_id":{"type":"string","description":"Unique identifier of the team member","example":"member_abc123"},"email":{"type":"string","format":"email","description":"Email address of the team member","example":"team@example.com"},"role":{"type":"string","enum":["Editor","Commenter","Team"],"description":"Role assigned to the team member","example":"Editor"},"created_date":{"type":"string","description":"Date when the team member was added","example":"2024-01-15T10:30:00Z"}},"required":["member_id","email","role","created_date"]},"TeamListResult":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/TeamMember"},"description":"Array of team members"},"total":{"type":"number","description":"Total number of team members","example":5}},"required":["list","total"]},"TeamListResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/TeamListResult"}},"required":["success","result"]},"TrafficDataPoint":{"type":"object","properties":{"timestamp":{"type":"string","description":"Timestamp for the data point","example":"2024-01-15T10:00:00Z"},"requests":{"type":"number","description":"Number of requests","example":1500},"visitors":{"type":"number","description":"Number of unique visitors","example":250},"avg_response_time":{"type":"number","description":"Average response time in milliseconds","example":150}},"required":["timestamp","requests","visitors","avg_response_time"]},"WebsiteTrafficDataPoint":{"allOf":[{"$ref":"#/components/schemas/TrafficDataPoint"},{"type":"object","properties":{"errors":{"type":"number","description":"Number of errors","example":5}},"required":["errors"]}]},"PageMetric":{"type":"object","properties":{"path":{"type":"string","description":"Page path","example":"/about"},"requests":{"type":"number","description":"Number of requests","example":500},"visitors":{"type":"number","description":"Number of unique visitors","example":100},"avg_response_time":{"type":"number","description":"Average response time in milliseconds","example":120}},"required":["path","requests","visitors","avg_response_time"]},"CountryMetric":{"type":"object","properties":{"country":{"type":"string","description":"Country code or name","example":"US"},"requests":{"type":"number","description":"Number of requests","example":800},"visitors":{"type":"number","description":"Number of unique visitors","example":150}},"required":["country","requests","visitors"]},"BrowserMetric":{"type":"object","properties":{"browser":{"type":"string","description":"Browser name","example":"Chrome"},"count":{"type":"number","description":"Number of requests","example":600},"visitors":{"type":"number","description":"Number of unique visitors","example":120}},"required":["browser","count","visitors"]},"DeviceMetric":{"type":"object","properties":{"device":{"type":"string","description":"Device type","example":"Desktop"},"count":{"type":"number","description":"Number of requests","example":700},"visitors":{"type":"number","description":"Number of unique visitors","example":140}},"required":["device","count","visitors"]},"OSMetric":{"type":"object","properties":{"os":{"type":"string","description":"Operating system name","example":"Windows"},"count":{"type":"number","description":"Number of requests","example":500},"visitors":{"type":"number","description":"Number of unique visitors","example":100}},"required":["os","count","visitors"]},"RefererMetric":{"type":"object","properties":{"domain":{"type":"string","description":"Referer domain","example":"google.com"},"count":{"type":"number","description":"Number of requests","example":300},"visitors":{"type":"number","description":"Number of unique visitors","example":80}},"required":["domain","count","visitors"]},"CampaignMetric":{"type":"object","properties":{"campaign":{"type":"string","description":"Campaign name","example":"summer_sale"},"count":{"type":"number","description":"Number of requests","example":200},"visitors":{"type":"number","description":"Number of unique visitors","example":50}},"required":["campaign","count","visitors"]},"WebsiteAnalyticsData":{"type":"object","properties":{"total_requests":{"type":"number","description":"Total number of requests","example":5000},"total_visitors":{"type":"number","description":"Total number of unique visitors","example":1200},"avg_response_time":{"type":"number","description":"Average response time in milliseconds","example":120},"total_pages":{"type":"number","description":"Total number of pages","example":15},"total_blogs":{"type":"number","description":"Total number of blogs","example":8},"traffic_over_time":{"type":"array","items":{"$ref":"#/components/schemas/WebsiteTrafficDataPoint"},"description":"Traffic data over time"},"top_pages":{"type":"array","items":{"$ref":"#/components/schemas/PageMetric"},"description":"Top pages by traffic"},"top_countries":{"type":"array","items":{"$ref":"#/components/schemas/CountryMetric"},"description":"Top countries by traffic"},"top_browsers":{"type":"array","items":{"$ref":"#/components/schemas/BrowserMetric"},"description":"Top browsers by usage"},"top_devices":{"type":"array","items":{"$ref":"#/components/schemas/DeviceMetric"},"description":"Top devices by usage"},"top_os":{"type":"array","items":{"$ref":"#/components/schemas/OSMetric"},"description":"Top operating systems by usage"},"top_referers":{"type":"array","items":{"$ref":"#/components/schemas/RefererMetric"},"description":"Top referer domains"},"top_campaigns":{"type":"array","items":{"$ref":"#/components/schemas/CampaignMetric"},"description":"Top UTM campaigns"}},"required":["total_requests","total_visitors","avg_response_time","total_pages","total_blogs","traffic_over_time","top_pages","top_countries","top_browsers","top_devices","top_os","top_referers","top_campaigns"]},"WebsiteAnalyticsResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WebsiteAnalyticsData"}},"required":["success","result"]},"AiBotMetric":{"type":"object","properties":{"bot":{"type":"string","description":"Canonical AI bot name","example":"gptbot"},"purpose":{"type":"string","enum":["live_user","search_index","crawler"],"description":"Why the bot fetched the page. 'live_user' = live answer-time fetch for a human prompt (best citation signal). 'search_index' = AI answer-time retrieval index crawl. 'crawler' = bulk training ingest.","example":"crawler"},"requests":{"type":"number","description":"Number of requests from this bot","example":412},"visitors":{"type":"number","description":"Distinct visitor IPs (proxy for unique sessions)","example":38}},"required":["bot","purpose","requests","visitors"]},"AiReferrerMetric":{"type":"object","properties":{"platform":{"type":"string","description":"Canonical AI platform bucket (chatgpt, perplexity, claude, ...)","example":"chatgpt"},"requests":{"type":"number","description":"Number of requests from this platform","example":87},"visitors":{"type":"number","description":"Distinct visitor IPs","example":62}},"required":["platform","requests","visitors"]},"AiCitedPageMetric":{"type":"object","properties":{"path":{"type":"string","description":"URL path","example":"/pricing"},"ai_crawls":{"type":"number","description":"Number of requests from AI bots","example":124},"ai_referrals":{"type":"number","description":"Number of requests from AI platform referrers","example":19}},"required":["path","ai_crawls","ai_referrals"]},"AiTrafficDataPoint":{"type":"object","properties":{"timestamp":{"type":"string","description":"Bucket start (hourly or daily depending on range)","example":"2025-05-11T00:00:00Z"},"ai_crawls":{"type":"number","description":"AI bot requests in this bucket","example":18},"ai_referrals":{"type":"number","description":"AI referral requests in this bucket","example":5}},"required":["timestamp","ai_crawls","ai_referrals"]},"WebsiteAiVisibilityData":{"type":"object","properties":{"total_ai_crawls":{"type":"number","description":"Total number of requests from AI bots in the range","example":412},"total_ai_referrals":{"type":"number","description":"Total number of requests from AI platform referrers","example":87},"unique_ai_visitors":{"type":"number","description":"Distinct visitor IPs arriving from AI platforms","example":62},"citation_to_click_ratio":{"type":"number","description":"referrals / crawls. Rough signal for how effectively AI citations turn into visits. 0 if no crawls in range.","example":0.211},"top_ai_bots":{"type":"array","items":{"$ref":"#/components/schemas/AiBotMetric"},"description":"Top AI bots by request count"},"top_ai_referrers":{"type":"array","items":{"$ref":"#/components/schemas/AiReferrerMetric"},"description":"Top AI platforms by referral count"},"top_cited_pages":{"type":"array","items":{"$ref":"#/components/schemas/AiCitedPageMetric"},"description":"Pages that draw the most AI attention (crawls + referrals)"},"ai_traffic_over_time":{"type":"array","items":{"$ref":"#/components/schemas/AiTrafficDataPoint"},"description":"Daily or hourly time series of crawls and referrals"}},"required":["total_ai_crawls","total_ai_referrals","unique_ai_visitors","citation_to_click_ratio","top_ai_bots","top_ai_referrers","top_cited_pages","ai_traffic_over_time"]},"WebsiteAiVisibilityResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WebsiteAiVisibilityData"}},"required":["success","result"]},"PageListItem":{"type":"object","properties":{"page_id":{"type":"string","description":"Unique identifier of the page","example":"page_abc123"},"name":{"type":"string","description":"Name of the page","example":"Home Page"},"path":{"type":"string","description":"URL path of the page","example":"/home"},"status":{"type":"string","enum":["Active","Archive","Building"],"description":"Current status of the page","example":"Active"},"language":{"type":["string","null"],"description":"Language code of the page (e.g., 'en', 'es')","example":"en"},"publish_date":{"type":["number","null"],"description":"Unix timestamp when the page was published, null if unpublished","example":1705312200},"created_date":{"type":"string","description":"Date when the page was created","example":"2024-01-15T10:30:00Z"}},"required":["page_id","name","path","status","language","publish_date","created_date"]},"PageListResult":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/PageListItem"},"description":"Array of page items"},"total":{"type":"number","description":"Total number of pages","example":25}},"required":["list","total"]},"PageListResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/PageListResult"}},"required":["success","result"]},"PageSeo":{"type":"object","properties":{"title":{"type":"string","description":"SEO title for the page","example":"Welcome to Our Website"},"description":{"type":"string","description":"SEO meta description for the page","example":"Discover our amazing products and services"},"keywords":{"type":"string","description":"SEO keywords for the page","example":"products, services, business"}}},"PageDetailsResult":{"type":"object","properties":{"page_id":{"type":"string","description":"Unique identifier of the page","example":"page_abc123"},"name":{"type":"string","description":"Name of the page","example":"Home Page"},"path":{"type":"string","description":"URL path of the page","example":"/home"},"status":{"type":"string","description":"Current status of the page","example":"Active"},"language":{"type":["string","null"],"description":"Language code of the page (e.g., 'en', 'es')","example":"en"},"seo":{"$ref":"#/components/schemas/PageSeo"},"settings":{"type":"object","additionalProperties":{},"description":"Page settings configuration","example":{"layout":"full-width"}},"data":{"type":"object","additionalProperties":{},"description":"Page data and content","example":{"sections":[]}},"publish_date":{"type":["number","null"],"description":"Unix timestamp when the page was published, null if unpublished","example":1705312200},"created_date":{"type":"string","description":"Date when the page was created","example":"2024-01-15T10:30:00Z"}},"required":["page_id","name","path","status","language","seo","settings","data","publish_date","created_date"]},"PageDetailsResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/PageDetailsResult"}},"required":["success","result"]},"PageCreateResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Page created and published successfully"},"page_id":{"type":"string","description":"Unique identifier of the created page","example":"page_abc123"},"publish_date":{"type":"number","description":"Unix timestamp when the page was published","example":1705312200},"published_url":{"type":"string","description":"Full URL where the page is published","example":"https://example.com/about-us"}},"required":["message","page_id","publish_date","published_url"]},"PageCreateResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/PageCreateResult"}},"required":["success","result"]},"PageCreateRequest":{"type":"object","properties":{"html":{"type":"string","description":"Full HTML content of the page","example":"<main><section>...</section></main>"},"path":{"type":"string","description":"URL path for the page","example":"/about-us"},"settings":{"type":"object","additionalProperties":{},"description":"Page settings","example":{"theme":{"mode":"dark"}}},"template_name":{"type":"string","description":"Page title/name","example":"About Us"},"custom_codes":{"type":"object","properties":{"header":{"type":"string"},"footer":{"type":"string"}},"description":"Custom code to inject in header and footer","example":{"header":"<script>...</script>","footer":"<script>...</script>"}},"seo":{"type":"object","additionalProperties":{},"description":"SEO metadata for the page","example":{"page_title":"About Us","meta_description":"Learn about our company"}}},"required":["html","path"]},"PagePublishResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Page published successfully"},"page_id":{"type":"string","description":"Unique identifier of the published page","example":"page_abc123"},"publish_date":{"type":"number","description":"Unix timestamp when the page was published","example":1705312200},"published_url":{"type":"string","description":"Full URL where the page is published","example":"https://example.com/about-us"}},"required":["message","page_id","publish_date","published_url"]},"PagePublishResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/PagePublishResult"}},"required":["success","result"]},"PagePublishRequest":{"type":"object","properties":{"html":{"type":"string","description":"Full HTML content of the page","example":"<main><section>...</section></main>"},"path":{"type":"string","description":"URL path for the page","example":"/about-us"},"settings":{"type":"object","additionalProperties":{},"description":"Page settings to merge with existing settings","example":{"theme":{"mode":"dark"}}},"template_name":{"type":"string","description":"Page title/name","example":"About Us"},"custom_codes":{"type":"object","properties":{"header":{"type":"string"},"footer":{"type":"string"}},"description":"Custom code to inject in header and footer","example":{"header":"<script>...</script>","footer":"<script>...</script>"}},"seo":{"type":"object","additionalProperties":{},"description":"SEO metadata for the page","example":{"page_title":"About Us","meta_description":"Learn about our company"}}},"required":["html","path"]},"PageUnpublishResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Page unpublished successfully"},"page_id":{"type":"string","description":"Unique identifier of the unpublished page","example":"page_abc123"},"warnings":{"type":"array","items":{"type":"string"},"description":"Warnings for partial failures (e.g., R2 file removal or cache purge failures)","example":["R2 file removal failed: File not found"]}},"required":["message","page_id"]},"PageUnpublishResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/PageUnpublishResult"}},"required":["success","result"]},"PageUpdateResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Page updated successfully"},"page_id":{"type":"string","description":"Unique identifier of the updated page","example":"page_abc123"},"name":{"type":"string","description":"Updated name of the page","example":"Home Page"},"path":{"type":"string","description":"Updated URL path of the page","example":"/home"},"language":{"type":["string","null"],"description":"Language code of the page","example":"en"}},"required":["message","page_id"]},"PageUpdateResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/PageUpdateResult"}},"required":["success","result"]},"PageUpdateRequest":{"type":"object","properties":{"name":{"type":["string","null"],"description":"Name of the page","example":"Home Page"},"path":{"type":["string","null"],"description":"URL path of the page","example":"/home"},"seo":{"type":["object","null"],"additionalProperties":{},"description":"SEO metadata for the page","example":{"title":"Welcome","description":"Our home page"}},"settings":{"type":["object","null"],"additionalProperties":{},"description":"Page settings configuration","example":{"layout":"full-width"}},"data":{"type":["object","null"],"additionalProperties":{},"description":"Page data and content","example":{"sections":[]}},"language":{"type":["string","null"],"description":"Language code (e.g., 'en', 'es', 'fr'). Converted to display format for storage.","example":"en"}}},"PageDeleteResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Page deleted successfully"},"page_id":{"type":"string","description":"Unique identifier of the deleted page","example":"page_abc123"},"warnings":{"type":"array","items":{"type":"string"},"description":"Warnings for partial failures (e.g., R2 file removal or cache purge failures)","example":["R2 file removal failed: File not found"]}},"required":["message","page_id"]},"PageDeleteResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/PageDeleteResult"}},"required":["success","result"]},"BlogListItem":{"type":"object","properties":{"blog_id":{"type":"string","description":"Unique identifier of the blog","example":"blog_abc123"},"name":{"type":"string","description":"Name of the blog post","example":"Getting Started Guide"},"path":{"type":"string","description":"URL path of the blog post","example":"/blog/getting-started"},"status":{"type":"string","enum":["Active","Archive","Building"],"description":"Current status of the blog","example":"Active"},"language":{"type":["string","null"],"description":"Language code of the blog (e.g., 'en', 'es')","example":"en"},"publish_date":{"type":["number","null"],"description":"Unix timestamp when the blog was published, null if unpublished","example":1705312200},"blog_settings":{"type":"object","additionalProperties":{},"description":"Blog-specific settings configuration","example":{"featured":true,"category":"tutorials"}},"created_date":{"type":"string","description":"Date when the blog was created","example":"2024-01-15T10:30:00Z"}},"required":["blog_id","name","path","status","language","publish_date","blog_settings","created_date"]},"BlogListResult":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/BlogListItem"},"description":"Array of blog items"},"total":{"type":"number","description":"Total number of blogs","example":15}},"required":["list","total"]},"BlogListResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/BlogListResult"}},"required":["success","result"]},"BlogDetailsResult":{"type":"object","properties":{"blog_id":{"type":"string","description":"Unique identifier of the blog","example":"blog_abc123"},"name":{"type":"string","description":"Name of the blog post","example":"Getting Started Guide"},"path":{"type":"string","description":"URL path of the blog post","example":"/blog/getting-started"},"status":{"type":"string","description":"Current status of the blog","example":"Active"},"language":{"type":["string","null"],"description":"Language code of the blog (e.g., 'en', 'es')","example":"en"},"seo":{"type":"object","additionalProperties":{},"description":"SEO metadata for the blog post","example":{"title":"Getting Started","description":"Learn how to get started"}},"blog_settings":{"type":"object","additionalProperties":{},"description":"Blog-specific settings configuration","example":{"featured":true,"category":"tutorials"}},"data":{"type":"object","additionalProperties":{},"description":"Blog data and content","example":{"content":[],"author":"John Doe"}},"publish_date":{"type":["number","null"],"description":"Unix timestamp when the blog was published, null if unpublished","example":1705312200},"created_date":{"type":"string","description":"Date when the blog was created","example":"2024-01-15T10:30:00Z"}},"required":["blog_id","name","path","status","language","seo","blog_settings","data","publish_date","created_date"]},"BlogDetailsResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/BlogDetailsResult"}},"required":["success","result"]},"BlogCreateResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Blog created and published successfully"},"blog_id":{"type":"string","description":"Unique identifier of the created blog","example":"blog_abc123"},"publish_date":{"type":"number","description":"Unix timestamp when the blog was published","example":1705312200},"published_url":{"type":"string","description":"Full URL where the blog is published","example":"https://example.com/blog/my-first-post"}},"required":["message","blog_id","publish_date","published_url"]},"BlogCreateResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/BlogCreateResult"}},"required":["success","result"]},"BlogCreateRequest":{"type":"object","properties":{"path":{"type":"string","description":"URL path for the blog post","example":"/blog/my-first-post"},"blog_content":{"type":"string","description":"Blog markdown content","example":"# My Blog Post\n\nContent here..."},"seo":{"type":"object","properties":{"page_title":{"type":"string","description":"Page title for the blog","example":"My First Blog Post"},"meta_description":{"type":"string","description":"Meta description for SEO","example":"A brief description of the blog post"},"social_title":{"type":"string","description":"Social media title","example":"My First Blog Post"},"social_description":{"type":"string","description":"Social media description","example":"A brief description for social sharing"},"social_image":{"type":"string","description":"Social media image URL","example":"https://example.com/image.jpg"}},"required":["page_title"],"description":"SEO metadata for the blog post"},"blog_settings":{"type":"object","properties":{"author":{"type":"string","description":"Author name","example":"John Doe"},"excerpt":{"type":"string","description":"Blog excerpt/summary","example":"A brief summary of the blog post"},"category":{"type":"string","description":"Blog category","example":"Technology"},"publish_date":{"type":"string","description":"Publish date string","example":"January 15, 2025"},"read_time":{"type":"string","description":"Estimated read time","example":"5 min read"},"author_image":{"type":"string","description":"Author avatar image URL","example":"https://example.com/author.jpg"}},"required":["author"],"description":"Blog-specific settings"},"settings":{"type":"object","additionalProperties":{},"description":"Additional settings","example":{"theme":{"mode":"dark"}}}},"required":["path","blog_content","seo","blog_settings"]},"BlogPublishResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Blog published successfully"},"blog_id":{"type":"string","description":"Unique identifier of the published blog","example":"blog_abc123"},"publish_date":{"type":"number","description":"Unix timestamp when the blog was published","example":1705312200},"published_url":{"type":"string","description":"Full URL where the blog is published","example":"https://example.com/blog/my-first-post"}},"required":["message","blog_id","publish_date","published_url"]},"BlogPublishResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/BlogPublishResult"}},"required":["success","result"]},"BlogPublishRequest":{"type":"object","properties":{"path":{"type":"string","description":"URL path for the blog post","example":"/blog/my-first-post"},"blog_content":{"type":"string","description":"Blog markdown content","example":"# My Blog Post\n\nContent here..."},"seo":{"type":"object","properties":{"page_title":{"type":"string","description":"Page title for the blog","example":"My First Blog Post"},"meta_description":{"type":"string","description":"Meta description for SEO","example":"A brief description of the blog post"},"social_title":{"type":"string","description":"Social media title","example":"My First Blog Post"},"social_description":{"type":"string","description":"Social media description","example":"A brief description for social sharing"},"social_image":{"type":"string","description":"Social media image URL","example":"https://example.com/image.jpg"}},"required":["page_title","social_image"],"description":"SEO metadata for the blog post"},"blog_settings":{"type":"object","properties":{"author":{"type":"string","description":"Author name","example":"John Doe"},"excerpt":{"type":"string","description":"Blog excerpt/summary","example":"A brief summary of the blog post"},"category":{"type":"string","description":"Blog category","example":"Technology"},"publish_date":{"type":"string","description":"Publish date string","example":"January 15, 2025"},"read_time":{"type":"string","description":"Estimated read time","example":"5 min read"}},"required":["author"],"description":"Blog-specific settings"},"settings":{"type":"object","additionalProperties":{},"description":"Additional settings to merge with existing settings","example":{"theme":{"mode":"dark"}}}},"required":["path","blog_content","seo","blog_settings"]},"BlogUnpublishResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Blog unpublished successfully"},"blog_id":{"type":"string","description":"Unique identifier of the unpublished blog","example":"blog_abc123"}},"required":["message","blog_id"]},"BlogUnpublishResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/BlogUnpublishResult"}},"required":["success","result"]},"BlogUpdateResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Blog updated successfully"},"blog_id":{"type":"string","description":"Unique identifier of the updated blog","example":"blog_abc123"},"name":{"type":"string","description":"Updated name of the blog post","example":"Getting Started Guide"},"path":{"type":"string","description":"Updated URL path of the blog post","example":"/blog/getting-started"},"language":{"type":["string","null"],"description":"Language code of the blog","example":"en"}},"required":["message","blog_id"]},"BlogUpdateResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/BlogUpdateResult"}},"required":["success","result"]},"BlogUpdateRequest":{"type":"object","properties":{"name":{"type":["string","null"],"description":"Name of the blog post","example":"Getting Started Guide"},"path":{"type":["string","null"],"description":"URL path of the blog post","example":"/blog/getting-started"},"seo":{"type":["object","null"],"additionalProperties":{},"description":"SEO metadata for the blog post","example":{"title":"Getting Started","description":"Learn how to get started"}},"blog_settings":{"type":["object","null"],"additionalProperties":{},"description":"Blog-specific settings configuration","example":{"featured":true,"category":"tutorials"}},"data":{"type":["object","null"],"additionalProperties":{},"description":"Blog data and content","example":{"content":[],"author":"John Doe"}},"language":{"type":["string","null"],"description":"Language code (e.g., 'en', 'es', 'fr'). Converted to display format for storage.","example":"en"}}},"BlogDeleteResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Blog deleted successfully"},"blog_id":{"type":"string","description":"Unique identifier of the deleted blog","example":"blog_abc123"},"warnings":{"type":"array","items":{"type":"string"},"description":"Warnings for partial failures (e.g., R2 file removal or cache purge failures)","example":["R2 file removal failed: File not found"]}},"required":["message","blog_id"]},"BlogDeleteResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/BlogDeleteResult"}},"required":["success","result"]},"MediaUploadResult":{"type":"object","properties":{"url":{"type":"string","description":"CDN URL of the uploaded file","example":"https://cdn.ln-cdn.com/c/website_abc123/images/hero-image.jpg"},"file_name":{"type":"string","description":"Name of the uploaded file","example":"hero-image.jpg"},"media_type":{"type":"string","description":"Type of media uploaded","example":"images"}},"required":["url","file_name","media_type"]},"MediaUploadResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/MediaUploadResult"}},"required":["success","result"]},"MediaUploadRequest":{"type":"object","properties":{"file_base64":{"type":"string","description":"Base64 encoded file data (with or without data URL prefix)","example":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="},"file_name":{"type":"string","description":"Name of the file including extension","example":"hero-image.jpg"},"media_type":{"type":"string","enum":["images","videos","documents","fonts"],"default":"images","description":"Type of media being uploaded","example":"images"},"content_type":{"type":"string","description":"MIME type of the file","example":"image/jpeg"}},"required":["file_base64","file_name"]},"MediaBatchUploadResultItem":{"type":"object","properties":{"url":{"type":"string","description":"CDN URL of the uploaded file","example":"https://cdn.ln-cdn.com/c/website_abc123/images/hero-image.jpg"},"file_name":{"type":"string","description":"Original file name","example":"hero-image.jpg"},"media_type":{"type":"string","description":"Type of media uploaded","example":"images"},"success":{"type":"boolean","description":"Whether this file was uploaded successfully","example":true},"error":{"type":"string","description":"Error message if upload failed","example":"File too large"}},"required":["url","file_name","media_type","success"]},"MediaBatchUploadResult":{"type":"object","properties":{"uploaded":{"type":"array","items":{"$ref":"#/components/schemas/MediaBatchUploadResultItem"},"description":"Array of upload results for each file"},"total":{"type":"number","description":"Total number of files processed","example":5},"successful":{"type":"number","description":"Number of files successfully uploaded","example":5},"failed":{"type":"number","description":"Number of files that failed to upload","example":0}},"required":["uploaded","total","successful","failed"]},"MediaBatchUploadResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/MediaBatchUploadResult"}},"required":["success","result"]},"MediaBatchUploadRequest":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"file_base64":{"type":"string","description":"Base64 encoded file data"},"file_name":{"type":"string","description":"Name of the file including extension"},"media_type":{"type":"string","enum":["images","videos","documents","fonts"],"default":"images","description":"Type of media being uploaded"},"content_type":{"type":"string","description":"MIME type of the file"}},"required":["file_base64","file_name"]},"maxItems":20,"description":"Array of files to upload (max 20 files per request)"}},"required":["files"]},"WorkspaceDetailsResult":{"type":"object","properties":{"workspace_id":{"type":"string","description":"Unique identifier of the workspace","example":"workspace_abc123"},"workspace_name":{"type":"string","description":"Name of the workspace","example":"My Workspace"},"workspace_language":{"type":["string","null"],"description":"Default language for the workspace (lang_code format)","example":"en"},"email":{"type":"string","description":"Email associated with the workspace","example":"admin@example.com"},"plan":{"type":"string","description":"Current subscription plan","example":"pro"},"integrations":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationSummary"},"description":"Integrations configured for the workspace","example":[{"name":"stripe","ready":false,"value":"acct_1SwQ4AIJUp1O1efL"}]},"webhook_url":{"type":["string","null"],"description":"Webhook URL for workspace events","example":"https://api.mybusiness.com/webhooks"},"created_date":{"type":"string","description":"Date when the workspace was created","example":"2024-01-15T10:30:00Z"}},"required":["workspace_id","workspace_name","workspace_language","email","plan","integrations","webhook_url","created_date"]},"WorkspaceDetailsResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WorkspaceDetailsResult"}},"required":["success","result"]},"WorkspaceUpdateResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Workspace updated successfully"},"workspace_id":{"type":"string","description":"Unique identifier of the updated workspace","example":"workspace_abc123"},"workspace_name":{"type":"string","description":"Updated workspace name","example":"My Workspace"},"workspace_language":{"type":"string","description":"Updated workspace language","example":"en"},"webhook_url":{"type":["string","null"],"description":"Updated webhook URL","example":"https://api.mybusiness.com/webhooks"}},"required":["message","workspace_id"]},"WorkspaceUpdateResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WorkspaceUpdateResult"}},"required":["success","result"]},"WorkspaceUpdateRequest":{"type":"object","properties":{"workspace_name":{"type":["string","null"],"description":"Name of the workspace. Set to null to clear.","example":"My Workspace"},"workspace_language":{"type":["string","null"],"description":"Default language for the workspace (lang_code format, e.g., 'en', 'es'). Set to null to clear.","example":"en"},"webhook_url":{"type":["string","null"],"description":"Webhook URL for workspace events. Set to null to clear.","example":"https://api.mybusiness.com/webhooks"}}},"WorkspaceTeamMemberAddResult":{"type":"object","properties":{"member_id":{"type":"string","description":"Unique identifier of the team member","example":"member_abc123"},"email":{"type":"string","description":"Email address of the team member","example":"team@example.com"},"role":{"type":"string","description":"Role assigned to the team member","example":"Team"},"created_date":{"type":"string","description":"Date when the team member was added","example":"2024-01-15T10:30:00Z"}},"required":["member_id","email","role","created_date"]},"WorkspaceTeamMemberAddResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WorkspaceTeamMemberAddResult"}},"required":["success","result"]},"WorkspaceTeamMemberAddRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Email address of the team member to add","example":"team@example.com"},"role":{"type":"string","enum":["Team"],"description":"Role for the team member (workspace level)","example":"Team"}},"required":["email","role"]},"WorkspaceTeamMemberRemoveResult":{"type":"object","properties":{"message":{"type":"string","description":"Success message","example":"Team member removed successfully"},"member_id":{"type":"string","description":"Unique identifier of the removed team member","example":"member_abc123"}},"required":["message","member_id"]},"WorkspaceTeamMemberRemoveResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WorkspaceTeamMemberRemoveResult"}},"required":["success","result"]},"WebsiteMetric":{"type":"object","properties":{"website_id":{"type":"string","description":"Website identifier","example":"website_abc123"},"host":{"type":"string","description":"Website host/domain","example":"example.com"},"requests":{"type":"number","description":"Number of requests","example":1500},"visitors":{"type":"number","description":"Number of unique visitors","example":250},"avg_response_time":{"type":"number","description":"Average response time in milliseconds","example":150}},"required":["website_id","host","requests","visitors","avg_response_time"]},"WorkspaceAnalyticsData":{"type":"object","properties":{"total_requests":{"type":"number","description":"Total number of requests","example":10000},"total_visitors":{"type":"number","description":"Total number of unique visitors","example":2500},"avg_response_time":{"type":"number","description":"Average response time in milliseconds","example":150},"total_pages":{"type":"number","description":"Total number of pages","example":50},"total_blogs":{"type":"number","description":"Total number of blogs","example":25},"total_websites":{"type":"number","description":"Total number of websites","example":5},"total_clients":{"type":"number","description":"Total number of clients","example":10},"traffic_over_time":{"type":"array","items":{"$ref":"#/components/schemas/TrafficDataPoint"},"description":"Traffic data over time"},"top_websites":{"type":"array","items":{"$ref":"#/components/schemas/WebsiteMetric"},"description":"Top websites by traffic"},"top_countries":{"type":"array","items":{"$ref":"#/components/schemas/CountryMetric"},"description":"Top countries by traffic"},"top_browsers":{"type":"array","items":{"$ref":"#/components/schemas/BrowserMetric"},"description":"Top browsers by usage"},"top_devices":{"type":"array","items":{"$ref":"#/components/schemas/DeviceMetric"},"description":"Top devices by usage"},"top_os":{"type":"array","items":{"$ref":"#/components/schemas/OSMetric"},"description":"Top operating systems by usage"},"top_referers":{"type":"array","items":{"$ref":"#/components/schemas/RefererMetric"},"description":"Top referer domains"},"top_campaigns":{"type":"array","items":{"$ref":"#/components/schemas/CampaignMetric"},"description":"Top UTM campaigns"}},"required":["total_requests","total_visitors","avg_response_time","total_pages","total_blogs","total_websites","total_clients","traffic_over_time","top_websites","top_countries","top_browsers","top_devices","top_os","top_referers","top_campaigns"]},"WorkspaceAnalyticsResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WorkspaceAnalyticsData"}},"required":["success","result"]},"WorkspaceAiVisibilityData":{"type":"object","properties":{"total_ai_crawls":{"type":"number","description":"Total number of requests from AI bots in the range","example":412},"total_ai_referrals":{"type":"number","description":"Total number of requests from AI platform referrers","example":87},"unique_ai_visitors":{"type":"number","description":"Distinct visitor IPs arriving from AI platforms","example":62},"citation_to_click_ratio":{"type":"number","description":"referrals / crawls. Rough signal for how effectively AI citations turn into visits. 0 if no crawls in range.","example":0.211},"top_ai_bots":{"type":"array","items":{"$ref":"#/components/schemas/AiBotMetric"},"description":"Top AI bots by request count"},"top_ai_referrers":{"type":"array","items":{"$ref":"#/components/schemas/AiReferrerMetric"},"description":"Top AI platforms by referral count"},"top_cited_pages":{"type":"array","items":{"$ref":"#/components/schemas/AiCitedPageMetric"},"description":"Pages that draw the most AI attention (crawls + referrals)"},"ai_traffic_over_time":{"type":"array","items":{"$ref":"#/components/schemas/AiTrafficDataPoint"},"description":"Daily or hourly time series of crawls and referrals"}},"required":["total_ai_crawls","total_ai_referrals","unique_ai_visitors","citation_to_click_ratio","top_ai_bots","top_ai_referrers","top_cited_pages","ai_traffic_over_time"]},"WorkspaceAiVisibilityResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the operation was successful","example":true},"result":{"$ref":"#/components/schemas/WorkspaceAiVisibilityData"}},"required":["success","result"]},"WorkflowResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates the workflow was started successfully","example":true},"workflow_id":{"type":"string","description":"Unique identifier for this workflow. Pass it back to the matching status endpoint (GET /v1/ai/workspace/{website|page|blog}/status/{workflow_id}) to poll progress.","example":"wf_abc123xyz789"}},"required":["success","workflow_id"]},"WorkflowErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Indicates the operation failed","example":false},"error":{"type":"string","description":"Error message describing what went wrong","example":"Invalid prompt: must be at least 10 characters"}},"required":["success","error"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"string"}},"required":["success","error"]},"CreateWebsiteWorkflowRequest":{"type":"object","properties":{"prompt":{"type":"string","minLength":10,"description":"AI prompt describing the website to create. Must be at least 10 characters.","example":"Create a modern landing page for a coffee shop called 'Bean There' with a warm color scheme"},"schedule_at":{"type":"string","description":"Optional ISO 8601 date to schedule the workflow for future execution. Must be in the future.","example":"2026-05-01T09:00:00Z"},"client":{"type":"object","properties":{"client_id":{"type":"string","description":"Existing client ID to assign the website to. If provided, the client must belong to your workspace.","example":"rec_abc123"},"email":{"type":"string","format":"email","description":"Client email. If the email matches an existing client in your workspace, the website is assigned to them. Otherwise a new client is created.","example":"client@example.com"},"name":{"type":"string","description":"Client name. Used when creating a new client (with email). Ignored if client_id is provided or client already exists.","example":"John Doe"}},"description":"Optional client to assign the website to. Provide either client_id (existing) or email (lookup or create)."}},"required":["prompt"]},"CreatePageWorkflowRequest":{"type":"object","properties":{"prompt":{"type":"string","minLength":10,"description":"AI prompt describing the page to create. Must be at least 10 characters.","example":"Create an about us page that highlights our team and company history"},"schedule_at":{"type":"string","description":"Optional ISO 8601 date to schedule the workflow for future execution.","example":"2026-05-01T09:00:00Z"}},"required":["prompt"]},"CreateBlogWorkflowRequest":{"type":"object","properties":{"prompt":{"type":"string","minLength":10,"description":"AI prompt describing the blog post to create. Must be at least 10 characters.","example":"Write a blog post about the benefits of organic coffee beans"},"schedule_at":{"type":"string","description":"Optional ISO 8601 date to schedule the workflow for future execution.","example":"2026-05-01T09:00:00Z"}},"required":["prompt"]},"PageWorkflowStatusResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"The status poll succeeded. This is independent of whether the workflow itself succeeded; check `status` for that.","example":true},"done":{"type":"boolean","description":"True once the workflow has reached a terminal state (`complete`, `partial`, or `errored`). While `false`, clients should poll again after `poll_after_ms`.","example":true},"status":{"type":"string","enum":["scheduled","running","complete","partial","errored"],"description":"- `scheduled`: queued to run in the future\n- `running`: currently executing\n- `complete`: fully finished with no errors\n- `partial`: finished, but some sub-steps (e.g. individual pages of a website) failed\n- `errored`: the workflow itself failed","example":"complete"},"workflow_id":{"type":"string","description":"The workflow_id you polled","example":"wf_abc123xyz789"},"message":{"type":"string","description":"Human-readable, safe-to-quote status message. Agents can surface this directly to end users.","example":"Page published at /about"},"poll_after_ms":{"type":"number","description":"When `done` is false, suggested delay before the next status check, in milliseconds. Absent when `done` is true.","example":5000},"result":{"$ref":"#/components/schemas/PageWorkflowResult"},"error":{"type":"string","description":"When `status` is `errored`, a machine-readable error message","example":"Insufficient credits: daily limit reached"}},"required":["success","done","status","workflow_id","message"]},"PageWorkflowResult":{"type":"object","properties":{"website_id":{"type":"string","description":"ID of the website the page belongs to","example":"website_def456"},"page_id":{"type":"string","description":"ID of the published page","example":"page_ghi789"},"slug":{"type":"string","description":"URL slug of the page (path without the leading slash)","example":"about"},"path":{"type":"string","description":"URL path of the page on the website","example":"/about"}},"required":["website_id","page_id","slug","path"],"description":"Present once the page has been published (`status` is `complete`)."},"BlogWorkflowStatusResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"The status poll succeeded. This is independent of whether the workflow itself succeeded; check `status` for that.","example":true},"done":{"type":"boolean","description":"True once the workflow has reached a terminal state (`complete`, `partial`, or `errored`). While `false`, clients should poll again after `poll_after_ms`.","example":true},"status":{"type":"string","enum":["scheduled","running","complete","partial","errored"],"description":"- `scheduled`: queued to run in the future\n- `running`: currently executing\n- `complete`: fully finished with no errors\n- `partial`: finished, but some sub-steps (e.g. individual pages of a website) failed\n- `errored`: the workflow itself failed","example":"complete"},"workflow_id":{"type":"string","description":"The workflow_id you polled","example":"wf_abc123xyz789"},"message":{"type":"string","description":"Human-readable, safe-to-quote status message. Agents can surface this directly to end users.","example":"Page published at /about"},"poll_after_ms":{"type":"number","description":"When `done` is false, suggested delay before the next status check, in milliseconds. Absent when `done` is true.","example":5000},"result":{"$ref":"#/components/schemas/BlogWorkflowResult"},"error":{"type":"string","description":"When `status` is `errored`, a machine-readable error message","example":"Insufficient credits: daily limit reached"}},"required":["success","done","status","workflow_id","message"]},"BlogWorkflowResult":{"type":"object","properties":{"website_id":{"type":"string","description":"ID of the website the blog post belongs to","example":"website_def456"},"blog_id":{"type":"string","description":"ID of the published blog post","example":"blog_jkl012"},"slug":{"type":"string","description":"URL slug of the blog post (path without the leading slash)","example":"hello-world"},"path":{"type":"string","description":"URL path of the blog post on the website","example":"/blog/hello-world"}},"required":["website_id","blog_id","slug","path"],"description":"Present once the blog post has been published (`status` is `complete`)."},"WebsiteWorkflowStatusResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"The status poll succeeded. This is independent of whether the workflow itself succeeded; check `status` for that.","example":true},"done":{"type":"boolean","description":"True once the workflow has reached a terminal state (`complete`, `partial`, or `errored`). While `false`, clients should poll again after `poll_after_ms`.","example":true},"status":{"type":"string","enum":["scheduled","running","complete","partial","errored"],"description":"- `scheduled`: queued to run in the future\n- `running`: currently executing\n- `complete`: fully finished with no errors\n- `partial`: finished, but some sub-steps (e.g. individual pages of a website) failed\n- `errored`: the workflow itself failed","example":"complete"},"workflow_id":{"type":"string","description":"The workflow_id you polled","example":"wf_abc123xyz789"},"message":{"type":"string","description":"Human-readable, safe-to-quote status message. Agents can surface this directly to end users.","example":"Page published at /about"},"poll_after_ms":{"type":"number","description":"When `done` is false, suggested delay before the next status check, in milliseconds. Absent when `done` is true.","example":5000},"result":{"$ref":"#/components/schemas/WebsiteWorkflowResult"},"error":{"type":"string","description":"When `status` is `errored`, a machine-readable error message","example":"Insufficient credits: daily limit reached"}},"required":["success","done","status","workflow_id","message"]},"WebsiteWorkflowResult":{"type":"object","properties":{"website_id":{"type":"string","description":"ID of the website","example":"website_def456"},"website_name":{"type":"string","description":"Business name of the website","example":"Acme Bakery"},"domain":{"type":"string","description":"Canonical URL where the website is reachable. Returns the verified custom domain if one has been connected, otherwise the Lindo preview URL.","example":"https://acmebakery.com"},"home_page_id":{"type":"string","description":"ID of the website's home page (available once published)","example":"page_home_abc"},"pages_summary":{"type":"object","properties":{"total":{"type":"number","description":"Total pages being generated, including the home page","example":5},"complete":{"type":"number","description":"Pages successfully published","example":4},"running":{"type":"number","description":"Pages still being generated","example":0},"errored":{"type":"number","description":"Pages that failed to generate","example":1}},"required":["total","complete","running","errored"],"description":"Aggregate progress across the home page and all additional pages."},"pages":{"type":"array","items":{"$ref":"#/components/schemas/WebsitePageEntry"},"description":"Every page being generated for the website, including the home page."}},"required":["website_id","pages_summary","pages"],"description":"Present as soon as the website record is created. While running, `pages_summary` and `pages` track per-page progress. When `status` is `complete`, every page succeeded; when `partial`, the website exists but one or more additional pages failed."},"WebsitePageEntry":{"type":"object","properties":{"page_id":{"type":"string","description":"ID of the published page (absent while running or if errored before publish)","example":"page_xyz789"},"slug":{"type":"string","description":"URL slug of the page. Empty string for the home page.","example":"about"},"path":{"type":"string","description":"URL path of the page. '/' for the home page.","example":"/about"},"status":{"type":"string","enum":["running","complete","errored"],"description":"Status of this individual page","example":"complete"},"error_message":{"type":"string","description":"Error message (only when `status` is `errored`)"}},"required":["slug","path","status"]},"BatchCreateResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"The batch request was processed. Individual items may still have failed — check per-item `success`."},"total":{"type":"number","description":"Total items in the batch"},"succeeded":{"type":"number","description":"Number of items successfully accepted"},"failed":{"type":"number","description":"Number of items that failed to start"},"items":{"type":"array","items":{"$ref":"#/components/schemas/BatchCreateItemResult"},"description":"Per-item result, in the same order as the request"}},"required":["success","total","succeeded","failed","items"]},"BatchCreateItemResult":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether this item was accepted and scheduled","example":true},"workflow_id":{"type":"string","description":"Workflow id (present when success is true)"},"error":{"type":"string","description":"Error message (present when success is false)"}},"required":["success"]},"BatchCreateWebsiteRequest":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BatchWebsiteItem"},"minItems":1,"maxItems":25,"description":"Array of websites to create. Between 1 and 25 items."}},"required":["items"]},"BatchWebsiteItem":{"type":"object","properties":{"prompt":{"type":"string","minLength":10,"description":"AI prompt describing this website"},"schedule_at":{"type":"string","description":"Optional ISO 8601 date to schedule for later"},"client":{"type":"object","properties":{"client_id":{"type":"string"},"email":{"type":"string","format":"email"},"name":{"type":"string"}},"description":"Optional per-item client assignment"}},"required":["prompt"]},"BatchCreatePageRequest":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BatchPageOrBlogItem"},"minItems":1,"maxItems":25,"description":"Array of pages to create on the website. Between 1 and 25 items."}},"required":["items"]},"BatchPageOrBlogItem":{"type":"object","properties":{"prompt":{"type":"string","minLength":10,"description":"AI prompt describing this page/blog"},"schedule_at":{"type":"string","description":"Optional ISO 8601 date to schedule for later"}},"required":["prompt"]},"BatchCreateBlogRequest":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BatchPageOrBlogItem"},"minItems":1,"maxItems":25,"description":"Array of blog posts to create on the website. Between 1 and 25 items."}},"required":["items"]},"BatchWebsiteStatusResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"done":{"type":"boolean","description":"True once every item has reached a terminal state."},"status":{"type":"string","enum":["scheduled","running","complete","partial","errored"],"description":"- `scheduled`: every item is scheduled\n- `running`: at least one item is still running or scheduled\n- `complete`: every item finished cleanly\n- `partial`: every item is terminal but some errored\n- `errored`: every item errored"},"message":{"type":"string","description":"Human-readable summary of the batch, safe to quote.","example":"5 items complete."},"summary":{"type":"object","properties":{"total":{"type":"number","description":"Total items polled","example":5},"complete":{"type":"number","description":"Items complete","example":5},"running":{"type":"number","description":"Items still running (includes scheduled)","example":0},"partial":{"type":"number","description":"Items with partial outcome (website only)","example":0},"errored":{"type":"number","description":"Items errored","example":0},"not_found":{"type":"number","description":"workflow_ids that could not be found (or belong to a different workflow type).","example":0}},"required":["total","complete","running","partial","errored","not_found"]},"poll_after_ms":{"type":"number","description":"Suggested delay before polling again while `done` is false."},"items":{"type":"array","items":{"$ref":"#/components/schemas/BatchWebsiteStatusItem"},"description":"Per-workflow status, in the same order as the requested workflow_ids."}},"required":["success","done","status","message","summary","items"]},"BatchWebsiteStatusItem":{"type":"object","properties":{"success":{"type":"boolean","description":"True if the workflow was found and polled. False for not-found or wrong-type workflows."},"workflow_id":{"type":"string","description":"The workflow_id you requested"},"done":{"type":"boolean","description":"Whether this item is in a terminal state (absent when `success` is false)."},"status":{"type":"string","enum":["scheduled","running","complete","partial","errored"],"description":"Normalized status for this item (absent when `success` is false).","example":"complete"},"message":{"type":"string","description":"Human-readable message for this item."},"result":{"$ref":"#/components/schemas/WebsiteWorkflowResult"},"error":{"type":"string","description":"Error message when the item errored or was not found."}},"required":["success","workflow_id"]},"BatchStatusRequest":{"type":"object","properties":{"workflow_ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":25,"description":"Array of workflow_ids to poll. Between 1 and 25 items.","example":["wf_abc","wf_def","wf_ghi"]}},"required":["workflow_ids"]},"BatchPageStatusResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"done":{"type":"boolean","description":"True once every item has reached a terminal state."},"status":{"type":"string","enum":["scheduled","running","complete","partial","errored"],"description":"- `scheduled`: every item is scheduled\n- `running`: at least one item is still running or scheduled\n- `complete`: every item finished cleanly\n- `partial`: every item is terminal but some errored\n- `errored`: every item errored"},"message":{"type":"string","description":"Human-readable summary of the batch, safe to quote.","example":"5 items complete."},"summary":{"type":"object","properties":{"total":{"type":"number","description":"Total items polled","example":5},"complete":{"type":"number","description":"Items complete","example":5},"running":{"type":"number","description":"Items still running (includes scheduled)","example":0},"partial":{"type":"number","description":"Items with partial outcome (website only)","example":0},"errored":{"type":"number","description":"Items errored","example":0},"not_found":{"type":"number","description":"workflow_ids that could not be found (or belong to a different workflow type).","example":0}},"required":["total","complete","running","partial","errored","not_found"]},"poll_after_ms":{"type":"number","description":"Suggested delay before polling again while `done` is false."},"items":{"type":"array","items":{"$ref":"#/components/schemas/BatchPageStatusItem"},"description":"Per-workflow status, in the same order as the requested workflow_ids."}},"required":["success","done","status","message","summary","items"]},"BatchPageStatusItem":{"type":"object","properties":{"success":{"type":"boolean","description":"True if the workflow was found and polled. False for not-found or wrong-type workflows."},"workflow_id":{"type":"string","description":"The workflow_id you requested"},"done":{"type":"boolean","description":"Whether this item is in a terminal state (absent when `success` is false)."},"status":{"type":"string","enum":["scheduled","running","complete","partial","errored"],"description":"Normalized status for this item (absent when `success` is false).","example":"complete"},"message":{"type":"string","description":"Human-readable message for this item."},"result":{"$ref":"#/components/schemas/PageWorkflowResult"},"error":{"type":"string","description":"Error message when the item errored or was not found."}},"required":["success","workflow_id"]},"BatchBlogStatusResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"done":{"type":"boolean","description":"True once every item has reached a terminal state."},"status":{"type":"string","enum":["scheduled","running","complete","partial","errored"],"description":"- `scheduled`: every item is scheduled\n- `running`: at least one item is still running or scheduled\n- `complete`: every item finished cleanly\n- `partial`: every item is terminal but some errored\n- `errored`: every item errored"},"message":{"type":"string","description":"Human-readable summary of the batch, safe to quote.","example":"5 items complete."},"summary":{"type":"object","properties":{"total":{"type":"number","description":"Total items polled","example":5},"complete":{"type":"number","description":"Items complete","example":5},"running":{"type":"number","description":"Items still running (includes scheduled)","example":0},"partial":{"type":"number","description":"Items with partial outcome (website only)","example":0},"errored":{"type":"number","description":"Items errored","example":0},"not_found":{"type":"number","description":"workflow_ids that could not be found (or belong to a different workflow type).","example":0}},"required":["total","complete","running","partial","errored","not_found"]},"poll_after_ms":{"type":"number","description":"Suggested delay before polling again while `done` is false."},"items":{"type":"array","items":{"$ref":"#/components/schemas/BatchBlogStatusItem"},"description":"Per-workflow status, in the same order as the requested workflow_ids."}},"required":["success","done","status","message","summary","items"]},"BatchBlogStatusItem":{"type":"object","properties":{"success":{"type":"boolean","description":"True if the workflow was found and polled. False for not-found or wrong-type workflows."},"workflow_id":{"type":"string","description":"The workflow_id you requested"},"done":{"type":"boolean","description":"Whether this item is in a terminal state (absent when `success` is false)."},"status":{"type":"string","enum":["scheduled","running","complete","partial","errored"],"description":"Normalized status for this item (absent when `success` is false).","example":"complete"},"message":{"type":"string","description":"Human-readable message for this item."},"result":{"$ref":"#/components/schemas/BlogWorkflowResult"},"error":{"type":"string","description":"Error message when the item errored or was not found."}},"required":["success","workflow_id"]},"CreditsResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"result":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","client"]},"workspace_id":{"type":"string"},"client_id":{"type":"string"},"balance":{"type":"object","properties":{"workspace_id":{"type":"string","nullable":true},"current_balance":{"type":"object","properties":{"monthly":{"type":"object","properties":{"available":{"type":"number"},"used":{"type":"number"},"limit":{"type":"number"},"utilization_percentage":{"type":"number"}},"required":["available","used","limit","utilization_percentage"]},"purchased":{"type":"object","properties":{"available":{"type":"number"},"used":{"type":"number"},"total_allocated":{"type":"number"}},"required":["available","used","total_allocated"]},"daily":{"type":"object","properties":{"available":{"type":"number"},"used":{"type":"number"},"limit":{"type":"number"},"resets_at":{"type":"string"}},"required":["available","used","limit","resets_at"]},"total_available":{"type":"number"}},"required":["monthly","purchased","daily","total_available"]},"plan_details":{"type":"object","properties":{"current_plan":{"type":"string"},"monthly_limit":{"type":"number"},"daily_limit":{"type":"number"}},"required":["current_plan","monthly_limit","daily_limit"]},"reset_dates":{"type":"object","properties":{"next_monthly_reset":{"type":"string"},"next_daily_reset":{"type":"string"}},"required":["next_monthly_reset","next_daily_reset"]},"last_updated":{"type":"string"}},"required":["workspace_id","current_balance","plan_details","reset_dates","last_updated"]}},"required":["type","workspace_id","balance"]}},"required":["success","result"]},"AllocateClientCreditsResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"result":{"type":"object","properties":{"allocation":{"type":"object","properties":{"id":{"type":"string"},"client_id":{"type":"string"},"credit_type":{"type":"string"},"amount":{"type":"number"},"remaining":{"type":"number"},"source":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"}},"required":["id","client_id","credit_type","amount","remaining","source","status","created_at"]},"message":{"type":"string"},"balance":{"type":"object","nullable":true,"properties":{"monthly":{"type":"number"},"purchased":{"type":"number"},"daily":{"type":"number"},"total":{"type":"number"}},"required":["monthly","purchased","daily","total"]}},"required":["balance"]}},"required":["success","result"]},"AllocateClientCreditsRequest":{"type":"object","properties":{"client_id":{"type":"string","description":"The ID of the client to allocate credits to","example":"client_abc123"},"credit_type":{"type":"string","enum":["monthly","purchased","daily"],"description":"Type of credits to allocate","example":"purchased"},"amount":{"type":"number","minimum":1,"description":"Number of credits to allocate (must be positive)","example":100},"source":{"type":"string","description":"Source of the allocation (e.g. bonus, purchase)","example":"bonus"},"notes":{"type":"string","description":"Optional notes for the allocation","example":"Monthly credit top-up"}},"required":["client_id","credit_type","amount"]}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Enter your API key (starts with lindo_sk_)"}}}}