Use the delete method to delete a directory.

try {
  const directoryId = 'directory_id_here' // The ID of the directory to delete.
  await sdk.directory.delete(directoryId)
  console.log(`Directory with ID ${directoryId} has been deleted.`)
} catch (error) {
  console.error(error.message)
}

Params

  • directoryId - The ID of the directory you want to delete.

Required API Key Permission

  • Delete Directory