> 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`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # GetConversation # Package: aiSiteChat # Namespace: Conversations # Method link: https://dev.wix.com/docs/api-reference/business-management/ai-site-chat/conversations/get-conversation.md ## Permission Scopes: Innovation Lab User: SCOPE.INNOVATION_LAB.USER ## Introduction Retrieves the conversation for the site visitor calling this method. This method must be called using the site visitor or site member identity ([SDK](https://dev.wix.com/docs/sdk/articles/get-started/about-identities.md#site-member) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/about-identities.md#site-member)) to identify the site visitor that is requesting the conversation. --- ## REST API ### Schema ``` Method: getConversation Description: Retrieves the conversation for the site visitor calling this method. This method must be called using the site visitor or site member identity ([SDK](https://dev.wix.com/docs/sdk/articles/get-started/about-identities.md#site-member) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/about-identities.md#site-member)) to identify the site visitor that is requesting the conversation. URL: https://www.wixapis.com/v1/conversation Method: GET Return type: GetConversationResponse - name: conversation | type: Conversation | description: Retrieved conversation. - name: id | type: string | description: Conversation GUID. - name: contact | type: boolean | description: Whether the site visitor engaging in this conversation is a contact. - name: createdDate | type: string | description: Date and time the conversation was created. - name: updatedDate | type: string | description: Date and time the conversation was updated. ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.aiSiteChat.Conversations.getConversation() Description: Retrieves the conversation for the site visitor calling this method. This method must be called using the site visitor or site member identity ([SDK](https://dev.wix.com/docs/sdk/articles/get-started/about-identities.md#site-member) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/about-identities.md#site-member)) to identify the site visitor that is requesting the conversation. Return type: PROMISE - name: conversation | type: Conversation | description: Retrieved conversation. - name: _id | type: string | description: Conversation GUID. - name: contact | type: boolean | description: Whether the site visitor engaging in this conversation is a contact. - name: _createdDate | type: Date | description: Date and time the conversation was created. - name: _updatedDate | type: Date | description: Date and time the conversation was updated. ``` ### Examples ### getConversation ```javascript import { conversations } from '@wix/ai-site-chat'; async function getConversation() { const response = await conversations.getConversation(); }; ``` ### getConversation (with elevated permissions) ```javascript import { conversations } from '@wix/ai-site-chat'; import { auth } from '@wix/essentials'; async function myGetConversationMethod() { const elevatedGetConversation = auth.elevate(conversations.getConversation); const response = await elevatedGetConversation(); } ``` ### getConversation (self-hosted) Self-hosted 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 { conversations } 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: { conversations }, // Include the auth strategy and host as relevant }); async function getConversation() { const response = await myWixClient.conversations.getConversation(); }; ``` ---