### Install Lindo SDK Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Install the Lindo SDK using npm, yarn, or pnpm. ```bash npm install @lindo/sdk # or yarn add @lindo/sdk # or pnpm add @lindo/sdk ``` -------------------------------- ### client.workflows.batchStart Source: https://context7.com/lindoai/lindoai-js/llms.txt Starts up to 25 named workflows in a single request. ```APIDOC ## client.workflows.batchStart — Start Multiple Workflows Starts up to 25 named workflows in a single request. ```typescript const batch = await client.workflows.batchStart({ workflows: [ { workflow_name: 'publish-page', page_id: 'pg_001' }, { workflow_name: 'publish-page', page_id: 'pg_002' }, { workflow_name: 'send-notification', user_id: 'usr_099' }, ], }); console.log(`Started ${batch.total} workflows`); batch.results.forEach(r => console.log(r.instance_id, r.status)); ``` ``` -------------------------------- ### Batch Start Workflows Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Start multiple instances of the same workflow in a single batch request. ```typescript // Start multiple workflows in batch const batch = await client.workflows.batchStart({ workflow_name: 'publish-page', items: [ { params: { page_id: 'page-1' } }, { params: { page_id: 'page-2' } }, ], }); ``` -------------------------------- ### Workflows - Start Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Start a new workflow instance. This method initiates a long-running workflow with specified parameters. ```APIDOC ## Workflows - Start ### Description Start a new workflow instance. This method initiates a long-running workflow with specified parameters. ### Method `client.workflows.start(params: { workflow_name: string; params: any })` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **workflow_name** (string) - Required - The name of the workflow to start. - **params** (any) - Required - Parameters for the workflow. ### Request Example ```typescript const workflow = await client.workflows.start({ workflow_name: 'publish-page', params: { page_id: 'page-123' }, }); ``` ### Response #### Success Response (200) - **instance_id** (string) - The unique identifier for the workflow instance. #### Response Example ```json { "instance_id": "instance-123" } ``` ``` -------------------------------- ### Workflows - Batch Start Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Start multiple workflow instances in a single batch request. This is useful for initiating several similar workflows efficiently. ```APIDOC ## Workflows - Batch Start ### Description Start multiple workflow instances in a single batch request. This is useful for initiating several similar workflows efficiently. ### Method `client.workflows.batchStart(params: { workflow_name: string; items: Array<{ params: any }> })` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **workflow_name** (string) - Required - The name of the workflow to start. - **items** (Array<{ params: any }>) - Required - An array of items, each containing parameters for a workflow instance. ### Request Example ```typescript const batch = await client.workflows.batchStart({ workflow_name: 'publish-page', items: [ { params: { page_id: 'page-1' } }, { params: { page_id: 'page-2' } }, ], }); ``` ### Response #### Success Response (200) - **batch_id** (string) - The unique identifier for the batch operation. - **instance_ids** (Array) - An array of instance IDs for the started workflows. #### Response Example ```json { "batch_id": "batch-abc", "instance_ids": ["instance-123", "instance-456"] } ``` ``` -------------------------------- ### Start Multiple Workflows Source: https://context7.com/lindoai/lindoai-js/llms.txt Initiate up to 25 workflow instances in a single request. Useful for batch processing and automation. ```typescript const batch = await client.workflows.batchStart({ workflows: [ { workflow_name: 'publish-page', page_id: 'pg_001' }, { workflow_name: 'publish-page', page_id: 'pg_002' }, { workflow_name: 'send-notification', user_id: 'usr_099' }, ], }); console.log(`Started ${batch.total} workflows`); batch.results.forEach(r => console.log(r.instance_id, r.status)); ``` -------------------------------- ### client.websites.addDomain, removeDomain Source: https://context7.com/lindoai/lindoai-js/llms.txt Manages custom domains for a website, including initiating setup and removal. ```APIDOC ## client.websites.addDomain / removeDomain — Custom Domain Management Initiates custom domain setup and returns the DNS records to configure at your registrar. ### Add Domain #### Method client.websites.addDomain #### Parameters #### Path Parameters - **website_id** (string) - Required - The ID of the website. - **domain** (string) - Required - The custom domain name to add. ### Remove Domain #### Method client.websites.removeDomain #### Parameters #### Path Parameters - **website_id** (string) - Required - The ID of the website. ### Request Example ```typescript // Add domain const domainResult = await client.websites.addDomain('ws_abc123', 'example.com'); console.log(domainResult.result.instructions); domainResult.result.dns_records.forEach(r => { console.log(`${r.record_type} ${r.host} → ${r.value} (TTL: ${r.ttl})`); }); // Remove domain const removed = await client.websites.removeDomain('ws_abc123'); console.log(removed.result.message); ``` ### Response (Add Domain) #### Success Response - **instructions** (string) - Instructions for configuring DNS records. - **dns_records** (array) - An array of DNS records to configure. - **record_type** (string) - The type of DNS record (e.g., CNAME). - **host** (string) - The host for the DNS record. - **value** (string) - The value for the DNS record. - **ttl** (number) - The Time To Live for the DNS record. ### Response (Remove Domain) #### Success Response - **message** (string) - Confirmation message that the custom domain was removed. ``` -------------------------------- ### Batch Create Pages and Blogs with AI Source: https://context7.com/lindoai/lindoai-js/llms.txt Starts up to 25 page or blog creation workflows on a single website in one request. Use `batchCreatePages` for pages and `batchCreateBlogs` for blog posts. Poll statuses using the respective batch check functions. ```typescript // Batch pages const pageBatch = await client.workflows.batchCreatePages('ws_abc123', [ { prompt: 'Team page showcasing 6 engineers with bios' }, { prompt: 'Pricing page with 3 tiers: Starter, Pro, Enterprise' }, ]); const pageIds = pageBatch.items.filter(i => i.success).map(i => i.record_id!); const pageStatus = await client.workflows.batchCheckPageStatus(pageIds); console.log(pageStatus.summary); // { total: 2, complete: 0, running: 2, ... } // Batch blogs const blogBatch = await client.workflows.batchCreateBlogs('ws_abc123', [ { prompt: 'Post: How AI is transforming small business websites' }, { prompt: 'Post: 10 SEO tips for local businesses in 2025' }, ]); const blogIds = blogBatch.items.filter(i => i.success).map(i => i.record_id!); const blogStatus = await client.workflows.batchCheckBlogStatus(blogIds); console.log(blogStatus.status); // "running" ``` -------------------------------- ### Start a Workflow Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Initiate a long-running workflow with specified parameters. The response contains the workflow instance ID. ```typescript // Start a workflow const workflow = await client.workflows.start({ workflow_name: 'publish-page', params: { page_id: 'page-123' }, }); console.log(workflow.instance_id); // Workflow instance ID ``` -------------------------------- ### Manage Custom Domains Source: https://context7.com/lindoai/lindoai-js/llms.txt Initiates custom domain setup or removal. Adding a domain returns DNS records required for registrar configuration. ```typescript // Add domain const domainResult = await client.websites.addDomain('ws_abc123', 'example.com'); console.log(domainResult.result.instructions); domainResult.result.dns_records.forEach(r => { console.log(`${r.record_type} ${r.host} → ${r.value} (TTL: ${r.ttl})`); // "CNAME www → ws_abc123.lindo.site (TTL: 3600)" }); ``` ```typescript // Remove domain const removed = await client.websites.removeDomain('ws_abc123'); console.log(removed.result.message); // "Custom domain removed" ``` -------------------------------- ### Start a Named Workflow Source: https://context7.com/lindoai/lindoai-js/llms.txt Initiate a single workflow instance by its name and parameters. Returns an instance_id and initial status for subsequent polling. ```typescript const workflow = await client.workflows.start({ workflow_name: 'publish-page', params: { page_id: 'pg_abc123', scheduled_at: '2025-06-01T09:00:00Z' }, }); console.log(workflow.instance_id); // "wf_xxxxxxx" console.log(workflow.status); // "queued" ``` -------------------------------- ### Get Workspace Credit Balance Source: https://context7.com/lindoai/lindoai-js/llms.txt Retrieves the current credit balance, allocated, and consumed credits for the workspace. Also shows how to get per-client balance. ```typescript const credits = await client.workspace.getCredits(); console.log('Balance:', credits.balance); // 1450 console.log('Allocated:', credits.allocated); // 2000 console.log('Used:', credits.used); // 550 console.log('Resets:', credits.reset_date); // "2025-08-01T00:00:00Z" // Per-client balance const clientCredits = await client.workspace.getClientCredits('client-123'); console.log('Client balance:', clientCredits.data.balance); ``` -------------------------------- ### Manage Blog Posts: List, Get, Update, Unpublish, Delete Source: https://context7.com/lindoai/lindoai-js/llms.txt This snippet demonstrates the full lifecycle management of blog posts. Use these methods to list existing blogs, retrieve details of a specific blog, update its metadata, unpublish it, or delete it entirely. Ensure you have the correct website ID and blog ID. ```typescript // List blogs const blogs = await client.blogs.list('ws_abc123', { page: 1, search: 'coffee' }); blogs.result.list.forEach(b => console.log(b.blog_id, b.path, b.blog_settings)); // Get details const blog = await client.blogs.get('ws_abc123', 'bl_789'); console.log(blog.result.seo); console.log(blog.result.blog_settings); // Update metadata await client.blogs.update('ws_abc123', 'bl_789', { name: 'Top 5 Coffee Brewing Methods', seo: { page_title: 'Top 5 Coffee Methods | Bean There Blog' }, blog_settings: { author: 'Jane Smith', category: 'Brewing Tips' }, }); // Unpublish await client.blogs.unpublish('ws_abc123', 'bl_789'); // Delete await client.blogs.delete('ws_abc123', 'bl_789'); ``` -------------------------------- ### Workspace - Get Credits Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Retrieve the current credit balance for your workspace. This includes information on allocated and used credits. ```APIDOC ## Workspace - Get Credits ### Description Retrieve the current credit balance for your workspace. This includes information on allocated and used credits. ### Method `client.workspace.getCredits()` ### Parameters None ### Request Example ```typescript const credits = await client.workspace.getCredits(); ``` ### Response #### Success Response (200) - **balance** (number) - The current available credit balance. - **allocated** (number) - The total amount of credits allocated to the workspace. - **used** (number) - The total amount of credits that have been used. #### Response Example ```json { "balance": 1000, "allocated": 2000, "used": 1000 } ``` ``` -------------------------------- ### Create, Get, and Publish Blog Post HTML Source: https://context7.com/lindoai/lindoai-js/llms.txt Use this to create new blog posts with HTML content, retrieve existing content for editing, and re-publish updated posts. Ensure you have the correct website ID and blog ID. ```typescript // Create a blog post const created = await client.blogs.create('ws_abc123', { path: '/blog/single-origin-coffee', blog_content: '

