> 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

# ListSharedDataCollections

# Package: collectionManagement

# Namespace: DataCollectionSharingService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-sharing/list-shared-data-collections.md

## Permission Scopes:
Manage Data Collection Sharing: SCOPE.DATA.MANAGE_COLLECTION_SHARING

## Introduction

Retrieves a list of shared data collections.

Returns either the collections that are either being shared by the current site or shared with the current site. Specify `sharedWithCurrentSite` to filter the direction.

---

## REST API

### Schema

```
 Method: listSharedDataCollections
 Description: Retrieves a list of shared data collections.  Returns either the collections that are either being shared by the current site or shared with the current site. Specify `sharedWithCurrentSite` to filter the direction.
 URL: https://www.wixapis.com/data/v1/data-collection-sharing/shared
 Method: GET
 Method parameters:
   query param name: dataCollectionIds | type: array<dataCollectionIds> | description: List of collection GUIDs to filter by.  When provided, only returns shared connections for the specified collections.  | validation: maxItems 100, maxLength 255
   param name: paging | type: CursorPaging    
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
   query param name: sharedWithCurrent | type: sharedWithCurrent | description: Whether to list collections shared with the current site or shared from the current site.  
   query param name: sharedWithCurrentSite | type: sharedWithCurrentSite | description: Whether to list collections shared with the current site or shared from the current site. When `true`, lists collections shared with the current site. When `false`, lists collections shared from the current site's policies.  Default: `false`  
 Return type: ListSharedDataCollectionsResponse
  - name: connections | type: array<SharingConnection> | description: List of shared collections.  
     - name: sourceDataCollectionId | type: string | description: GUID of the data collection owned and shared by the source site.  | validation: maxLength 255
     - name: sourceSiteId | type: string | description: GUID of the source site that owns the collection and created the policy.  | validation: format GUID
     - name: targetDataCollectionId | type: string | description: GUID of the shared collection on the target site. The GUID includes the namespace. For example, `"namespace/collectionName"`.  | validation: maxLength 255
     - name: targetSiteId | type: string | description: GUID of the target site that the collection is shared with.  | validation: format GUID
     - name: targetDisplayNamespace | type: string | description: Optional display name for the namespace that appears on the target site.  | validation: maxLength 100
     - name: dataSharingPolicyId | type: string | description: GUID of the data sharing policy that controls this connection.  | validation: format GUID
     - name: createdDate | type: string | description: Date and time the connection was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the connection was last updated.  | read-only: true | validation: format date-time
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: cursors | type: Cursors | description: Offset that was requested.  
        - name: next | type: string | description: Cursor pointing to next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Indicates if there are more results after the current page. If `true`, another page of results can be retrieved. If `false`, this is the last page.  


```

### Examples

### List shared data collections
```curl
curl -X GET \
  'https://wixapis.com/wix-data/v1/data-collection-sharing/shared?sharedWithCurrentSite=false'  \
  -H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.data.sharing.listSharedDataCollections(options)
 Description: Retrieves a list of shared data collections.  Returns either the collections that are either being shared by the current site or shared with the current site. Specify `sharedWithCurrentSite` to filter the direction.
 Method parameters:
   param name: options | type: ListSharedDataCollectionsOptions  none  
        - name: dataCollectionIds | type: array<string> | description: List of collection GUIDs to filter by.  When provided, only returns shared connections for the specified collections.  | validation: maxItems 100, maxLength 255
        - name: paging | type: CursorPaging | description: Paging information. By default, shared collections are sorted by `id` in ascending order.  
           - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, maximum 100, format int32
           - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: sharedWithCurrentSite | type: boolean | description: Whether to list collections shared with the current site or shared from the current site. When `true`, lists collections shared with the current site. When `false`, lists collections shared from the current site's policies.  Default: `false`  
 Return type: PROMISE<ListSharedDataCollectionsResponse>
  - name: connections | type: array<SharingConnection> | description: List of shared collections.  
     - name: sourceDataCollectionId | type: string | description: GUID of the data collection owned and shared by the source site.  | validation: maxLength 255
     - name: sourceSiteId | type: string | description: GUID of the source site that owns the collection and created the policy.  | validation: format GUID
     - name: targetDataCollectionId | type: string | description: GUID of the shared collection on the target site. The GUID includes the namespace. For example, `"namespace/collectionName"`.  | validation: maxLength 255
     - name: targetSiteId | type: string | description: GUID of the target site that the collection is shared with.  | validation: format GUID
     - name: targetDisplayNamespace | type: string | description: Optional display name for the namespace that appears on the target site.  | validation: maxLength 100
     - name: dataSharingPolicyId | type: string | description: GUID of the data sharing policy that controls this connection.  | validation: format GUID
     - name: _createdDate | type: Date | description: Date and time the connection was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the connection was last updated.  | read-only: true 
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: cursors | type: Cursors | description: Offset that was requested.  
        - name: next | type: string | description: Cursor pointing to next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Indicates if there are more results after the current page. If `true`, another page of results can be retrieved. If `false`, this is the last page.  


```

### Examples

### listSharedDataCollections
```javascript
import { sharing } from '@wix/data';

async function listSharedDataCollections(options) {
  const response = await sharing.listSharedDataCollections(options);
};
```

### listSharedDataCollections (with elevated permissions)
```javascript
import { sharing } from '@wix/data';
import { auth } from '@wix/essentials';

async function myListSharedDataCollectionsMethod(options) {
  const elevatedListSharedDataCollections = auth.elevate(sharing.listSharedDataCollections);
  const response = await elevatedListSharedDataCollections(options);
}
```

### listSharedDataCollections (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 { sharing } from '@wix/data';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function listSharedDataCollections(options) {
  const response = await myWixClient.sharing.listSharedDataCollections(options);
};
```

---