Search.../

unlabelContact( )

Developer Preview

Removes labels from a contact.

Description

The unlabelContact() function returns a Promise that resolves when the specified labels are removed from the contact.

If a label is no longer needed and you want to remove it from all contacts, you can delete it with Labels deleteLabel().

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function unlabelContact(contactId: string, labelKeys: Array<string>): Promise<UnlabelContactResponse>

unlabelContact Parameters

NAME
TYPE
DESCRIPTION
contactId
string

ID of the contact to remove labels from.

labelKeys
Array<
string
>

List of label keys to remove from the contact.

Returns

Updated contact.

Return Type:

Promise<
UnlabelContactResponse
>
NAME
TYPE
DESCRIPTION
contact
Contact

Updated contact.

Was this helpful?

unlabelContact example

Copy Code
1import { contacts } from 'wix-crm.v2';
2
3 async function unlabelContact(contactId, labelKeys, options) {
4 try {
5 const result = await contacts.unlabelContact(contactId, labelKeys, options);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13