{
  "scopes": [
    "products:read",
    "products:write",
    "collections:read",
    "collections:write",
    "tags:read",
    "tags:write",
    "website:read",
    "media:read",
    "media:write",
    "workspace:read",
    "workspace:write",
    "website:write",
    "account:read",
    "account:write",
    "workspaces:read",
    "workspaces:write",
    "storefront:read",
    "visitors:read",
    "visitors:write",
    "ai:write"
  ],
  "customerExperience": [
    {
      "name": "storefront_bootstrap",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/experience/bootstrap",
      "scope": "storefront:read",
      "description": "Bootstrap visitor access, guest token and Turnstile configuration.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_products",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/experience/products",
      "scope": "storefront:read",
      "description": "Read published catalogue data subject to visitor access policy.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_products_productId",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/experience/products/{productId}",
      "scope": "storefront:read",
      "description": "Read published catalogue data subject to visitor access policy.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_products_productId_questions",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/experience/products/{productId}/questions",
      "scope": "storefront:read",
      "description": "Read published catalogue data subject to visitor access policy.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_products_slug_productSlug",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/experience/products/slug/{productSlug}",
      "scope": "storefront:read",
      "description": "Read published catalogue data subject to visitor access policy.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_collections",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/experience/collections",
      "scope": "storefront:read",
      "description": "Read published catalogue data subject to visitor access policy.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_collections_collectionId_products",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/experience/collections/{collectionId}/products",
      "scope": "storefront:read",
      "description": "Read published catalogue data subject to visitor access policy.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_tags",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/experience/tags",
      "scope": "storefront:read",
      "description": "Read published catalogue data subject to visitor access policy.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_tags_tagId_products",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/experience/tags/{tagId}/products",
      "scope": "storefront:read",
      "description": "Read published catalogue data subject to visitor access policy.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_tags_tagId_collections",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/experience/tags/{tagId}/collections",
      "scope": "storefront:read",
      "description": "Read published catalogue data subject to visitor access policy.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "customer_otp_request",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/experience/customer/otp/request",
      "scope": "visitors:write",
      "description": "Request a customer email code. Turnstile, email validation and resend limits apply.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "turnstileToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          }
        },
        "required": [
          "name",
          "email"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "customer_otp_verify",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/experience/customer/otp/verify",
      "scope": "visitors:write",
      "description": "Verify a one-use customer code and receive a tenant-scoped visitor session. Never a management session.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "email",
          "code"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "customer_session",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/experience/customer/session",
      "scope": "visitors:read",
      "description": "Read current visitor session status. Supply X-Visitor-Token.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "customer_refresh",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/experience/customer/refresh",
      "scope": "visitors:write",
      "description": "Renew an active tenant visitor session. Supply X-Visitor-Token.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "customer_logout",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/experience/customer/logout",
      "scope": "visitors:write",
      "description": "Revoke the current visitor session. Supply X-Visitor-Token.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "customer_profile",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/experience/customer/profile",
      "scope": "visitors:read",
      "description": "Read only the visitor public profile fields. Supply X-Visitor-Token.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "customer_profile_update",
      "method": "PUT",
      "path": "/v1/workspaces/{workspaceId}/experience/customer/profile",
      "scope": "visitors:write",
      "description": "Update visitor name, phone and language. Email must remain unchanged; account email changes require account sign-in.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "maxLength": 24
          }
        },
        "required": [
          "name",
          "email"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_ai_product",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/experience/chat/product",
      "scope": "ai:write",
      "description": "Run product AI with visitor access, Turnstile, quotas and atomic workspace credit reservations. Uses real credits.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "maxLength": 100000
          },
          "productId": {
            "type": "string"
          },
          "productName": {
            "type": "string"
          },
          "threadId": {
            "type": "string",
            "maxLength": 100
          },
          "thinkingLevel": {
            "type": "string",
            "enum": [
              "LOW",
              "HIGH"
            ]
          },
          "images": {
            "maxItems": 12,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "turnstileToken": {
            "type": "string"
          },
          "userProfile": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "userSelectedRoutineProducts": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "allowAiSuggestions": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_ai_routine",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/experience/chat/routine",
      "scope": "ai:write",
      "description": "Run routine AI with visitor access, Turnstile, quotas and atomic workspace credit reservations. Uses real credits.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "maxLength": 100000
          },
          "productId": {
            "type": "string"
          },
          "productName": {
            "type": "string"
          },
          "threadId": {
            "type": "string",
            "maxLength": 100
          },
          "thinkingLevel": {
            "type": "string",
            "enum": [
              "LOW",
              "HIGH"
            ]
          },
          "images": {
            "maxItems": 12,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "turnstileToken": {
            "type": "string"
          },
          "userProfile": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "userSelectedRoutineProducts": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "allowAiSuggestions": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_ai_analyze_face",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/experience/chat/analyze-face",
      "scope": "ai:write",
      "description": "Run analyze-face AI with visitor access, Turnstile, quotas and atomic workspace credit reservations. Uses real credits.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "image": {
            "type": "string",
            "minLength": 1
          },
          "turnstileToken": {
            "type": "string"
          }
        },
        "required": [
          "image"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_thread_delete",
      "method": "DELETE",
      "path": "/v1/workspaces/{workspaceId}/experience/threads/{threadId}",
      "scope": "visitors:write",
      "description": "Delete only a conversation signed for this workspace and visitor.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_feedback",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/experience/feedback",
      "scope": "visitors:write",
      "description": "Submit visitor feedback using the same validated hosted-site contract.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "required": [
          "message"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "storefront_event",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/experience/events",
      "scope": "visitors:write",
      "description": "Record an allowed visitor analytics event. Server validation and actor attribution apply.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "eventName": {
            "type": "string",
            "enum": [
              "WEBSITE_VISIT",
              "PRODUCT_VIEW",
              "CONTACT_CLICK",
              "BUY_CLICK",
              "PHONE_CLICK",
              "DIRECTION_CLICK",
              "CUSTOMER_SIGNUP"
            ]
          },
          "productId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "source": {
            "type": "string",
            "maxLength": 64
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "eventName"
        ],
        "additionalProperties": false
      }
    }
  ],
  "operations": [
    {
      "name": "list_products",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/products",
      "target": "workspace",
      "scope": "products:read",
      "description": "List all products, including inactive products, with pagination, search, and status filters.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "query": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean"
              ]
            }
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "query",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_product",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/products/{id}",
      "target": "workspace",
      "scope": "products:read",
      "description": "Fetch one product owned by this workspace, including inactive products.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "create_product",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/products",
      "target": "workspace",
      "scope": "products:write",
      "description": "Create a product. Data: name, brand, sku, barcode, stock, status (ACTIVE/INACTIVE/DELETED), description, information, imageIds, tagIds, sales. Existing business validation applies.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              "brand": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              },
              "sku": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              },
              "barcode": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              },
              "stock": {
                "type": "integer",
                "minimum": 0,
                "maximum": 999999
              },
              "status": {
                "type": "string",
                "enum": [
                  "ACTIVE",
                  "INACTIVE",
                  "DELETED"
                ]
              },
              "description": {
                "default": "",
                "type": "string",
                "maxLength": 100000
              },
              "information": {
                "type": "string",
                "maxLength": 500000
              },
              "questionIds": {
                "minItems": 0,
                "maxItems": 5,
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              "imageIds": {
                "default": [],
                "description": "Uploaded image identifiers in gallery order. Only the first five unique images are retained.",
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                }
              },
              "tagIds": {
                "default": [],
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                }
              },
              "sales": {
                "default": [],
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "link": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "name",
                    "link"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "name",
              "brand",
              "sku",
              "barcode",
              "stock",
              "status",
              "description",
              "information",
              "imageIds",
              "tagIds",
              "sales"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "update_product",
      "method": "PUT",
      "path": "/v1/workspaces/{workspaceId}/products/{id}",
      "target": "workspace",
      "scope": "products:write",
      "description": "Update a product using its current full editable values; read it first. Same data fields as create_product.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "data": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              "brand": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              },
              "sku": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              },
              "barcode": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              },
              "stock": {
                "type": "integer",
                "minimum": 0,
                "maximum": 999999
              },
              "status": {
                "type": "string",
                "enum": [
                  "ACTIVE",
                  "INACTIVE",
                  "DELETED"
                ]
              },
              "description": {
                "default": "",
                "type": "string",
                "maxLength": 100000
              },
              "information": {
                "type": "string",
                "maxLength": 500000
              },
              "questionIds": {
                "minItems": 0,
                "maxItems": 5,
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              "imageIds": {
                "default": [],
                "description": "Uploaded image identifiers in gallery order. Only the first five unique images are retained.",
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                }
              },
              "tagIds": {
                "default": [],
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                }
              },
              "sales": {
                "default": [],
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "link": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "name",
                    "link"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "name",
              "brand",
              "sku",
              "barcode",
              "stock",
              "status",
              "description",
              "information",
              "imageIds",
              "tagIds",
              "sales"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "delete_product",
      "method": "DELETE",
      "path": "/v1/workspaces/{workspaceId}/products/{id}",
      "target": "workspace",
      "scope": "products:write",
      "description": "Permanently delete a product and its associations.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "list_collections",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/collections",
      "target": "workspace",
      "scope": "collections:read",
      "description": "List collections with pagination and search.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "query": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean"
              ]
            }
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "query",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "create_collection",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/collections",
      "target": "workspace",
      "scope": "collections:write",
      "description": "Create collection. Data: name, description, tagIds, imageId. Add products with add_collection_product.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "description": {
                "default": "",
                "type": "string",
                "maxLength": 100000
              },
              "imageId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tagIds": {
                "default": [],
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                }
              }
            },
            "required": [
              "name",
              "description",
              "tagIds"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "update_collection",
      "method": "PUT",
      "path": "/v1/workspaces/{workspaceId}/collections/{id}",
      "target": "workspace",
      "scope": "collections:write",
      "description": "Update collection with its full editable values.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "data": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "description": {
                "default": "",
                "type": "string",
                "maxLength": 100000
              },
              "imageId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tagIds": {
                "default": [],
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                }
              }
            },
            "required": [
              "name",
              "description",
              "tagIds"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "delete_collection",
      "method": "DELETE",
      "path": "/v1/workspaces/{workspaceId}/collections/{id}",
      "target": "workspace",
      "scope": "collections:write",
      "description": "Permanently delete collection.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "list_tags",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/tags",
      "target": "workspace",
      "scope": "tags:read",
      "description": "List tags with pagination and search.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "query": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean"
              ]
            }
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "query",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "create_tag",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/tags",
      "target": "workspace",
      "scope": "tags:write",
      "description": "Create tag. Data: name.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "update_tag",
      "method": "PUT",
      "path": "/v1/workspaces/{workspaceId}/tags/{id}",
      "target": "workspace",
      "scope": "tags:write",
      "description": "Update tag with its full editable values.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "data": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "delete_tag",
      "method": "DELETE",
      "path": "/v1/workspaces/{workspaceId}/tags/{id}",
      "target": "workspace",
      "scope": "tags:write",
      "description": "Permanently delete tag.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_collection",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/collections/{id}",
      "target": "workspace",
      "scope": "collections:read",
      "description": "Fetch one collection including its product and tag associations.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_tag",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/tags/{id}",
      "target": "workspace",
      "scope": "tags:read",
      "description": "Fetch one tag.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "list_templates",
      "method": "GET",
      "path": "/v1/templates",
      "target": "account",
      "scope": "website:read",
      "description": "List supported website template keys.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "list_collection_products",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/collections/{id}/products",
      "target": "workspace",
      "scope": "collections:read",
      "description": "List products in a collection.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "query": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean"
              ]
            }
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "query",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "add_collection_product",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/collections/{id}/products/{productId}",
      "target": "workspace",
      "scope": "collections:write",
      "description": "add a workspace product in a workspace collection.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "productId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "productId",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "add_product_tag",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/products/{id}/tags/{tagId}",
      "target": "workspace",
      "scope": "products:write",
      "description": "add a workspace tag on a workspace product.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "tagId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "tagId",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "add_collection_tag",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/collections/{id}/tags/{tagId}",
      "target": "workspace",
      "scope": "collections:write",
      "description": "add a workspace tag on a workspace collection.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "tagId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "tagId",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "remove_collection_product",
      "method": "DELETE",
      "path": "/v1/workspaces/{workspaceId}/collections/{id}/products/{productId}",
      "target": "workspace",
      "scope": "collections:write",
      "description": "remove a workspace product in a workspace collection.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "productId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "productId",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "remove_product_tag",
      "method": "DELETE",
      "path": "/v1/workspaces/{workspaceId}/products/{id}/tags/{tagId}",
      "target": "workspace",
      "scope": "products:write",
      "description": "remove a workspace tag on a workspace product.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "tagId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "tagId",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "remove_collection_tag",
      "method": "DELETE",
      "path": "/v1/workspaces/{workspaceId}/collections/{id}/tags/{tagId}",
      "target": "workspace",
      "scope": "collections:write",
      "description": "remove a workspace tag on a workspace collection.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "tagId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "tagId",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "list_media",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/media",
      "target": "workspace",
      "scope": "media:read",
      "description": "List uploaded images with pagination, usage, and search.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "query": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean"
              ]
            }
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "query",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_media",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/media/{id}",
      "target": "workspace",
      "scope": "media:read",
      "description": "Fetch uploaded media metadata.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "upload_media",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/media",
      "target": "workspace",
      "scope": "media:write",
      "description": "Upload an image as base64 (maximum 3 MiB decoded). Returns media id for imageIds fields. REST also supports multipart upload at /v1/media/upload.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "mimeType": {
            "type": "string",
            "enum": [
              "image/jpeg",
              "image/png",
              "image/webp",
              "image/gif",
              "image/avif"
            ]
          },
          "base64": {
            "type": "string",
            "minLength": 4,
            "maxLength": 4194304
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "fileName",
          "mimeType",
          "base64",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "replace_media",
      "method": "PUT",
      "path": "/v1/workspaces/{workspaceId}/media/{id}",
      "target": "workspace",
      "scope": "media:write",
      "description": "Replace an uploaded image while retaining its media id.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "mimeType": {
            "type": "string",
            "enum": [
              "image/jpeg",
              "image/png",
              "image/webp",
              "image/gif",
              "image/avif"
            ]
          },
          "base64": {
            "type": "string",
            "minLength": 4,
            "maxLength": 4194304
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "fileName",
          "mimeType",
          "base64",
          "id",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "delete_media",
      "method": "DELETE",
      "path": "/v1/workspaces/{workspaceId}/media/{id}",
      "target": "workspace",
      "scope": "media:write",
      "description": "Delete uploaded media and remove its references.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_workspace",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/workspace",
      "target": "workspace",
      "scope": "workspace:read",
      "description": "Read the selected workspace profile, business contact information and agent instructions.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "update_workspace",
      "method": "PUT",
      "path": "/v1/workspaces/{workspaceId}/workspace",
      "target": "workspace",
      "scope": "workspace:write",
      "description": "Update workspace profile fields: name, subDomain, billingEmail, billingPhone, billingGsmCountryCode, isVisible and mainAgentPrompt. Billing email changes require an existing verification code; subdomain validation/cooldowns apply. Ownership, wallet and access policy are not delegated.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 2,
                "maxLength": 80
              },
              "subDomain": {
                "type": "string",
                "minLength": 3,
                "maxLength": 32,
                "pattern": "^(?!-)[a-z0-9-]+(?<!-)$"
              },
              "billingEmail": {
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              "billingEmailOtpCode": {
                "type": "string",
                "pattern": "^\\d{6}$"
              },
              "billingPhone": {
                "type": "string",
                "maxLength": 40
              },
              "billingGsmCountryCode": {
                "type": "string"
              },
              "isVisible": {
                "default": true,
                "type": "boolean"
              },
              "mainAgentPrompt": {
                "default": "",
                "type": "string",
                "maxLength": 6000
              },
              "aiFastEnabled": {
                "type": "boolean"
              },
              "aiComprehensiveEnabled": {
                "type": "boolean"
              },
              "chatIdleTimeoutMinutes": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_website",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/website/{templateKey}",
      "target": "workspace",
      "scope": "website:read",
      "description": "Read editable website content, theme, assets, translations, template layout and its JSON schema. Read this before updating.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "templateKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "templateKey",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "update_website",
      "method": "PUT",
      "path": "/v1/workspaces/{workspaceId}/website/{templateKey}",
      "target": "workspace",
      "scope": "website:write",
      "description": "Update editable website configuration. Use the editable object and editorSchema returned by get_website; readonly meta/template fields are excluded. Partial website updates are supported. Existing template validation applies.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "templateKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "data": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "templateKey",
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_account",
      "method": "GET",
      "path": "/v1/account",
      "target": "account",
      "scope": "account:read",
      "description": "Read your account profile and workspace creation limit.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "update_account",
      "method": "PUT",
      "path": "/v1/account",
      "target": "account",
      "scope": "account:write",
      "description": "Update your profile. Read it first. Email changes require an email verification code obtained in the dashboard. Roles, verification and workspace limits cannot be changed.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "email": {
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              "emailOtpCode": {
                "type": "string",
                "pattern": "^\\d{6}$"
              },
              "phone": {
                "type": "string",
                "maxLength": 40
              },
              "language": {
                "default": "",
                "type": "string",
                "maxLength": 24
              }
            },
            "required": [
              "name",
              "email",
              "phone",
              "language"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "list_workspaces",
      "method": "GET",
      "path": "/v1/workspaces",
      "target": "account",
      "scope": "workspaces:read",
      "description": "List your active owned workspaces and creation limit. Use a workspace ID returned here for subsequent workspace tools.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "query": {
            "default": {
              "page": 1,
              "pageSize": 25
            },
            "type": "object",
            "properties": {
              "page": {
                "default": 1,
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "pageSize": {
                "default": 25,
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              }
            },
            "required": [
              "page",
              "pageSize"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "query"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "create_workspace",
      "method": "POST",
      "path": "/v1/workspaces",
      "target": "account",
      "scope": "workspaces:write",
      "description": "Create a workspace for the account with zero credits, subject to the administrator-configured ownership limit. Choose a template from list_templates. Customized websites require a phone number and notify the team.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 2,
                "maxLength": 80
              },
              "subDomain": {
                "type": "string",
                "minLength": 3,
                "maxLength": 32,
                "pattern": "^(?!-)[a-z0-9-]+(?<!-)$"
              },
              "templateKey": {
                "type": "string",
                "enum": [
                  "beauty-v1",
                  "beauty-v3",
                  "beauty-v4",
                  "textile-v1",
                  "customized"
                ]
              },
              "phone": {
                "type": "string",
                "maxLength": 40
              },
              "isVisible": {
                "default": true,
                "type": "boolean"
              },
              "mainAgentPrompt": {
                "default": "",
                "type": "string",
                "maxLength": 6000
              }
            },
            "required": [
              "name",
              "subDomain",
              "templateKey",
              "isVisible",
              "mainAgentPrompt"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "list_feedbacks",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/feedbacks",
      "target": "workspace",
      "scope": "workspace:read",
      "description": "List workspace feedback with pagination, search, visitor and date filters.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "query": {
            "default": {
              "page": 1,
              "pageSize": 25,
              "search": "",
              "visitor": "ALL",
              "sortDirection": "desc"
            },
            "type": "object",
            "properties": {
              "page": {
                "default": 1,
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "pageSize": {
                "default": 25,
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "search": {
                "default": "",
                "type": "string",
                "maxLength": 200
              },
              "workspaceId": {
                "type": "string",
                "maxLength": 160
              },
              "userId": {
                "type": "string",
                "maxLength": 160
              },
              "visitor": {
                "default": "ALL",
                "type": "string",
                "enum": [
                  "ALL",
                  "GUEST",
                  "USER"
                ]
              },
              "from": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "to": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "sortDirection": {
                "default": "desc",
                "type": "string",
                "enum": [
                  "asc",
                  "desc"
                ]
              }
            },
            "required": [
              "page",
              "pageSize",
              "search",
              "visitor",
              "sortDirection"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "query",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_ai_settings",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/ai-settings",
      "target": "workspace",
      "scope": "workspace:read",
      "description": "Get enabled AI levels and sector.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "update_ai_settings",
      "method": "PUT",
      "path": "/v1/workspaces/{workspaceId}/ai-settings",
      "target": "workspace",
      "scope": "workspace:write",
      "description": "Set AI levels. At least one level must remain enabled.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "chatIdleTimeoutMinutes": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "fastEnabled": {
                "type": "boolean"
              },
              "comprehensiveEnabled": {
                "type": "boolean"
              },
              "sector": {
                "default": "AUTO",
                "type": "string",
                "enum": [
                  "AUTO",
                  "GENERAL",
                  "BEAUTY",
                  "TEXTILE"
                ]
              }
            },
            "required": [
              "fastEnabled",
              "comprehensiveEnabled",
              "sector"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "list_product_questions",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/questions",
      "target": "workspace",
      "scope": "products:read",
      "description": "List reusable workspace questions.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "create_product_question",
      "method": "POST",
      "path": "/v1/workspaces/{workspaceId}/questions",
      "target": "workspace",
      "scope": "products:write",
      "description": "Create a reusable product question.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 240
              }
            },
            "required": [
              "text"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "update_product_question",
      "method": "PUT",
      "path": "/v1/workspaces/{workspaceId}/questions/{id}",
      "target": "workspace",
      "scope": "products:write",
      "description": "Edit a reusable question in every assigned product.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "data": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 240
              }
            },
            "required": [
              "text"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "delete_product_question",
      "method": "DELETE",
      "path": "/v1/workspaces/{workspaceId}/questions/{id}",
      "target": "workspace",
      "scope": "products:write",
      "description": "Remove a reusable question and its assignments.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_product_questions",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/products/{id}/questions",
      "target": "workspace",
      "scope": "products:read",
      "description": "Get the ordered selection, an intentional empty list, or three template defaults.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "assign_product_questions",
      "method": "PUT",
      "path": "/v1/workspaces/{workspaceId}/products/{id}/questions",
      "target": "workspace",
      "scope": "products:write",
      "description": "Assign zero to five workspace question IDs in product-specific order. An empty list hides initial questions.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "data": {
            "type": "object",
            "properties": {
              "questionIds": {
                "minItems": 0,
                "maxItems": 5,
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              }
            },
            "required": [
              "questionIds"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "reset_product_questions",
      "method": "DELETE",
      "path": "/v1/workspaces/{workspaceId}/products/{id}/questions",
      "target": "workspace",
      "scope": "products:write",
      "description": "Restore the three template defaults for this product.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "id",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "list_usage_report",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/usage-report",
      "target": "workspace",
      "scope": "workspace:read",
      "description": "Read paginated per-user usage, AI credits, models and activity, with date/search/actor filters.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "query": {
            "default": {
              "page": 1,
              "pageSize": 25,
              "search": "",
              "actorType": "ALL",
              "sortBy": "credits",
              "sortDirection": "desc"
            },
            "type": "object",
            "properties": {
              "page": {
                "default": 1,
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "pageSize": {
                "default": 25,
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "search": {
                "default": "",
                "type": "string",
                "maxLength": 200
              },
              "actorType": {
                "default": "ALL",
                "type": "string",
                "enum": [
                  "ALL",
                  "AUTH_USER",
                  "WORKSPACE_USER",
                  "WORKSPACE_KIOSK_DEVICE",
                  "GUEST"
                ]
              },
              "from": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "to": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "userId": {
                "type": "string",
                "maxLength": 160
              },
              "sortBy": {
                "default": "credits",
                "type": "string",
                "enum": [
                  "credits",
                  "requests",
                  "lastUsedAt",
                  "name"
                ]
              },
              "sortDirection": {
                "default": "desc",
                "type": "string",
                "enum": [
                  "asc",
                  "desc"
                ]
              }
            },
            "required": [
              "page",
              "pageSize",
              "search",
              "actorType",
              "sortBy",
              "sortDirection"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "query",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "list_usage_events",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/usage-report/events",
      "target": "workspace",
      "scope": "workspace:read",
      "description": "Read paginated activity events filtered by user/date/actor without internal session or network metadata.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "query": {
            "default": {
              "page": 1,
              "pageSize": 25,
              "search": "",
              "actorType": "ALL",
              "sortBy": "credits",
              "sortDirection": "desc"
            },
            "type": "object",
            "properties": {
              "page": {
                "default": 1,
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "pageSize": {
                "default": 25,
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "search": {
                "default": "",
                "type": "string",
                "maxLength": 200
              },
              "actorType": {
                "default": "ALL",
                "type": "string",
                "enum": [
                  "ALL",
                  "AUTH_USER",
                  "WORKSPACE_USER",
                  "WORKSPACE_KIOSK_DEVICE",
                  "GUEST"
                ]
              },
              "from": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "to": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "userId": {
                "type": "string",
                "maxLength": 160
              },
              "sortBy": {
                "default": "credits",
                "type": "string",
                "enum": [
                  "credits",
                  "requests",
                  "lastUsedAt",
                  "name"
                ]
              },
              "sortDirection": {
                "default": "desc",
                "type": "string",
                "enum": [
                  "asc",
                  "desc"
                ]
              }
            },
            "required": [
              "page",
              "pageSize",
              "search",
              "actorType",
              "sortBy",
              "sortDirection"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "query",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "list_chatbot_templates",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/chatbot-templates",
      "target": "workspace",
      "scope": "website:read",
      "description": "List supported versioned chatbot layouts and their presentation metadata.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "update_chatbot_template",
      "method": "PUT",
      "path": "/v1/workspaces/{workspaceId}/chatbot-template",
      "target": "workspace",
      "scope": "website:write",
      "description": "Switch only the chatbot layout, preserving branding, origins, availability, social links and conversations.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "templateKey": {
                "type": "string",
                "enum": [
                  "beauty-v1",
                  "beauty-v2",
                  "textile-v1",
                  "bags-v1"
                ]
              }
            },
            "required": [
              "templateKey"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_chatbot_settings",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/chatbot-settings",
      "target": "workspace",
      "scope": "website:read",
      "description": "Read the workspace chatbot configuration.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "update_chatbot_settings",
      "method": "PUT",
      "path": "/v1/workspaces/{workspaceId}/chatbot-settings",
      "target": "workspace",
      "scope": "website:write",
      "description": "Configure the opt-in chatbot and exact allowed HTTPS website origins.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "templateKey": {
                "type": "string",
                "enum": [
                  "beauty-v1",
                  "beauty-v2",
                  "textile-v1",
                  "bags-v1"
                ]
              },
              "enabled": {
                "default": false,
                "type": "boolean"
              },
              "allowedOrigins": {
                "default": [],
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 300
                }
              },
              "position": {
                "default": "bottom-right",
                "type": "string",
                "enum": [
                  "bottom-right",
                  "bottom-left"
                ]
              },
              "color": {
                "default": "#635bff",
                "type": "string",
                "pattern": "^#[0-9a-fA-F]{6}$"
              },
              "textColor": {
                "default": "#ffffff",
                "type": "string",
                "pattern": "^#[0-9a-fA-F]{6}$"
              },
              "title": {
                "default": "AI shopping assistant",
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "launcherText": {
                "default": "Ask AI",
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "welcomeText": {
                "default": "Welcome! I can answer product questions and help you build a routine.",
                "type": "string",
                "minLength": 1,
                "maxLength": 600
              },
              "placeholder": {
                "default": "Ask about our products…",
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "socialLinks": {
                "default": [],
                "maxItems": 7,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "platform": {
                      "type": "string",
                      "enum": [
                        "instagram",
                        "facebook",
                        "youtube",
                        "tiktok",
                        "linkedin",
                        "x",
                        "website"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "maxLength": 2048,
                      "format": "uri"
                    },
                    "visible": {
                      "default": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "platform",
                    "url",
                    "visible"
                  ],
                  "additionalProperties": false
                }
              },
              "offset": {
                "default": 20,
                "type": "integer",
                "minimum": 8,
                "maximum": 100
              }
            },
            "required": [
              "enabled",
              "allowedOrigins",
              "position",
              "color",
              "textColor",
              "title",
              "launcherText",
              "welcomeText",
              "placeholder",
              "socialLinks",
              "offset"
            ],
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "data",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_chatbot_analytics",
      "method": "GET",
      "path": "/v1/workspaces/{workspaceId}/chatbot-analytics",
      "target": "workspace",
      "scope": "workspace:read",
      "description": "Read aggregate chatbot visitors, messages and routine/product usage. Visitor identifiers and message text are never returned.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "query": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "to": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "origin": {
                "type": "string",
                "maxLength": 300
              }
            },
            "additionalProperties": false
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "query",
          "workspaceId"
        ],
        "additionalProperties": false
      }
    }
  ]
}