> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Folder

export const MultiRelatedLinks = ({sections = []}) => {
  if (!sections || sections.length === 0) {
    return null;
  }
  return <div className="space-y-8">
      {sections.map((section, index) => <RelatedLinks key={index} title={section.title} items={section.items} />)}
    </div>;
};

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

<RelatedLinks
  title="REQUIRED GUIDES"
  items={[
{ label: translate("Create Folder"), href: "/guides/folders/single/create", badge: "GUIDE" }
]}
/>

To remove a folder in Box you will need to provide our API with the ID of the
folder.

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X DELETE "https://api.box.com/2.0/folders/4353455" \
       -H "authorization: Bearer <ACCESS_TOKEN>"
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.folders.deleteFolderById(newFolder.id);
  ```

  ```python Python v10 theme={null}
  client.folders.delete_folder_by_id(new_folder.id)
  ```

  ```cs .NET v10 theme={null}
  await client.Folders.DeleteFolderByIdAsync(folderId: newFolder.Id);
  ```

  ```swift Swift v10 theme={null}
  try await client.folders.deleteFolderById(folderId: newFolder.id)
  ```

  ```java Java v10 theme={null}
  client.getFolders().deleteFolderById(newFolder.getId())
  ```

  ```java Java v5 theme={null}
  // Delete the folder and all its contents
  BoxFolder folder = new BoxFolder(api, "id");
  folder.delete(true);
  ```

  ```python Python v4 theme={null}
  client.folder(folder_id='22222').delete()
  ```

  ```cs .NET v6 theme={null}
  await client.FoldersManager.DeleteAsync("11111", recursive: true);
  ```

  ```javascript Node v4 theme={null}
  client.folders.delete('12345', {recursive: true})
      .then(() => {
          // deletion succeeded — no value returned
      });
  ```
</CodeGroup>

## Deleting non-empty folders

This API returns an error if the folder is not empty. When deleting a
folder, you can pass in the `recursive` parameter to force a
folder to be deleted even if it is not empty. This will delete all
items within this folder, including any of their descendants.

## Folder locking

The enterprise settings determine whether the folder will
be permanently deleted from Box or moved to the trash.

During this operation, part of the file tree will be locked, mainly
the source folder and all of its descendants.

For the duration of the operation, no other move, copy, delete, or restore
operation can performed on any of the locked folders.

## Timeout

Timeout for this operation is 600 seconds. The operation will complete
after a `HTTP 503` has been returned.

<RelatedLinks
  title="RELATED APIS"
  items={[
{ label: translate("Delete folder"), href: "/reference/delete-folders-id", badge: "DELETE" }
]}
/>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
{ label: translate("Create Folder"), href: "/guides/folders/single/create", badge: "GUIDE" }
]}
/>