Single-origin coffee offers unmatched flavor clarity...

', seo: { page_title: 'Single Origin Coffee | Bean There', meta_description: 'Explore single-origin beans' }, blog_settings: { author: 'Jane Smith', excerpt: 'Unmatched flavor clarity...', category: 'Origin Stories', read_time: '4 min' }, }); console.log('Blog ID:', created.result.blog_id); // Get raw content for editing const content = await client.blogs.getHtml('ws_abc123', created.result.blog_id); console.log(content.result.blog_content); console.log(content.result.blog_settings); // Re-publish with updated content const published = await client.blogs.publish('ws_abc123', created.result.blog_id, { path: '/blog/single-origin-coffee', blog_content: '

Updated: single-origin coffee offers remarkable clarity...

', seo: { page_title: 'Single Origin Coffee (Updated) | Bean There' }, blog_settings: { author: 'Jane Smith', read_time: '5 min' }, }); console.log('Published at:', published.result.publish_date); ``` -------------------------------- ### Get Workspace Credits Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Retrieve the current credit balance, allocated credits, and used credits for the workspace. ```typescript // Get credit balance const credits = await client.workspace.getCredits(); console.log(credits.balance); // Current balance console.log(credits.allocated); // Total allocated console.log(credits.used); // Total used ``` -------------------------------- ### Get and Update Website Details Source: https://context7.com/lindoai/lindoai-js/llms.txt Fetches full website metadata or updates business info, theme, SEO, and integrations. Requires website_id. ```typescript // Get details const details = await client.websites.getDetails('ws_abc123'); console.log(details.result.custom_domain); // "example.com" | null console.log(details.result.integrations); console.log(details.result.global_header); ``` ```typescript // Update settings await client.websites.updateSettings('ws_abc123', { business_name: 'Bean There Coffee', language: 'en', theme: { primary_color: '#6B4226' }, socials: { instagram: 'https://instagram.com/beanthere' }, robots: 'User-agent: * Disallow: /admin', }); ``` -------------------------------- ### Create, Get, and Publish Page HTML Source: https://context7.com/lindoai/lindoai-js/llms.txt Use this to create new pages with HTML content, retrieve existing HTML for editing, and re-publish updated content. Ensure you have the correct website ID and page ID. ```typescript // Create a new page const created = await client.pages.create('ws_abc123', { html: '

