POST
/
medical
/
v1
/
document
/
download-url
/
bulk

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: 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

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"
}