Start a STOW upload
post /dicomweb/stow-uploads
For one instance larger than a STOW request may be (up to 1 GiB). Build the same
multipart/related body you would send to POST /dicomweb/studies, then
send it in parts pieces of exactly partSize bytes (the last may be
shorter, at most 64 MiB each), and complete the upload. Nothing is stored as a batch until the
upload completes.
Scope: stow:write (partner_stow tokens).
Rate limit: 60 requests per minute per token.
Request body
Size and content type of the whole multipart body
application/json
| Field | Type | Description |
|---|---|---|
size |
integer | Total body size in bytes |
contentType |
string |
The body's
multipart/related; type="application/dicom"; boundary=… content
type
|
{
"size": 734003200,
"contentType": "multipart/related; type=\"application/dicom\"; boundary=pp-7f3k2q"
}
Responses
201
Upload started
application/json
| Field | Type | Description |
|---|---|---|
batchId |
string | |
uploadId |
string | Send as x-pp-upload-id with each part |
size |
integer | |
partSize |
integer | Every part but the last has exactly this many bytes |
parts |
integer | Number of parts to send |
{
"batchId": "01JA2Z6Q7Y9K3M5N8P0R2S4T6V",
"uploadId": "2~abcDEF123",
"size": 734003200,
"partSize": 67108864,
"parts": 11
}
400
Problem: validation, invalid-json
401
Problem: unauthenticated
403
Problem: forbidden, tenant-suspended, trial-expired,
trial-cap
413
Problem: payload-too-large
415
Problem: unsupported-media-type
429
Problem: rate-limited
500
Problem: internal
503
Problem: tenant-migrating
Errors
| Status | Type | Meaning |
|---|---|---|
| 401 |
unauthenticated
|
Not authenticated |
| 403 |
forbidden
|
Not allowed |
| 500 |
internal
|
Internal error |
| 429 |
rate-limited
|
Rate limited |
| 503 |
tenant-migrating
|
Practice is being moved |
| 403 |
tenant-suspended
|
Practice is read-only |
| 403 |
trial-expired
|
Trial has ended |
| 403 |
trial-cap
|
Trial limit reached |
| 400 |
validation
|
Invalid request |
| 400 |
invalid-json
|
Body is not JSON |
| 415 |
unsupported-media-type
|
Unsupported content type |
| 413 |
payload-too-large
|
Body too large |
Examples
curl
curl -X POST 'https://app.pacspilot.com/dicomweb/stow-uploads' \
-H "Authorization: Bearer $PACSPILOT_TOKEN" \
-H 'Content-Type: application/json' \
--data-binary '{
"size": 734003200,
"contentType": "multipart/related; type=\"application/dicom\"; boundary=pp-7f3k2q"
}'
JavaScript
const res = await fetch("https://app.pacspilot.com/dicomweb/stow-uploads", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PACSPILOT_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"size": 734003200,
"contentType": "multipart/related; type=\"application/dicom\"; boundary=pp-7f3k2q"
}),
});
console.log(res.status, await res.text());
Python
import os
import requests
data = "{\n \"size\": 734003200,\n \"contentType\": \"multipart/related; type=\\\"application/dicom\\\"; boundary=pp-7f3k2q\"\n}"
res = requests.request(
"POST",
"https://app.pacspilot.com/dicomweb/stow-uploads",
headers={"Authorization": f"Bearer {os.environ['PACSPILOT_TOKEN']}", "Content-Type": "application/json"},
data=data.encode("utf-8"),
)
print(res.status_code, res.text)