> 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
# 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
query param name: namespace | type: namespace | description: Filter for labels in the specified namespace.
param name: paging | type: Paging
- name: limit | type: integer | description: Number of items to return. Defaults to `1000`.
Maximum: `2000`.
- name: offset | type: integer | description: Number of items to skip in the current sort order.
param name: sort | type: Sorting
- name: fieldName | type: string | description: Name of the field to sort by.
- 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.
Return type: ListLabelsResponse
- name: labels | type: array | 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.
- name: namespaceDisplayName | type: string | description: Display name for the namespace, used to organize the list of labels in the site dashboard.
- 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.
- name: displayName | type: string | description: Label display name shown in the dashboard.
- name: labelType | type: LabelType | description: Label type indicating how the label was created.
- 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.
- name: updatedDate | type: string | description: Date and time the label was last updated.
- name: metadata | type: PagingMetadata | description: Metadata for the page of results.
- name: count | type: integer | description: Number of items returned.
- name: offset | type: integer | description: Requested offset.
- name: total | type: integer | description: Number of items that matched the query.
- 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 All Labels
```curl
curl -X GET \
'https://www.wixapis.com/contacts/v4/labels' \
-H 'Authorization: '
```
### List Translated Labels
```curl
curl -L -X GET 'https://www.wixapis.com/contacts/v4/labels?language=es' \
-H 'Content-Type: application/json' \
-H 'Authorization: '
```
### 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: '
```
### 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: '
```
---
## JavaScript SDK
### Schema
```
Method: wixClientAdmin.contacts.ContactLabelsServiceV4.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.
- name: startsWith | type: string | description: Filter for labels where `displayName` starts with the specified case-sensitive string.
- name: sort | type: Sorting | description: Sorting options.
- name: fieldName | type: string | description: Name of the field to sort by.
- 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`.
Maximum: `2000`.
- name: offset | type: integer | description: Number of items to skip in the current sort order.
- name: language | type: string | description:
Return type: PROMISE
- name: labels | type: array | 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.
- name: namespaceDisplayName | type: string | description: Display name for the namespace, used to organize the list of labels in the site dashboard.
- 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.
- name: displayName | type: string | description: Label display name shown in the dashboard.
- name: labelType | type: LabelType | description: Label type indicating how the label was created.
- 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.
- name: _updatedDate | type: Date | description: Date and time the label was last updated.
- name: metadata | type: PagingMetadata | description: Metadata for the page of results.
- name: count | type: integer | description: Number of items returned.
- name: offset | type: integer | description: Requested offset.
- name: total | type: integer | description: Number of items that matched the query.
- 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-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 { 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);
};
```
---