Use the create
method to create a new directory or folder.
try {
const name = 'new_directory'; // The name of the directory to create.
const parentDirectoryId = 'parent_directory_id_here'; // The ID of the parent directory or drive.
const response = await sdk.directory.create(
name,
parentDirectoryId
);
console.log(response.data); // Newly created directory details
} catch (error) {
console.error(error.message);
}
Params
name
(string): The name of the new directory to create.parentDirectoryId
(string): The ID of the parent directory where the new directory will be created.
Required API Key Permission
Create Directory