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

# Copy a File Request

export const Link = ({href, children, className, ...props}) => {
  const [localizedHref, setLocalizedHref] = useState(href);
  const supportedLocales = useMemo(() => ['ja'], []);
  useEffect(() => {
    const getLocaleFromPath = path => {
      const match = path.match(/^\/([a-z]{2})(?:\/|$)/);
      if (match) {
        const potentialLocale = match[1];
        if (supportedLocales.includes(potentialLocale)) {
          return potentialLocale;
        }
      }
      return null;
    };
    const hasLocalePrefix = path => {
      const match = path.match(/^\/([a-z]{2})(?:\/|$)/);
      return match ? supportedLocales.includes(match[1]) : false;
    };
    const currentPath = window.location.pathname;
    const currentLocale = getLocaleFromPath(currentPath);
    if (href && href.startsWith('/') && !hasLocalePrefix(href)) {
      if (currentLocale) {
        setLocalizedHref(`/${currentLocale}${href}`);
      } else {
        setLocalizedHref(href);
      }
    } else {
      setLocalizedHref(href);
    }
  }, [href, supportedLocales]);
  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>;
};

<RelatedLinks
  title="REQUIRED GUIDES"
  items={[
  { label: "Create a template File Request", href: "/guides/file-requests/template", badge: "GUIDE" }
]}
/>

To create a copy of an existing <Link href="/guides/file-requests/template">template</Link> file
request, all you need is its unique ID, and the ID of the folder to apply the
new file request to.

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X POST "https://api.box.com/2.0/file_requests/42037322/copy" \
       -H "authorization: Bearer <ACCESS_TOKEN>" \
       -d '{
         "title": "Please upload required documents",
         "description": "Please upload required documents",
         "status": "active",
         "is_email_required": true,
         "is_description_required": false,
         "folder": {
           "id": "2233212",
           "type": "folder"
         }
       }'
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.fileRequests.createFileRequestCopy(fileRequestId, {
    folder: {
      id: fileRequest.folder.id,
      type: 'folder' as FileRequestCopyRequestFolderTypeField,
    } satisfies FileRequestCopyRequestFolderField,
  } satisfies FileRequestCopyRequest);
  ```

  ```python Python v10 theme={null}
  client.file_requests.create_file_request_copy(
      file_request_id,
      CreateFileRequestCopyFolder(
          id=file_request.folder.id, type=CreateFileRequestCopyFolderTypeField.FOLDER
      ),
  )
  ```

  ```csharp .NET v10 theme={null}
  await client.FileRequests.CreateFileRequestCopyAsync(fileRequestId: fileRequestId, requestBody: new FileRequestCopyRequest(folder: new FileRequestCopyRequestFolderField(id: fileRequest.Folder.Id) { Type = FileRequestCopyRequestFolderTypeField.Folder }));
  ```

  ```swift Swift v10 theme={null}
  try await client.fileRequests.createFileRequestCopy(fileRequestId: fileRequestId, requestBody: FileRequestCopyRequest(folder: FileRequestCopyRequestFolderField(id: fileRequest.folder.id, type: FileRequestCopyRequestFolderTypeField.folder)))
  ```

  ```java Java v10 theme={null}
  client.getFileRequests().createFileRequestCopy(fileRequestId, new FileRequestCopyRequest(new FileRequestCopyRequestFolderField.Builder(fileRequest.getFolder().getId()).type(FileRequestCopyRequestFolderTypeField.FOLDER).build()))
  ```

  ```java Java v5 theme={null}
  BoxFileRequest fileRequest = new BoxFileRequest(api, "id");
  BoxFileRequest.Info fileRequestInfo = fileRequest.new Info();
  fileRequestInfo.setDescription("Following documents are requested for your process");
  fileRequestInfo.setIsDescriptionRequired(true);
  fileRequestInfo.setStatus(BoxFileRequest.Status.ACTIVE);
  fileRequestInfo = fileRequest.copyInfo(fileRequestInfo, "folderId");
  ```

  ```py Python v4 theme={null}
  file_request = client.file_request(file_request_id='123456')
  folder = client.folder(folder_id='123456789')
  new_file_request = file_request.copy(folder=folder, title="Copied file request")
  ```

  ```csharp .NET v6 theme={null}
  var destinationFolder = new BoxRequestEntity
  {
      Id = "123456",
      Type = BoxType.folder
  };

  var copyRequest = new BoxFileRequestCopyRequest
  {
      Description = "New file request description",
      Folder = destinationFolder
  };

  BoxFileRequestObject fileRequest = await client.FileRequestsManager.CopyFileRequestAsync("12345", copyRequest);
  ```

  ```js Node v4 theme={null}
  client.fileRequests.copy(fileRequestId, {
    folder: {
      id: '157979815648',
      type: 'folder'
    }
  }).then((r: FileRequest) => {
    // do something with the copied file request 
    console.log(r)
  });
  ```
</CodeGroup>

<Note>
  The ID of a folder and file request can be determined by visiting the Box web
  app and inspecting the URL.

  The folder ID is the number at the end of the URL when visiting a folder, for
  example `app.box.com/folder/123` is the URL for the folder with ID `123`.

  For a file request, please <Link href="/guides/file-requests/template">check our guide</Link>
  on setting up a file request template to learn how to determine a file request
  ID.
</Note>

## Updating a file request on copy

It is possible to make some basic changes to a file request when copying from
a template. The file request's title, description, status and a few more other
settings can be updated when the file request is copied from the template.

```sh  theme={null}
curl -i -X POST "https://api.box.com/2.0/file_requests/2342235/copy" \
    -H "Authorization: Bearer <ACCESS_TOKEN>" \
    -d '{
      "title": "Please upload required documents",
      "description": "Please upload required documents",
      "status": "active",
      "is_email_required": true,
      "is_description_required": false,
      "folder": {
        "id": "342323423"
      }
    }'
```

<Note>
  For more details on the different fields that can be updated when creating
  a template, please see the reference documentation for the
  <Link href="/reference/post-file-requests-id-copy">`POST /file-requests/:id/copy`</Link> API.
</Note>

<RelatedLinks
  title="RELATED APIS"
  items={[
  { label: "Copy file request", href: "/reference/post-file-requests-id-copy", badge: "POST" }
]}
/>
