> ## 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 User

export const Link = ({href, children, className, ...props}) => {
  const localizedHref = href;
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

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>;
};

The process for deleting both app and managed users is the same. To delete a
user account, supply the user ID for the account that should be
removed.

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

  ```typescript Node/TypeScript v10 theme={null}
  await client.users.deleteUserById(user.id);
  ```

  ```python Python v10 theme={null}
  client.users.delete_user_by_id(user.id)
  ```

  ```cs .NET v10 theme={null}
  await client.Users.DeleteUserByIdAsync(userId: user.Id);
  ```

  ```swift Swift v10 theme={null}
  try await client.users.deleteUserById(userId: user.id)
  ```

  ```java Java v10 theme={null}
  client.getUsers().deleteUserById(user.getId())
  ```

  ```java Java v5 theme={null}
  BoxUser user = new BoxUser(api, "0");
  user.delete(false, false);
  ```

  ```python Python v4 theme={null}
  user_id = '33333'
  client.user(user_id).delete(force=True)
  ```

  ```cs .NET v6 theme={null}
  await client.UsersManager.DeleteEnterpriseUserAsync("44444", notify: false, force: true);
  ```

  ```javascript Node v4 theme={null}
  // Delete the user even if they still have files in their account
  client.users.delete('123', {force: true})
      .then(() => {
          // deletion succeeded — no value returned
      });
  ```
</CodeGroup>

There are also two optional parameters that may be set when deleting a user
account:

* force: Whether the user should be deleted even if the account still has content in it.
* notify: Whether the user will receive a notification that the account was deleted.

<Note>
  The delete user request will fail if the user account still has content in
  it. To resolve this, either
  <Link href="/guides/users/deprovision/transfer-folders">transfer all files or folders</Link>
  to another account or use the optional `force` parameter.
</Note>

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

<RelatedLinks
  title="RELATED GUIDES"
  items={[
{ label: translate("Deprovision Users"), href: "/guides/users/deprovision/index", badge: "GUIDE" },
{ label: translate("Transfer Files & Folders"), href: "/guides/users/deprovision/transfer-folders", badge: "GUIDE" }
]}
/>
