> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetWidgetSettings

# Package: aiSiteChat

# Namespace: Settings

# Method link: https://dev.wix.com/docs/api-reference/business-management/ai-site-chat/widget-settings-v2/get-widget-settings.md

## Permission Scopes:
Innovation Lab User: SCOPE.INNOVATION_LAB.USER

## Introduction

Retrieves the widget settings for the site.

---

## REST API

### Schema

```
 Method: getWidgetSettings
 Description: Retrieves the widget settings for the site.
 URL: https://www.wixapis.com/wix-assistant-widget/v2/settings
 Method: GET
 Return type: GetWidgetSettingsResponse
  - name: widgetSettings | type: WidgetSettings | description: Retrieved widget settings.  
     - name: id | type: string | description: Widget settings GUID.  | read-only: true | validation: format GUID
     - name: createdDate | type: string | description: Date and time the widget settings were created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the widget settings were updated.  | read-only: true | validation: format date-time
     - name: activeHours | type: ActiveHours | description: Times the AI assistant is available on the site with new mode-based configuration.  
        - name: schedule | type: array<ActiveHoursFrame> | description: Array of time frames during which the AI assistant or Wix user are available to respond to site visitors. Only used when `mode` is `SCHEDULED`. Ignored for all other modes.  | validation: minItems 0, maxItems 500
           - name: start | type: integer | description: Start time of the active hours in milliseconds since midnight. For example, 9:00 AM = 32400000.  
           - name: end | type: integer | description: End time of the active hours in milliseconds since midnight. For example, 5:00 PM = 61200000.  
           - name: handler | type: FrameHandler | description: Who is available during timeframe.  
                 - enum:
                 -     UNKNOWN_FRAME_HANDLER: Unknown frame type.
                 -     NOT_SELECTED: Frame type not selected.
                 -     AI_CHAT: AI assistant.
                 -     WIX_USER_CHAT: Wix user, such as a site owner.
           - name: days | type: array<DayOfWeek> | description: Day of the week.  | validation: minItems 1, maxItems 200
                 - enum: UNKNOWN_DAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
        - name: timeZone | type: string | description: Time zone used for the schedule.  | validation: maxLength 256
        - name: mode | type: ChatHandlerMode | description: Determines who responds to site visitors in the chat. Use `SCHEDULED` to define availability per time frame via the `schedule` field.  
             - enum:
             -     UNKNOWN_MODE: Unknown availability.
             -     ALWAYS_WITH_AI: AI assistant is always available. The `schedule` field is ignored.
             -     ALWAYS_WITH_WIX_USER: Wix user, such as a site owner, is always available. The `schedule` field is ignored.
             -     SCHEDULED: Availability is determined by the `schedule` field. Set time frames and handlers in `active_hours.schedule`.
             -     OFF: Neither the AI assistant nor a Wix user is ever available. The `schedule` field is ignored.
     - name: commonBehavior | type: CommonBehavior | description:   
        - name: autoOpen | type: boolean | description: Whether to open the AI assistant automatically when the site loads.  When `true`, the widget will open automatically when a site visitor lands on the site. When `false`, the widget will remain closed until the visitor clicks to open it. This setting applies across all modes (AI active hours, Wix user active hours, and offline hours).  
        - name: appearance | type: Appearance | description: Where to show the widget.  
             - enum:
             -     DESKTOP_AND_MOBILE: Show the widget on desktop and mobile.
             -     DESKTOP: Show the widget only on desktop.
             -     MOBILE: Show the widget only on mobile.
        - name: contactForm | type: ContactForm | description: Settings for the contact form.  The contact form will be shown to site visitors based on the timing settings in `WixUserBehavior` and `AIBehavior`, or when the chat is offline based on `OfflineBehavior`.  The contact form is shown only once per conversation.  
           - name: fields | type: ContactFormFields | description: Contact form fields.  
              - name: includeName | type: boolean | description: Whether to include a name field in the form.  
              - name: includeEmail | type: boolean | description: Whether to include an email field in the form.  
              - name: includePhone | type: boolean | description: Whether to include a phone number field in the form.  
              - name: includeMessage | type: boolean | description: Whether to include a message field in the form.  
              - name: requiredName | type: boolean | description: Whether the name field is required for submission.  
              - name: requiredEmail | type: boolean | description: Whether the email field is required for submission.  
              - name: requiredPhone | type: boolean | description: Whether the phone number field is required for submission.  
              - name: requiredMessage | type: boolean | description: Whether the message field is required for submission.  
           - name: introMessage | type: string | description: Message shown before the contact form.  | validation: maxLength 1000
           - name: successMessage | type: string | description: Message shown after the contact form is submitted.  | validation: maxLength 1000
        - name: pagesWithChat | type: array<string> | description:   | validation: maxItems 1000, maxLength 256
     - name: aiBehavior | type: AIBehavior | description: Defines how the AI assistant functions during AI active hours.  For instance, when WidgetSettings.active_hours.mode is set to ALWAYS_WITH_AI or SCHEDULED with a schedule that includes time frames with FrameHandler set to AI_CHAT, these settings will determine the behavior of the chat for site visitors during those hours.  
        - name: includeNavigationSummary | type: boolean | description: Whether the AI assistant should send a summary of the site visitor's navigation on the site.  
        - name: showContactFormWhenCannotAnswer | type: boolean | description: Whether the AI assistant should send the contact form if the AI is unable to answer the site visitor's question.  
        - name: showContactFormWhenRequestForPerson | type: boolean | description: Whether the AI assistant should send the contact form if the site visitor requests to chat with a real person.  
        - name: showContactFormBeforeChat | type: boolean | description: Whether the AI assistant should send the contact form before chat starts.  
        - name: introduction | type: SettingsMessage | description: This is shown in the chat when a site visitor starts a new conversation.  
           - name: enabled | type: boolean | description: Whether the message is enabled.  
           - name: text | type: string | description: Message content.  | validation: maxLength 1000
        - name: legalDisclaimer | type: SettingsMessage | description: Legal disclaimer message settings.  
        - name: engage | type: SettingsMessage | description: Message shown as popup to engage the site visitor with the AI assistant.  
        - name: suggestions | type: SuggestedQuestions | description: Suggested questions shown to the site visitor to help them get started.  
           - name: enabled | type: boolean | description: Whether suggesting questions is enabled.  
           - name: questions | type: array<SettingsMessage> | description: Suggested questions shown to the site visitor to help them get started.  | validation: minItems 0, maxItems 5
           - name: introduction | type: SettingsMessage | description: Introduction message for the suggested questions.  
           - name: displayWhenMinimized | type: boolean | description: Whether suggested questions should be displayed while the widget is minimized.  
        - name: avatar | type: string | description: Wix Media image GUID used for the AI assistant.  | validation: maxLength 500
     - name: offlineBehavior | type: OfflineBehavior | description: Defines how the AI assistant functions during offline hours.  Valid field combinations: - `hide_widget: true` — hides the widget entirely. `show_contact_form` and `allow_chat` are ignored. - `hide_widget: false, allow_chat: false, show_contact_form: true` — shows a contact form only, no chat input. - `hide_widget: false, allow_chat: true, show_contact_form: false` — allows visitors to type messages with no contact form. - `hide_widget: false, allow_chat: true, show_contact_form: true` — shows the chat input and a contact form.  
        - name: hideWidget | type: boolean | description: Hides the AI assistant widget from the site. When `true`, all other fields are ignored.  
        - name: showContactForm | type: boolean | description: Shows a contact form to the site visitor when the chat is offline.  
        - name: allowChat | type: boolean | description: Allows the site visitor to type and send messages when the chat is offline.  
        - name: introduction | type: SettingsMessage | description: This is shown in the chat when a site visitor starts a new conversation.  
        - name: allowFileUpload | type: boolean | description: Allows the site visitor to upload files when the chat is offline. This setting applies only to offline mode; file upload availability during AI or Wix user active hours is not configurable via this API.  
     - name: wixUserBehavior | type: WixUserBehavior | description: Defines how the AI assistant functions during Wix User active hours.  For instance, when WidgetSettings.active_hours.mode is set to ALWAYS_WITH_WIX_USER or SCHEDULED with a schedule that includes time frames with FrameHandler set to WIX_USER_CHAT, these settings will determine the behavior of the chat for site visitors during those hours.  
        - ONE-OF: 
           - name: contactFormBeforeChat | type: boolean | description: Show the contact form before starting a conversation.  
           - name: contactFormOnFirstMessage | type: boolean | description: Show the contact form after the site visitor's first message.  
           - name: neverShowContactForm | type: boolean | description: Never show the contact form.  
        - name: allowChat | type: boolean | description: Allow visitor to send messages.  
        - name: introduction | type: SettingsMessage | description: This is shown in the chat when a site visitor starts a new conversation.  
        - name: engage | type: SettingsMessage | description: Message shown as popup to engage the site visitor with the AI assistant.  
        - name: avatar | type: string | description: Wix Media image GUID used for the AI assistant.  | validation: maxLength 500
        - name: name | type: string | description: Display name shown for the Wix user in the chat.  | validation: maxLength 100
        - name: faqQuestions | type: FaqQuestions | description: FAQ questions shown to the site visitor.  
           - name: enabled | type: boolean | description: Whether FAQ questions are enabled.  
           - name: introduction | type: FaqIntroduction | description: Introduction message shown above the FAQ questions.  
              - name: enabled | type: boolean | description:   
              - name: text | type: string | description:   | validation: maxLength 1000
     - name: revision | type: string | description: Revision number, which increments by 1 each time the widget settings are updated. To prevent conflicting changes, the current revision must be passed when updating the widget settings.  | read-only: true | validation: format int64
     - name: socialButtons | type: SocialButtons | description: Social buttons shown in the widget header, offering site visitors alternative channels to reach the site owner.  
        - name: whatsapp | type: WhatsAppSocialButton | description:   
           - name: enabled | type: boolean | description: Whether the WhatsApp button is shown in the widget header.  
           - name: phone | type: string | description: Phone number of the WhatsApp account to contact, in international format (e.g. "+12345678900").  | validation: maxLength 20, format PHONE
           - name: infoText | type: string | description: Info text shown above the WhatsApp button when a site visitor opens it.  | validation: maxLength 1000
           - name: prefilledMessage | type: string | description: Message pre-filled into the WhatsApp chat when a site visitor opens it.  | validation: maxLength 1000
  - name: activeHandlers | type: array<ChatHandler> | description: Active chat handlers responding to messages from site visitors in the site chat.  | read-only: true 
     - enum:
     -     UNKNOWN_HANDLER: Unknown handler.
     -     AI: AI assistant.
     -     WIX_USER: Wix user, such as a site owner.
  - name: defaultAvatar | type: string | description: Wix Media image GUID to use as the default avatar when the Wix user avatar isn't set.  | read-only: true | validation: maxLength 500
  - name: nameHandlers | type: string | description: Name of the AI assistant shown in the site chat, as configured on the persona.  | read-only: true | validation: maxLength 250


```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.aiSiteChat.widgetSettingsV2.getWidgetSettings()
 Description: Retrieves the widget settings for the site.
 Return type: PROMISE<GetWidgetSettingsResponse>
  - name: widgetSettings | type: WidgetSettings | description: Retrieved widget settings.  
     - name: _id | type: string | description: Widget settings GUID.  | read-only: true | validation: format GUID
     - name: _createdDate | type: Date | description: Date and time the widget settings were created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the widget settings were updated.  | read-only: true 
     - name: activeHours | type: ActiveHours | description: Times the AI assistant is available on the site with new mode-based configuration.  
        - name: schedule | type: array<ActiveHoursFrame> | description: Array of time frames during which the AI assistant or Wix user are available to respond to site visitors. Only used when `mode` is `SCHEDULED`. Ignored for all other modes.  | validation: minItems 0, maxItems 500
           - name: start | type: integer | description: Start time of the active hours in milliseconds since midnight. For example, 9:00 AM = 32400000.  
           - name: end | type: integer | description: End time of the active hours in milliseconds since midnight. For example, 5:00 PM = 61200000.  
           - name: handler | type: FrameHandler | description: Who is available during timeframe.  
                 - enum:
                 -     UNKNOWN_FRAME_HANDLER: Unknown frame type.
                 -     NOT_SELECTED: Frame type not selected.
                 -     AI_CHAT: AI assistant.
                 -     WIX_USER_CHAT: Wix user, such as a site owner.
           - name: days | type: array<DayOfWeek> | description: Day of the week.  | validation: minItems 1, maxItems 200
                 - enum: UNKNOWN_DAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
        - name: timeZone | type: string | description: Time zone used for the schedule.  | validation: maxLength 256
        - name: mode | type: ChatHandlerMode | description: Determines who responds to site visitors in the chat. Use `SCHEDULED` to define availability per time frame via the `schedule` field.  
             - enum:
             -     UNKNOWN_MODE: Unknown availability.
             -     ALWAYS_WITH_AI: AI assistant is always available. The `schedule` field is ignored.
             -     ALWAYS_WITH_WIX_USER: Wix user, such as a site owner, is always available. The `schedule` field is ignored.
             -     SCHEDULED: Availability is determined by the `schedule` field. Set time frames and handlers in `active_hours.schedule`.
             -     OFF: Neither the AI assistant nor a Wix user is ever available. The `schedule` field is ignored.
     - name: commonBehavior | type: CommonBehavior | description:   
        - name: autoOpen | type: boolean | description: Whether to open the AI assistant automatically when the site loads.  When `true`, the widget will open automatically when a site visitor lands on the site. When `false`, the widget will remain closed until the visitor clicks to open it. This setting applies across all modes (AI active hours, Wix user active hours, and offline hours).  
        - name: appearance | type: Appearance | description: Where to show the widget.  
             - enum:
             -     DESKTOP_AND_MOBILE: Show the widget on desktop and mobile.
             -     DESKTOP: Show the widget only on desktop.
             -     MOBILE: Show the widget only on mobile.
        - name: contactForm | type: ContactForm | description: Settings for the contact form.  The contact form will be shown to site visitors based on the timing settings in `WixUserBehavior` and `AIBehavior`, or when the chat is offline based on `OfflineBehavior`.  The contact form is shown only once per conversation.  
           - name: fields | type: ContactFormFields | description: Contact form fields.  
              - name: includeName | type: boolean | description: Whether to include a name field in the form.  
              - name: includeEmail | type: boolean | description: Whether to include an email field in the form.  
              - name: includePhone | type: boolean | description: Whether to include a phone number field in the form.  
              - name: includeMessage | type: boolean | description: Whether to include a message field in the form.  
              - name: requiredName | type: boolean | description: Whether the name field is required for submission.  
              - name: requiredEmail | type: boolean | description: Whether the email field is required for submission.  
              - name: requiredPhone | type: boolean | description: Whether the phone number field is required for submission.  
              - name: requiredMessage | type: boolean | description: Whether the message field is required for submission.  
           - name: introMessage | type: string | description: Message shown before the contact form.  | validation: maxLength 1000
           - name: successMessage | type: string | description: Message shown after the contact form is submitted.  | validation: maxLength 1000
        - name: pagesWithChat | type: array<string> | description:   | validation: maxItems 1000, maxLength 256
     - name: aiBehavior | type: AIBehavior | description: Defines how the AI assistant functions during AI active hours.  For instance, when WidgetSettings.active_hours.mode is set to ALWAYS_WITH_AI or SCHEDULED with a schedule that includes time frames with FrameHandler set to AI_CHAT, these settings will determine the behavior of the chat for site visitors during those hours.  
        - name: includeNavigationSummary | type: boolean | description: Whether the AI assistant should send a summary of the site visitor's navigation on the site.  
        - name: showContactFormWhenCannotAnswer | type: boolean | description: Whether the AI assistant should send the contact form if the AI is unable to answer the site visitor's question.  
        - name: showContactFormWhenRequestForPerson | type: boolean | description: Whether the AI assistant should send the contact form if the site visitor requests to chat with a real person.  
        - name: showContactFormBeforeChat | type: boolean | description: Whether the AI assistant should send the contact form before chat starts.  
        - name: introduction | type: SettingsMessage | description: This is shown in the chat when a site visitor starts a new conversation.  
           - name: enabled | type: boolean | description: Whether the message is enabled.  
           - name: text | type: string | description: Message content.  | validation: maxLength 1000
        - name: legalDisclaimer | type: SettingsMessage | description: Legal disclaimer message settings.  
        - name: engage | type: SettingsMessage | description: Message shown as popup to engage the site visitor with the AI assistant.  
        - name: suggestions | type: SuggestedQuestions | description: Suggested questions shown to the site visitor to help them get started.  
           - name: enabled | type: boolean | description: Whether suggesting questions is enabled.  
           - name: questions | type: array<SettingsMessage> | description: Suggested questions shown to the site visitor to help them get started.  | validation: minItems 0, maxItems 5
           - name: introduction | type: SettingsMessage | description: Introduction message for the suggested questions.  
           - name: displayWhenMinimized | type: boolean | description: Whether suggested questions should be displayed while the widget is minimized.  
        - name: avatar | type: string | description: Wix Media image GUID used for the AI assistant.  | validation: maxLength 500
     - name: offlineBehavior | type: OfflineBehavior | description: Defines how the AI assistant functions during offline hours.  Valid field combinations: - `hide_widget: true` — hides the widget entirely. `show_contact_form` and `allow_chat` are ignored. - `hide_widget: false, allow_chat: false, show_contact_form: true` — shows a contact form only, no chat input. - `hide_widget: false, allow_chat: true, show_contact_form: false` — allows visitors to type messages with no contact form. - `hide_widget: false, allow_chat: true, show_contact_form: true` — shows the chat input and a contact form.  
        - name: hideWidget | type: boolean | description: Hides the AI assistant widget from the site. When `true`, all other fields are ignored.  
        - name: showContactForm | type: boolean | description: Shows a contact form to the site visitor when the chat is offline.  
        - name: allowChat | type: boolean | description: Allows the site visitor to type and send messages when the chat is offline.  
        - name: introduction | type: SettingsMessage | description: This is shown in the chat when a site visitor starts a new conversation.  
        - name: allowFileUpload | type: boolean | description: Allows the site visitor to upload files when the chat is offline. This setting applies only to offline mode; file upload availability during AI or Wix user active hours is not configurable via this API.  
     - name: wixUserBehavior | type: WixUserBehavior | description: Defines how the AI assistant functions during Wix User active hours.  For instance, when WidgetSettings.active_hours.mode is set to ALWAYS_WITH_WIX_USER or SCHEDULED with a schedule that includes time frames with FrameHandler set to WIX_USER_CHAT, these settings will determine the behavior of the chat for site visitors during those hours.  
        - ONE-OF: 
           - name: contactFormBeforeChat | type: boolean | description: Show the contact form before starting a conversation.  
           - name: contactFormOnFirstMessage | type: boolean | description: Show the contact form after the site visitor's first message.  
           - name: neverShowContactForm | type: boolean | description: Never show the contact form.  
        - name: allowChat | type: boolean | description: Allow visitor to send messages.  
        - name: introduction | type: SettingsMessage | description: This is shown in the chat when a site visitor starts a new conversation.  
        - name: engage | type: SettingsMessage | description: Message shown as popup to engage the site visitor with the AI assistant.  
        - name: avatar | type: string | description: Wix Media image GUID used for the AI assistant.  | validation: maxLength 500
        - name: name | type: string | description: Display name shown for the Wix user in the chat.  | validation: maxLength 100
        - name: faqQuestions | type: FaqQuestions | description: FAQ questions shown to the site visitor.  
           - name: enabled | type: boolean | description: Whether FAQ questions are enabled.  
           - name: introduction | type: FaqIntroduction | description: Introduction message shown above the FAQ questions.  
              - name: enabled | type: boolean | description:   
              - name: text | type: string | description:   | validation: maxLength 1000
     - name: revision | type: string | description: Revision number, which increments by 1 each time the widget settings are updated. To prevent conflicting changes, the current revision must be passed when updating the widget settings.  | read-only: true | validation: format int64
     - name: socialButtons | type: SocialButtons | description: Social buttons shown in the widget header, offering site visitors alternative channels to reach the site owner.  
        - name: whatsapp | type: WhatsAppSocialButton | description:   
           - name: enabled | type: boolean | description: Whether the WhatsApp button is shown in the widget header.  
           - name: phone | type: string | description: Phone number of the WhatsApp account to contact, in international format (e.g. "+12345678900").  | validation: maxLength 20, format PHONE
           - name: infoText | type: string | description: Info text shown above the WhatsApp button when a site visitor opens it.  | validation: maxLength 1000
           - name: prefilledMessage | type: string | description: Message pre-filled into the WhatsApp chat when a site visitor opens it.  | validation: maxLength 1000
  - name: activeHandlers | type: array<ChatHandler> | description: Active chat handlers responding to messages from site visitors in the site chat.  | read-only: true 
     - enum:
     -     UNKNOWN_HANDLER: Unknown handler.
     -     AI: AI assistant.
     -     WIX_USER: Wix user, such as a site owner.
  - name: defaultAvatar | type: string | description: Wix Media image GUID to use as the default avatar when the Wix user avatar isn't set.  | read-only: true | validation: maxLength 500
  - name: nameHandlers | type: string | description: Name of the AI assistant shown in the site chat, as configured on the persona.  | read-only: true | validation: maxLength 250


```

### Examples

### getWidgetSettings
```javascript
import { widgetSettingsV2 } from '@wix/ai-site-chat';

async function getWidgetSettings() {
  const response = await widgetSettingsV2.getWidgetSettings();
};
```

### getWidgetSettings (with elevated permissions)
```javascript
import { widgetSettingsV2 } from '@wix/ai-site-chat';
import { auth } from '@wix/essentials';

async function myGetWidgetSettingsMethod() {
  const elevatedGetWidgetSettings = auth.elevate(widgetSettingsV2.getWidgetSettings);
  const response = await elevatedGetWidgetSettings();
}
```

### getWidgetSettings (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { widgetSettingsV2 } from '@wix/ai-site-chat';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { widgetSettingsV2 },
  // Include the auth strategy and host as relevant
});


async function getWidgetSettings() {
  const response = await myWixClient.widgetSettingsV2.getWidgetSettings();
};
```

---