Use the rename
method to change the name of an existing drive.
try {
const id = 'drive_id_here'; // The ID of the drive to rename.
const name = 'new_drive_name'; // The new name for the drive.
const [data, error] = await sdk.drive.rename({ id, name });
// Check for success
if (error) {
console.error('Failed to rename drive: ', error);
} else {
console.log('Drive renamed: ', data);
}
} catch (error) {
console.error(error.message);
}
Params
id
(string): The ID of the drive to rename.name
(string): The new name for the drive.
Required API Key Permission
- Create Directory
- Delete Directory