> 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

# ListLabels

# Package: contacts

# Namespace: ContactLabelsServiceV4

# Method link: https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/labels/list-labels.md

## Permission Scopes:
Manage Contact Labels: SCOPE.DC-CONTACTS.MANAGE-LABELS

## Introduction

Lists all contact labels for a site.

---

## REST API

### Schema

```
 Method: listLabels
 Description: Lists all contact labels for a site.
 URL: https://www.wixapis.com/contacts/v4/labels
 Method: GET
 Method parameters:
   param name: labelType | type: LabelType    
      - enum:
           SYSTEM - Default system label for the contact list.
           USER_DEFINED - Label created by calling the Find Or Create Label method.
           WIX_APP_DEFINED - Label created by an app built by Wix.
   query param name: language | type: language    | validation: format LANGUAGE
   query param name: namespace | type: namespace | description: Filter for labels in the specified namespace.  | validation: minLength 3, maxLength 25
   param name: paging | type: Paging    
        - name: limit | type: integer | description: Number of items to return.  Defaults to `1000`. <br> Maximum: `2000`.  | validation: minimum 0, format int32
        - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
   param name: sort | type: Sorting    
        - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 3000
        - name: order | type: SortOrder | description: Sort order.  Default: `ASC`.  
             - enum:
             -     ASC: Sort by ascending order.
             -     DESC: Sort by descending order.
   query param name: startsWith | type: startsWith | description: Filter for labels where `displayName` starts with the specified case-sensitive string.  | validation: minLength 1, maxLength 180
 Return type: ListLabelsResponse
  - name: labels | type: array<ContactLabel> | description: List of labels.  
     - name: namespace | type: string | description: Label namespace.  Labels created by calling the Find Or Create Label method are automatically assigned to the `custom` namespace.  | read-only: true | validation: minLength 1, maxLength 25
     - name: namespaceDisplayName | type: string | description: Display name for the namespace, used to organize the list of labels in the site dashboard.  | read-only: true | validation: minLength 1, maxLength 180
     - name: key | type: string | description: Label key.  `key` is generated when the label is created. It can't be modified, even if `displayName` is updated.  | read-only: true | validation: minLength 1, maxLength 80
     - name: displayName | type: string | description: Label display name shown in the dashboard.  | validation: minLength 1, maxLength 180
     - name: labelType | type: LabelType | description: Label type indicating how the label was created.  | read-only: true 
         - enum:
         -     SYSTEM: Default system label for the contact list.
         -     USER_DEFINED: Label created by calling the Find Or Create Label method.
         -     WIX_APP_DEFINED: Label created by an app built by Wix.
     - name: createdDate | type: string | description: Date and time the label was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the label was last updated.  | read-only: true | validation: format date-time
  - name: metadata | type: PagingMetadata | description: Metadata for the page of results.  
     - name: count | type: integer | description: Number of items returned.  | validation: format int32
     - name: offset | type: integer | description: Requested offset.  | validation: format int32
     - name: total | type: integer | description: Number of items that matched the query.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Indicates if `total` calculation timed out before the response was sent. Typically this happens if there is a large set of results.  


```

### Examples

### List Translated Labels
```curl
curl -L -X GET 'https://www.wixapis.com/contacts/v4/labels?language=es' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>'
```

### List Labels That Start with a String
Lists labels whose display names start with the requested string.

```curl
curl -X GET 'https://www.wixapis.com/contacts/v4/labels?startsWith=Ano' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>'
```

### List Labels Created by Site Contributors
```curl
curl -X GET 'https://www.wixapis.com/contacts/v4/labels?labelType=USER_DEFINED' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>'
```

### List All Labels
```curl
curl -X GET \
  'https://www.wixapis.com/contacts/v4/labels' \
  -H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.crm.labels.listLabels(options)
 Description: Lists all contact labels for a site.
 Method parameters:
   param name: options | type: ListLabelsOptions  none  
        - name: labelType | type: LabelType | description: Filter for labels of the specified type.  
             - enum:
             -     SYSTEM: Default system label for the contact list.
             -     USER_DEFINED: Label created by calling the Find Or Create Label method.
             -     WIX_APP_DEFINED: Label created by an app built by Wix.
        - name: namespace | type: string | description: Filter for labels in the specified namespace.  | validation: minLength 3, maxLength 25
        - name: startsWith | type: string | description: Filter for labels where `displayName` starts with the specified case-sensitive string.  | validation: minLength 1, maxLength 180
        - name: sort | type: Sorting | description: Sorting options.  
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 3000
           - name: order | type: SortOrder | description: Sort order.  Default: `ASC`.  
                 - enum:
                 -     ASC: Sort by ascending order.
                 -     DESC: Sort by descending order.
        - name: paging | type: Paging | description: Paging options.  
           - name: limit | type: integer | description: Number of items to return.  Defaults to `1000`. <br> Maximum: `2000`.  | validation: minimum 0, format int32
           - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
        - name: language | type: string | description:   | validation: format LANGUAGE
 Return type: PROMISE<ListLabelsResponse>
  - name: labels | type: array<ContactLabel> | description: List of labels.  
     - name: namespace | type: string | description: Label namespace.  Labels created by calling the Find Or Create Label method are automatically assigned to the `custom` namespace.  | read-only: true | validation: minLength 1, maxLength 25
     - name: namespaceDisplayName | type: string | description: Display name for the namespace, used to organize the list of labels in the site dashboard.  | read-only: true | validation: minLength 1, maxLength 180
     - name: key | type: string | description: Label key.  `key` is generated when the label is created. It can't be modified, even if `displayName` is updated.  | read-only: true | validation: minLength 1, maxLength 80
     - name: displayName | type: string | description: Label display name shown in the dashboard.  | validation: minLength 1, maxLength 180
     - name: labelType | type: LabelType | description: Label type indicating how the label was created.  | read-only: true 
         - enum:
         -     SYSTEM: Default system label for the contact list.
         -     USER_DEFINED: Label created by calling the Find Or Create Label method.
         -     WIX_APP_DEFINED: Label created by an app built by Wix.
     - name: _createdDate | type: Date | description: Date and time the label was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the label was last updated.  | read-only: true 
  - name: metadata | type: PagingMetadata | description: Metadata for the page of results.  
     - name: count | type: integer | description: Number of items returned.  | validation: format int32
     - name: offset | type: integer | description: Requested offset.  | validation: format int32
     - name: total | type: integer | description: Number of items that matched the query.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Indicates if `total` calculation timed out before the response was sent. Typically this happens if there is a large set of results.  


```

### Examples

### listLabels
```javascript
import { labels } from '@wix/crm';

async function listLabels(options) {
  const response = await labels.listLabels(options);
};
```

### listLabels (with elevated permissions)
```javascript
import { labels } from '@wix/crm';
import { auth } from '@wix/essentials';

async function myListLabelsMethod(options) {
  const elevatedListLabels = auth.elevate(labels.listLabels);
  const response = await elevatedListLabels(options);
}
```

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

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


async function listLabels(options) {
  const response = await myWixClient.labels.listLabels(options);
};
```

---