Use the rename method to change the name of an existing drive.

try {
  const driveId = 'drive_id_here'; // The ID of the drive to rename.
  const newName = 'new_drive_name'; // The new name for the drive.
  
  const updatedDrive = await sdk.drive.rename(driveId, newName);
  console.log('Drive renamed:', updatedDrive);
} catch (error) {
  console.error(error.message);
}

Params

  • driveId (string): The ID of the drive to rename.
  • newName(string): The new name for the drive.

Required API Key Permission

  • Create Directory
  • Delete Directory