Deletes the specified label from a site and removes it from the contacts it applies to.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function deleteLabel(key: string): Promise<void>;
Label key to delete.
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 */
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.