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
| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
Authorization | header | Yes | string | Bearer token from POST /auth/login. The sample value demo.local.jwt is a placeholder. |
X-Organization-Id | header | Yes | string | Manufacturer or current custodian. |
id | path | Yes | string | Equipment id. |
mediaType | body | Yes | string | File media type. The sample is application/pdf. |
logicalDocId | body | No | string | Stable 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
| Field | Type | Description | Example |
|---|---|---|---|
uploadUrl | string | Where the client PUTs the bytes. | doc_demo_model/v1 |
storageKey | string | Object key, namespaced by organization. | org/11111111-1111-4111-8111-111111111111/... |
logicalDocId | string | Send this back on complete. | doc_demo_model |
version | number | Document version. A replacement is a new version. | 1 |