Search.../

deleteLabel( )

Developer Preview

Deletes a label from the site and removes it from contacts it applies to.

Description

The deleteLabel() function returns a Promise that resolves when the specified label is deleted.

Note: Only visitors with Manage Contacts permissions can run this function.

This function is not a universal function and runs only on the backend.

Admin Method

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

Syntax

function deleteLabel(key: string): Promise<void>

deleteLabel Parameters

NAME
TYPE
DESCRIPTION
key
string

Label key to delete.

Returns

Return Type:

Promise<
void
>

Was this helpful?

Delete a label

Copy Code
1import { labels } from 'wix-crm.v2';
2
3export function myDeleteLabelFunction() {
4 const key = 'custom.new-lead';
5
6 return labels.deleteLabel(key)
7 .then(() => {
8 console.log('Label deleted');
9 })
10 .catch((error) => {
11 console.error(error);
12 });
13}