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

# Create or Update Shared Link

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

Shared links may be created or directly for file, folder, or web link
resources to generate a read-only URL to permit users with the appropriate
access level to view the content.

<Note>
  You may only have one active shared link for a file, folder, or web link at
  any time.
</Note>

At minimum the information needed to create a shared link will be:

* The type of resource, either a file, folder, or web link.
* The ID of that resource.

Optionally when creating a shared link the following may be specified:

* The access level, which may be one of:
  * open: A public shared link. Anyone with the link may access the link.
  * company: Anyone within your enterprise may access the link.
  * collaborators: Anyone collaborated on the content may access the link.
* An expiration time when the shared link will automatically disable.
* A password required to access the resource.

<Note>
  If an access level is not specified when creating a shared link it will use
  the default access level specified by the enterprise admin.
</Note>

## Create or Update Shared Link for File

To create a shared link on a file, specify the ID of the file with any optional
shared link parameters.

## Create or Update Shared Link for Folder

To create a shared link on a folder, specify the ID of the folder with any
optional shared link parameters.

## Create or Update Shared Link for Web Link

To create a shared link on a web link, specify the ID of the web link with any
optional shared link parameters.

<RelatedLinks
  title="RELATED APIS"
  items={[
  { label: "Update file", href: "/reference/put-files-id", badge: "PUT" }
]}
/>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
  { label: "Shared Link Permissions", href: "/guides/shared-links/permissions", badge: "GUIDE" },
  { label: "Remove Shared Link", href: "/guides/shared-links/remove", badge: "GUIDE" },
  { label: "Find Item from Shared Link", href: "/guides/shared-links/find-for-item", badge: "GUIDE" }
]}
/>
