Skip to main content
POST
/
medical
/
v1
/
document
/
download-url
/
bulk
Start Bulk Get Document URL
curl --request POST \
  --url https://api.sandbox.metriport.com/medical/v1/document/download-url/bulk \
  --header 'x-api-key: <api-key>'
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
);

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 containing the document download URLs. The URL will be valid for 10 minutes after which it will expire. Webhook message type - see the respective section on the webhooks page for more details:
  • medical.document-bulk-download-urls: list of download urls for a patient’s documents.
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.

Query Params

patientId
string
required
The ID of the patient for which to initiate the bulk URL generation.

Body

Response

status
string
required
The status of the URL generation process - can be processing, completed, or failed.
{
  "status": "processing",
  "requestId": "018c1e9d-dfce-70cb-8c0e-edfbbd2a7f5f"
}
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
);