> 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 # Method name: renameLabel(key: string, label: RenameLabel, options: RenameLabelOptions) # Method package: wixCrmV2 # Method menu location: wixCrmV2 --> labels --> renameLabel # Method Link: https://dev.wix.com/docs/velo/apis/wix-crm-v2/labels/rename-label.md # Method Description: Renames a label. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Rename a label (dashboard page code) ```javascript import { labels } from 'wix-crm.v2'; /* Sample key value: * * 'custom.active-customer' * * Sample label object: * { * displayName: "Customer" * } */ export async function myRenameLabelFunction(key, label) { try { const renamedLabel = await labels.renameLabel(key, label); console.log('successfully renamed label:', renamedLabel); return renamedLabel; } catch (error) { console.log(error); // Handle the error } } /* Promise resolves to: * { * "namespace": "custom", * "namespaceDisplayName": "Labels", * "key": "custom.active-customer", * "displayName": "Customer", * "labelType": "USER_DEFINED", * "legacyId": "74f1e5c6-d9d5-4485-b272-13081ea35f38", * "_createdDate": "2023-12-25T06:13:21.000Z", * "_updatedDate": "2023-12-25T09:14:37.000Z" * } */ ``` ## Rename a label (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { labels } from 'wix-crm.v2'; import { elevate } from 'wix-auth'; /* Sample key value: * * 'custom.active-customer' * * Sample label object: * { * displayName: "Customer" * } */ export const myRenameLabelFunction = webMethod(Permissions.Anyone, async (key, label) => { try { const elevatedRenameLabel = elevate(labels.renameLabel); const renamedLabel = await elevatedRenameLabel(key, label); console.log('successfully renamed label:', renamedLabel); return renamedLabel; } catch (error) { console.log(error); // Handle the error } }); /* Promise resolves to: * { * "namespace": "custom", * "namespaceDisplayName": "Labels", * "key": "custom.active-customer", * "displayName": "Customer", * "labelType": "USER_DEFINED", * "legacyId": "74f1e5c6-d9d5-4485-b272-13081ea35f38", * "_createdDate": "2023-12-25T06:13:21.000Z", * "_updatedDate": "2023-12-25T09:14:37.000Z" * } */ ``` ---