MedicalTrace

Create an upload intent

Ask for a storage target for one document version.

Requires asset:update_metadata, and the organization must be the manufacturer or current custodian. The returned URL is a simulated upload target. The file is not public.

1. Request URL

POST https://api.medicaltrace.net/v1/equipment/44444444-4444-4444-8444-444444444444/documents/upload-intent

2. Request parameters

ParameterInRequiredTypeDescription
AuthorizationheaderYesstringBearer token from POST /auth/login. The sample value demo.local.jwt is a placeholder.
X-Organization-IdheaderYesstringManufacturer or current custodian.
idpathYesstringEquipment id.
mediaTypebodyYesstringFile media type. The sample is application/pdf.
logicalDocIdbodyNostringStable id for this document. The server generates one when omitted.

3. Request example

curl -s -X POST 'https://api.medicaltrace.net/v1/equipment/44444444-4444-4444-8444-444444444444/documents/upload-intent' \
  -H 'content-type: application/json' \
  -H 'authorization: Bearer demo.local.jwt' \
  -H 'x-organization-id: 11111111-1111-4111-8111-111111111111' \
  -d '{"mediaType":"application/pdf"}'

4. Response data

HTTP 201. The body below uses the fictional DEMO-BED-001 fixtures.

{
  "uploadUrl": "https://api.medicaltrace.net/v1/equipment/44444444-4444-4444-8444-444444444444/documents/doc_demo_model/v1",
  "storageKey": "org/11111111-1111-4111-8111-111111111111/equipment/44444444-4444-4444-8444-444444444444/doc_demo_model/v1",
  "logicalDocId": "doc_demo_model",
  "version": 1,
  "method": "PUT",
  "headers": {
    "Content-Type": "application/pdf"
  },
  "note": "Simulated upload intent — complete via POST .../documents/complete"
}

5. Response fields

FieldTypeDescriptionExample
uploadUrlstringWhere the client PUTs the bytes.doc_demo_model/v1
storageKeystringObject key, namespaced by organization.org/11111111-1111-4111-8111-111111111111/...
logicalDocIdstringSend this back on complete.doc_demo_model
versionnumberDocument version. A replacement is a new version.1