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

# Start Bulk Get Document URL

> Triggers a process to generate a list of download URLs for all of the patient's documents.

When executed, this endpoint triggers a process to generate all download URLs for a patient's documents.
This is an asynchronous process, and the status is returned in the response to the original request.

Initially, the status will be `processing`, and when the process is finished, the status will be updated to
`completed` or `failed`.

Once completed, a webhook request will be sent [your configured URL](/medical-api/api-reference/settings/post-settings)
containing the document download URLs. The URL will be valid for 60 minutes after which it will expire.

Webhook message type - see [the respective section on the webhooks page](/medical-api/handling-data/webhooks-with-nq#medical-document-bulk-download-urls)
for more details:

* `medical.document-bulk-download-urls`: list of download urls for a patient's documents.

<Warning>
  If you trigger this endpoint again while the process is still running, you will get a response
  that reflects the current progress. Essentially, only a single bulk URL generation process will be
  running for a patient at any given time.
</Warning>

## Query Params

<ParamField query="patientId" type="string" required>
  The ID of the patient for which to initiate the bulk URL generation.
</ParamField>

## Body

<Snippet file="webhook-request-metadata.mdx" />

<Snippet file="webhook-metadata-post-example.mdx" />

## Response

<ResponseField name="status" type="string" required>
  The status of the URL generation process - can be `processing`, `completed`, or `failed`.
</ResponseField>

<Snippet file="request-id.mdx" />

```json theme={null}
{
  "status": "processing",
  "requestId": "018c1e9d-dfce-70cb-8c0e-edfbbd2a7f5f"
}
```

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

  const metriport = new MetriportMedicalApi("YOUR_API_KEY");

  const metadata = {
    youCan: "putAny",
    stringKeyValue: "pairsHere",
  };

  const status = await metriport.startBulkGetDocumentUrl(
    "018a80c4-292a-7486-a1234-76yuhe23yu14",
    metadata
  );

  ```
</ResponseExample>

```
```
