POST
/
medical
/
v1
/
document
/
download-url
/
bulk
curl --request POST \
  --url https://api.sandbox.metriport.com/medical/v1/document/download-url/bulk \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "metadata": {}
}'
import { MetriportMedicalApi } from "@metriport/api-sdk";

const metriportClient = new MetriportMedicalApi("YOUR_API_KEY");

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

const status = await api.startBulkGetDocumentUrl(
  "<your-patient-id>",
  metadata
);

When executed, this endpoint triggers a process to generate all download URLs for a patient’s documents, which will then be delivered via webhook message.

The status of the process is returned in the response. Initially, it will be processing, and when the process is finished, the status will be updated to completed or failed.

The result of the process will be delivered via a webhook message - to set this up, and see the message format, check out our webhooks guide.

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

metadata
object

Metadata holds a record of up to 50 custom string key-value pairs. Key names can be up to 40 characters long and values up to 500 characters long. You may use this to attach whatever metadata is relevant for your business use case - for example, external IDs. This metadata will be returned in the webhook response.

{
  "metadata": {
     "youCan": "putAny",
     "stringKeyValue": "pairsHere",
  }
}

Response

status
string
required

The status of the URL generation process - can be processing, completed, or failed.

requestId
string

The ID of your request. This can be referenced for support.

{
    "status": "processing",
    "requestId": "018c1e9d-dfce-70cb-8c0e-edfbbd2a7f5f"
}