Welcome

', path: '/welcome', seo: { page_title: 'Welcome | Bean There', meta_description: 'Our home page' }, custom_codes: { header: '' }, }); console.log('Page ID:', created.result.page_id); // Get HTML for editing const html = await client.pages.getHtml('ws_abc123', created.result.page_id); console.log(html.result.html); // "
..." console.log(html.result.path); // "/welcome" // Re-publish with updated HTML const published = await client.pages.publish('ws_abc123', created.result.page_id, { html: '

Welcome Back

', path: '/welcome', seo: { page_title: 'Welcome Back | Bean There' }, }); console.log('Published at:', published.result.publish_date); ``` -------------------------------- ### Manage Website Pages Source: https://context7.com/lindoai/lindoai-js/llms.txt Provides full lifecycle management for individual pages within a website, including listing, getting details, updating, unpublishing, and deleting. ```typescript // List pages const pages = await client.pages.list('ws_abc123', { search: 'about' }); pages.result.list.forEach(p => console.log(p.page_id, p.path, p.status)); ``` ```typescript // Get details const page = await client.pages.get('ws_abc123', 'pg_456'); console.log(page.result.seo.title); console.log(page.result.publish_date); ``` ```typescript // Update metadata await client.pages.update('ws_abc123', 'pg_456', { name: 'About Our Team', language: 'en', seo: { title: 'About Us | Bean There Coffee' }, }); ``` ```typescript // Unpublish await client.pages.unpublish('ws_abc123', 'pg_456'); ``` ```typescript // Delete await client.pages.deletePage('ws_abc123', 'pg_456'); ``` -------------------------------- ### client.workflows.start Source: https://context7.com/lindoai/lindoai-js/llms.txt Launches a single low-level workflow instance by name and returns an `instance_id` for status polling. ```APIDOC ## client.workflows.start — Start a Named Workflow Launches a single low-level workflow instance by name and returns an `instance_id` for status polling. ```typescript const workflow = await client.workflows.start({ workflow_name: 'publish-page', params: { page_id: 'pg_abc123', scheduled_at: '2025-06-01T09:00:00Z' }, }); console.log(workflow.instance_id); // "wf_xxxxxxx" console.log(workflow.status); // "queued" ``` ``` -------------------------------- ### client.workspace.setupWhitelabel Source: https://context7.com/lindoai/lindoai-js/llms.txt Enables white-label mode with a custom domain, email sender, and optional client self-registration. ```APIDOC ## client.workspace.setupWhitelabel — Configure Whitelabel Branding ### Description Enables white-label mode with a custom domain, email sender, and optional client self-registration. ### Method ```typescript const wl = await client.workspace.setupWhitelabel({ domain: 'app.acme.com', subdomain_domain: 'sites.acme.com', email_sender: 'noreply@acme.com', wl_client_register: true }); ``` ### Parameters #### Request Body - **domain** (string) - Required - The custom domain for the whitelabel. - **subdomain_domain** (string) - Required - The subdomain domain for the whitelabel. - **email_sender** (string) - Required - The email sender address. - **wl_client_register** (boolean) - Optional - Whether to enable client self-registration. ### Example Usage ```typescript const wl = await client.workspace.setupWhitelabel({ domain: 'app.acme.com', subdomain_domain: 'sites.acme.com', email_sender: 'noreply@acme.com', wl_client_register: true }); console.log(wl.result.whitelabel.domain); // "app.acme.com" ``` ``` -------------------------------- ### LindoClient Initialization Source: https://context7.com/lindoai/lindoai-js/llms.txt Initialize the LindoClient with your API key. Optional baseUrl and timeout parameters can also be provided. ```APIDOC ## LindoClient Initialization The entry point for all SDK operations. Requires an API key; `baseUrl` and `timeout` are optional. ```typescript import { LindoClient } from '@lindo/sdk'; // Minimal setup const client = new LindoClient({ apiKey: 'ldo_live_xxxx' }); // Full configuration const client = new LindoClient({ apiKey: 'ldo_live_xxxx', baseUrl: 'https://api.lindo.ai', // default timeout: 30000, // default: 30 s }); // Missing API key throws synchronously try { new LindoClient({ apiKey: '' }); } catch (e) { console.error(e.message); // "API key is required…" } ``` ``` -------------------------------- ### Create Website with AI (Async) Source: https://context7.com/lindoai/lindoai-js/llms.txt Initiates an AI-driven website generation from a prompt. Returns a record ID for polling status. Ensure the prompt is clear and specific for best results. ```typescript const { record_id } = await client.workflows.createWebsite({ prompt: 'Create a professional website for a coffee shop called Bean There with home, menu, and contact pages', client: { email: 'owner@beanthere.coffee', name: 'Bean There Coffee' }, schedule_at: '2025-07-01T10:00:00Z', // optional }); // Poll until complete let status; do { status = await client.workflows.getWebsiteStatus(record_id); if (!status.done) { console.log(status.message); // "Creating your website. 2 of 4 pages complete." await new Promise(r => setTimeout(r, status.poll_after_ms ?? 5000)); } } while (!status.done); if (status.status === 'complete') { console.log('Website ID:', status.result?.website_id); status.result?.pages.forEach(p => console.log(p.path, p.status)); } else { console.error('Error:', status.error); } ``` -------------------------------- ### Get Website Analytics Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Retrieve website analytics, such as top pages, for a given period. ```typescript // Get website analytics const websiteAnalytics = await client.analytics.getWebsite({ from: '2024-01-01', to: '2024-01-31', }); console.log(websiteAnalytics.top_pages); ``` -------------------------------- ### Create Blog Post with AI (Async) Source: https://context7.com/lindoai/lindoai-js/llms.txt Generates an AI-powered blog post for an existing website. Provide the website ID and a prompt for the blog content. Use the returned record ID to poll for status. ```typescript const { record_id } = await client.workflows.createBlog('ws_abc123', { prompt: 'Write a blog post about the top 5 benefits of single-origin coffee beans', schedule_at: '2025-08-15T08:00:00Z', }); const status = await client.workflows.getBlogStatus(record_id); if (status.done && status.result) { console.log('Blog path:', status.result.path); // "/blog/top-5-benefits-single-origin-coffee" } ``` -------------------------------- ### Initialize LindoClient Source: https://context7.com/lindoai/lindoai-js/llms.txt Initialize the LindoClient with an API key. Optional baseUrl and timeout can be configured. An empty API key will throw an error. ```typescript import { LindoClient } from '@lindo/sdk'; // Minimal setup const client = new LindoClient({apiKey: 'ldo_live_xxxx'}); // Full configuration const client = new LindoClient({ apiKey: 'ldo_live_xxxx', baseUrl: 'https://api.lindo.ai', // default timeout: 30000, // default: 30 s }); // Missing API key throws synchronously try { new LindoClient({apiKey: ''}); } catch (e) { console.error(e.message); // "API key is required…" } ``` -------------------------------- ### Initialize Lindo Client Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Initialize the LindoClient with your API key. The baseUrl and timeout can also be configured. ```typescript const client = new LindoClient({ apiKey: 'your-api-key', }); ``` ```typescript const client = new LindoClient({ apiKey: 'your-api-key', // Required baseUrl: 'https://api.lindo.ai', // Optional, defaults to https://api.lindo.ai timeout: 30000, // Optional, defaults to 30000ms }); ``` -------------------------------- ### Get Website Analytics Source: https://context7.com/lindoai/lindoai-js/llms.txt Fetches website-level traffic and performance analytics. Supports optional date range filtering. ```typescript const analytics = await client.websites.getAnalytics('ws_abc123', { from: '2025-04-01', to: '2025-04-30', }); console.log('Total requests:', analytics.result.total_requests); console.log('Total visitors:', analytics.result.total_visitors); ``` -------------------------------- ### Workflows - Get Status Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Retrieve the current status of a specific workflow instance. This allows you to monitor the progress of long-running workflows. ```APIDOC ## Workflows - Get Status ### Description Retrieve the current status of a specific workflow instance. This allows you to monitor the progress of long-running workflows. ### Method `client.workflows.getStatus(instanceId: string)` ### Parameters #### Path Parameters - **instanceId** (string) - Required - The ID of the workflow instance to get the status for. #### Query Parameters None #### Request Body None ### Request Example ```typescript const status = await client.workflows.getStatus('instance-123'); ``` ### Response #### Success Response (200) - **status** (string) - The current status of the workflow. Possible values: 'queued', 'running', 'paused', 'completed', 'failed', 'terminated'. #### Response Example ```json { "status": "running" } ``` ``` -------------------------------- ### Analytics - Get Workspace Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Access analytics data for your workspace. You can specify a date range to retrieve data for a specific period. ```APIDOC ## Analytics - Get Workspace ### Description Access analytics data for your workspace. You can specify a date range to retrieve data for a specific period. ### Method `client.analytics.getWorkspace(params: { from?: string; to?: string })` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **from** (string) - Optional - The start date for the analytics data (YYYY-MM-DD). - **to** (string) - Optional - The end date for the analytics data (YYYY-MM-DD). ### Request Example ```typescript const workspaceAnalytics = await client.analytics.getWorkspace({ from: '2024-01-01', to: '2024-01-31', }); ``` ### Response #### Success Response (200) - **total_views** (number) - Total number of views. - **unique_visitors** (number) - Total number of unique visitors. #### Response Example ```json { "total_views": 15000, "unique_visitors": 5000 } ``` ``` -------------------------------- ### Development Commands Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Execute these commands using pnpm to manage the SDK package during development. These include building the package, running type checks, and executing tests. ```bash # Build the package pnpm build ``` ```bash # Run type checking pnpm typecheck ``` ```bash # Run tests pnpm test ``` -------------------------------- ### Get Per-Website Analytics Data Source: https://context7.com/lindoai/lindoai-js/llms.txt Returns traffic and performance metrics scoped to a specific website, with date range filtering. ```typescript const stats = await client.analytics.getWebsite({ website_id: 'ws_abc123', from: '2025-01-01', to: '2025-03-31', }); console.log('Total requests:', stats.total_requests); console.log('Unique visitors:', stats.total_visitors); ``` -------------------------------- ### client.workspace.get / update Source: https://context7.com/lindoai/lindoai-js/llms.txt Fetches full workspace details or updates workspace name, language, and webhook URL. ```APIDOC ## client.workspace.get / update — Workspace Details and Settings ### Description Fetches full workspace details or updates workspace name, language, and webhook URL. ### Fetch Workspace Details #### Method ```typescript const details = await client.workspace.get(); ``` ### Update Workspace Details #### Method ```typescript const update = await client.workspace.update({ workspace_name: 'Acme AI Studio', workspace_language: 'en', webhook_url: 'https://acme.com/api/lindo-webhook' }); ``` ### Example Usage ```typescript // Fetch const details = await client.workspace.get(); console.log(details.result.workspace_name); console.log(details.result.plan); console.log(details.result.whitelabel.enabled); console.log(details.result.appearance.primary_color); // Update const update = await client.workspace.update({ workspace_name: 'Acme AI Studio', workspace_language: 'en', webhook_url: 'https://acme.com/api/lindo-webhook' }); console.log(update.result.message); // "Workspace updated" ``` ``` -------------------------------- ### client.workspace.updateAppearance Source: https://context7.com/lindoai/lindoai-js/llms.txt Sets the workspace's primary/secondary colors, theme mode, and global header/footer code. ```APIDOC ## client.workspace.updateAppearance — Workspace Visual Branding ### Description Sets the workspace's primary/secondary colors, theme mode, and global header/footer code. ### Method ```typescript const appearance = await client.workspace.updateAppearance({ primary_color: '#4F46E5', secondary_color: '#818CF8', theme_mode: 'light', custom_code_header: ' ', custom_code_footer: '' }); ``` ### Parameters #### Request Body - **primary_color** (string) - Required - The primary color for the workspace. - **secondary_color** (string) - Required - The secondary color for the workspace. - **theme_mode** (string) - Required - The theme mode ('light' or 'dark'). - **custom_code_header** (string) - Optional - Custom HTML code to be included in the header. - **custom_code_footer** (string) - Optional - Custom HTML code to be included in the footer. ### Example Usage ```typescript const appearance = await client.workspace.updateAppearance({ primary_color: '#4F46E5', secondary_color: '#818CF8', theme_mode: 'light', custom_code_header: ' ', custom_code_footer: '' }); console.log(appearance.result.appearance.primary_color); // "#4F46E5" ``` ``` -------------------------------- ### Analytics - Get Website Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Access analytics data for a specific website. You can specify a date range to retrieve data for a specific period. ```APIDOC ## Analytics - Get Website ### Description Access analytics data for a specific website. You can specify a date range to retrieve data for a specific period. ### Method `client.analytics.getWebsite(params: { from: string; to: string })` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **from** (string) - Required - The start date for the analytics data (YYYY-MM-DD). - **to** (string) - Required - The end date for the analytics data (YYYY-MM-DD). ### Request Example ```typescript const websiteAnalytics = await client.analytics.getWebsite({ from: '2024-01-01', to: '2024-01-31', }); ``` ### Response #### Success Response (200) - **top_pages** (Array) - An array of objects, each representing a top page with its metrics. #### Response Example ```json { "top_pages": [ { "url": "/home", "views": 1000 }, { "url": "/about", "views": 500 } ] } ``` ``` -------------------------------- ### Get Workspace Analytics Data Source: https://context7.com/lindoai/lindoai-js/llms.txt Retrieves aggregate traffic, visitor, and content metrics for the entire workspace, with options for date filtering. ```typescript // All-time const all = await client.analytics.getWorkspace(); console.log('Total requests:', all.total_requests); console.log('Unique visitors:', all.total_visitors); console.log('Avg response time:', all.avg_response_time, 'ms'); // Date-filtered const jan = await client.analytics.getWorkspace({ from: '2025-01-01', to: '2025-01-31' }); console.log('January pages:', jan.total_pages); ``` -------------------------------- ### Upload Media Files (Single and Batch) Source: https://context7.com/lindoai/lindoai-js/llms.txt This snippet shows how to upload media files to your website's CDN. It supports both single file uploads and batch uploads of up to 20 files. Files must be base64-encoded. Ensure the correct website ID is provided. ```typescript import * as fs from 'fs'; // Single upload const b64 = fs.readFileSync('./hero.jpg').toString('base64'); const result = await client.media.upload('ws_abc123', { file_base64: `data:image/jpeg;base64,${b64}`, file_name: 'hero.jpg', media_type: 'images', }); console.log('CDN URL:', result.result.url); // "https://cdn.lindo.ai/ws_abc123/images/hero.jpg" // Batch upload (max 20 files) const batch = await client.media.uploadBatch('ws_abc123', { files: [ { file_base64: `data:image/jpeg;base64,${b64}`, file_name: 'hero.jpg', media_type: 'images' }, { file_base64: `data:image/png;base64,${fs.readFileSync('./logo.png').toString('base64')}`, file_name: 'logo.png' }, ], }); console.log(`Uploaded ${batch.result.successful} of ${batch.result.total} files`); batch.result.uploaded.forEach(f => { if (f.success) console.log(f.url); else console.error(`${f.file_name}: ${f.error}`); }); ``` -------------------------------- ### Get Workspace Analytics Source: https://github.com/lindoai/lindoai-js/blob/main/README.md Fetch workspace analytics data, including total views and unique visitors, within a specified date range. ```typescript // Get workspace analytics const workspaceAnalytics = await client.analytics.getWorkspace({ from: '2024-01-01', // Optional to: '2024-01-31', // Optional }); console.log(workspaceAnalytics.total_views); console.log(workspaceAnalytics.unique_visitors); ``` -------------------------------- ### client.clients.create / list / update / delete Source: https://context7.com/lindoai/lindoai-js/llms.txt Provides full CRUD operations for workspace clients. ```APIDOC ## client.clients.create / list / update / delete — Client Management ### Description Full CRUD for workspace clients (end-users managed under your workspace API key). ### Create Client #### Method ```typescript const created = await client.clients.create({ email: 'alice@example.com', website_limit: 5 }); ``` ### List Clients #### Method ```typescript const list = await client.clients.list({ page: 1, search: 'alice' }); ``` ### Update Client #### Method ```typescript await client.clients.update({ client_id: clientId, website_limit: 10, suspended: false }); ``` ### Delete Client #### Method ```typescript const del = await client.clients.delete(clientId); ``` ### Parameters #### create - **email** (string) - Required - The email address of the client. - **website_limit** (number) - Optional - The limit of websites allowed for the client. #### list - **page** (number) - Optional - The page number for pagination. - **search** (string) - Optional - Search term for filtering clients. #### update - **client_id** (string) - Required - The ID of the client to update. - **website_limit** (number) - Optional - The new website limit. - **suspended** (boolean) - Optional - Whether to suspend the client. #### delete - **clientId** (string) - Required - The ID of the client to delete. ### Example Usage ```typescript // Create const created = await client.clients.create({ email: 'alice@example.com', website_limit: 5 }); const clientId = created.result?.client_id!; console.log('Client ID:', clientId); // List (paginated + search) const list = await client.clients.list({ page: 1, search: 'alice' }); list.result.list.forEach(c => console.log(c.email, c.website_limit)); // Update await client.clients.update({ client_id: clientId, website_limit: 10, suspended: false }); // Delete const del = await client.clients.delete(clientId); console.log(del.success); // true ``` ### Response Example (Create) ```json { "result": { "client_id": "cl_abc123" } } ``` ### Response Example (List) ```json { "result": { "list": [ { "client_id": "cl_abc123", "email": "alice@example.com", "website_limit": 5 } ] } } ``` ### Response Example (Update) ```json { "result": { "message": "Client updated successfully" } } ``` ### Response Example (Delete) ```json { "success": true } ``` ``` -------------------------------- ### client.pages.list, get, update, unpublish, deletePage Source: https://context7.com/lindoai/lindoai-js/llms.txt Provides full lifecycle management for individual pages within a website, including listing, retrieval, updating, unpublishing, and deletion. ```APIDOC ## client.pages.list / get / update / unpublish / deletePage — Page Management Full lifecycle management for individual pages within a website. ### List Pages #### Method client.pages.list #### Parameters #### Path Parameters - **website_id** (string) - Required - The ID of the website. #### Query Parameters - **search** (string) - Optional - A search term to filter pages. ### Get Page #### Method client.pages.get #### Parameters #### Path Parameters - **website_id** (string) - Required - The ID of the website. - **page_id** (string) - Required - The ID of the page. ### Update Page #### Method client.pages.update #### Parameters #### Path Parameters - **website_id** (string) - Required - The ID of the website. - **page_id** (string) - Required - The ID of the page to update. #### Request Body - **name** (string) - Optional - The name of the page. - **language** (string) - Optional - The language of the page. - **seo** (object) - Optional - SEO settings for the page. - **title** (string) - Optional - The SEO title. - **publish_date** (string) - Optional - The publish date of the page. ### Unpublish Page #### Method client.pages.unpublish #### Parameters #### Path Parameters - **website_id** (string) - Required - The ID of the website. - **page_id** (string) - Required - The ID of the page to unpublish. ### Delete Page #### Method client.pages.deletePage #### Parameters #### Path Parameters - **website_id** (string) - Required - The ID of the website. - **page_id** (string) - Required - The ID of the page to delete. ### Request Example ```typescript // List pages const pages = await client.pages.list('ws_abc123', { search: 'about' }); pages.result.list.forEach(p => console.log(p.page_id, p.path, p.status)); // Get details const page = await client.pages.get('ws_abc123', 'pg_456'); console.log(page.result.seo.title); console.log(page.result.publish_date); // Update metadata await client.pages.update('ws_abc123', 'pg_456', { name: 'About Our Team', language: 'en', seo: { title: 'About Us | Bean There Coffee' }, }); // Unpublish await client.pages.unpublish('ws_abc123', 'pg_456'); // Delete await client.pages.deletePage('ws_abc123', 'pg_456'); ``` ### Response (List Pages) #### Success Response - **list** (array) - An array of page objects. - **page_id** (string) - The ID of the page. - **path** (string) - The path of the page. - **status** (string) - The status of the page. ### Response (Get Page) #### Success Response - **seo** (object) - SEO settings for the page. - **title** (string) - The SEO title. - **publish_date** (string) - The publish date of the page. ``` -------------------------------- ### Batch Create Websites with AI Source: https://context7.com/lindoai/lindoai-js/llms.txt Initiates up to 25 website creation workflows in a single API call. Returns a batch object with success counts and individual record IDs for polling. ```typescript const batch = await client.workflows.batchCreateWebsites([ { prompt: 'Bakery website for Sunrise Pastries with home, menu, and order pages' }, { prompt: 'Photography portfolio for Alex Rivera, landscape and portrait galleries' }, { prompt: 'Plumbing services site for QuickFix Plumbing, services and contact pages' }, ]); console.log(`Accepted: ${batch.succeeded} / ${batch.total}`); // Poll all at once const ids = batch.items.filter(i => i.success).map(i => i.record_id!); const batchStatus = await client.workflows.batchCheckWebsiteStatus(ids); console.log('Batch status:', batchStatus.status); // "running" | "complete" | "partial" | "errored" console.log('Summary:', batchStatus.summary); // { total: 3, complete: 1, running: 2, ... } if (!batchStatus.done) { await new Promise(r => setTimeout(r, batchStatus.poll_after_ms ?? 5000)); } ``` -------------------------------- ### Batch AI Page & Blog Creation Source: https://context7.com/lindoai/lindoai-js/llms.txt Initiates up to 25 page or blog creation workflows for a single website in one request. Provides batch status checking. ```APIDOC ## client.workflows.batchCreatePages / batchCreateBlogs ### Description Starts up to 25 page or blog creation workflows on a single website in one request. ### Method - `batchCreatePages(websiteId: string, pages: Array<{ prompt: string }>)` - `batchCreateBlogs(websiteId: string, blogs: Array<{ prompt: string, schedule_at?: string }>)` ### Parameters #### Path Parameters - **websiteId** (string) - Required - The ID of the website to add the pages or blogs to. #### Request Body (for `batchCreatePages`) - **pages** (Array) - Required - An array of page creation requests. - **prompt** (string) - Required - The plain-language description for each page. #### Request Body (for `batchCreateBlogs`) - **blogs** (Array) - Required - An array of blog creation requests. - **prompt** (string) - Required - The plain-language description for each blog post. - **schedule_at** (string) - Optional - ISO 8601 timestamp for when to publish the blog post. ### Response #### Success Response (for both) - **items** (Array) - Details for each submitted workflow. - **success** (boolean) - Indicates if the workflow was accepted. - **record_id** (string) - Optional - The ID for polling status if successful. ### Request Example ```typescript // Batch pages const pageBatch = await client.workflows.batchCreatePages('ws_abc123', [ { prompt: 'Team page showcasing 6 engineers with bios' }, { prompt: 'Pricing page with 3 tiers: Starter, Pro, Enterprise' }, ]); const pageIds = pageBatch.items.filter(i => i.success).map(i => i.record_id!) const pageStatus = await client.workflows.batchCheckPageStatus(pageIds); console.log(pageStatus.summary); // Batch blogs const blogBatch = await client.workflows.batchCreateBlogs('ws_abc123', [ { prompt: 'Post: How AI is transforming small business websites' }, { prompt: 'Post: 10 SEO tips for local businesses in 2025' }, ]); const blogIds = blogBatch.items.filter(i => i.success).map(i => i.record_id!) const blogStatus = await client.workflows.batchCheckBlogStatus(blogIds); console.log(blogStatus.status); ``` ``` -------------------------------- ### AI Website Creation Source: https://context7.com/lindoai/lindoai-js/llms.txt Initiates an AI workflow to generate a complete website from a text prompt. Returns a record ID for status polling. ```APIDOC ## client.workflows.createWebsite ### Description Starts an AI workflow that generates a full website from a plain-language prompt. Returns a `record_id` immediately; poll `getWebsiteStatus` until `done` is `true`. ### Method `createWebsite(options: { prompt: string, client: { email: string, name: string }, schedule_at?: string })` ### Parameters #### Request Body - **prompt** (string) - Required - The plain-language description for the website. - **client** (object) - Required - Information about the client. - **email** (string) - Required - The client's email address. - **name** (string) - Required - The client's name. - **schedule_at** (string) - Optional - ISO 8601 timestamp for when to start the workflow. ### Response #### Success Response - **record_id** (string) - The ID to use for polling the status. ### Request Example ```typescript const { record_id } = await client.workflows.createWebsite({ prompt: 'Create a professional website for a coffee shop called Bean There with home, menu, and contact pages', client: { email: 'owner@beanthere.coffee', name: 'Bean There Coffee' }, schedule_at: '2025-07-01T10:00:00Z', // optional }); // Poll until complete let status; do { status = await client.workflows.getWebsiteStatus(record_id); if (!status.done) { console.log(status.message); await new Promise(r => setTimeout(r, status.poll_after_ms ?? 5000)); } } while (!status.done); if (status.status === 'complete') { console.log('Website ID:', status.result?.website_id); status.result?.pages.forEach(p => console.log(p.path, p.status)); } else { console.error('Error:', status.error); } ``` ```