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

# Get Document URL

> Gets a downloadable URL for downloading the specified document.

This endpoint returns a URL which you can use to download the specified document and/or convert
using the file name provided from the [List Documents endpoint](/medical-api/api-reference/document/list-documents),
or from the `meta.source` field of the FHIR resource you are interested in.

<Info>
  The URL will only be valid for 60 seconds before you need
  to request a new one.
</Info>

## Query Params

<ParamField query="fileName" type="string" required>
  The file name of the document. You can get this from the
  [meta.source](/medical-api/fhir/overview#meta) attribute
  of any FHIR resource.
</ParamField>

<ParamField query="conversionType" type="string">
  The document type to convert to. Either `html` or `pdf`.

  <Info>This parameter should only be used for converting XML/CDA files.</Info>
</ParamField>

## Response

A JSON object containing the URL will be returned.

<ResponseField name="url" type="string">
  The downloadable URL.
</ResponseField>

<Tip>
  For patients with a large volume of documents, you can use
  the [Bulk Get Document URL
  endpoint](/medical-api/api-reference/document/download-url-bulk)
  to get all download URLs instead of doing it one at a
  time.
</Tip>

<ResponseExample>
  ```javascript Metriport SDK theme={null}
  import { MetriportMedicalApi } from "@metriport/api-sdk";

  const metriport = new MetriportMedicalApi("YOUR_API_KEY");

  const downloadableUrl = await metriport.getDocumentUrl(
    "abc123-def456"
  );
  ```
</ResponseExample>
