deleteLabel( )


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

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Members and Contacts - all permissions
Manage Contact Labels
Learn more about app permissions.
Method Declaration
Copy
function deleteLabel(key: string): Promise<void>;
Method Parameters
keystringRequired

Label key to delete.

JavaScript
import { labels } from "wix-crm.v2"; /* Sample key value: 'custom.at-risk' */ export async function myDeleteLabelFunction(key) { try { const deletedLabel = await labels.deleteLabel(key); console.log("Label deleted."); } catch (error) { console.log(error); // Handle the error } } /* Promise resolves to void */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?