Skip to content

Complete a STOW upload

post /dicomweb/stow-uploads/{batchId}/complete

Assembles the parts and processes the body like any STOW request. A retried complete for a finished upload gets the same answer.

Scope: stow:write (partner_stow tokens).

Rate limit: 60 requests per minute per token.

Audited as stow.receive in the practice's audit log.

Parameters

Name In Description
batchId path The batch ID from the Location header or the upload

Request body

Every part's number and etag

application/json

Field Type Description
size integer
uploadId string
parts array of object
{
  "size": 734003200,
  "uploadId": "2~abcDEF123",
  "parts": [
    {
      "partNumber": 1,
      "etag": "a1b2c3d4"
    },
    {
      "partNumber": 2,
      "etag": "e5f6a7b8"
    }
  ]
}

Responses

202

Accepted for asynchronous processing. Poll the batch at Location until status is done or failed.

Header Description
Location URL of the batch status (GET /dicomweb/stow/{batchId})
Warning 299 - "Accepted for asynchronous processing; status at …"

application/dicom+json

{}

400

Problem: validation, invalid-json

401

Problem: unauthenticated

403

Problem: forbidden, tenant-suspended, trial-expired, trial-cap

404

Problem: not-found

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
404 not-found Not found

Examples

curl

curl -X POST 'https://app.pacspilot.com/dicomweb/stow-uploads/01JA2Z6Q7Y9K3M5N8P0R2S4T6V/complete' \
  -H "Authorization: Bearer $PACSPILOT_TOKEN" \
  -H 'Content-Type: application/json' \
  --data-binary '{
  "size": 734003200,
  "uploadId": "2~abcDEF123",
  "parts": [
    {
      "partNumber": 1,
      "etag": "a1b2c3d4"
    },
    {
      "partNumber": 2,
      "etag": "e5f6a7b8"
    }
  ]
}'

JavaScript

const res = await fetch("https://app.pacspilot.com/dicomweb/stow-uploads/01JA2Z6Q7Y9K3M5N8P0R2S4T6V/complete", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PACSPILOT_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "size": 734003200,
    "uploadId": "2~abcDEF123",
    "parts": [
      {
        "partNumber": 1,
        "etag": "a1b2c3d4"
      },
      {
        "partNumber": 2,
        "etag": "e5f6a7b8"
      }
    ]
  }),
});
console.log(res.status, await res.text());

Python

import os
import requests

data = "{\n  \"size\": 734003200,\n  \"uploadId\": \"2~abcDEF123\",\n  \"parts\": [\n    {\n      \"partNumber\": 1,\n      \"etag\": \"a1b2c3d4\"\n    },\n    {\n      \"partNumber\": 2,\n      \"etag\": \"e5f6a7b8\"\n    }\n  ]\n}"

res = requests.request(
    "POST",
    "https://app.pacspilot.com/dicomweb/stow-uploads/01JA2Z6Q7Y9K3M5N8P0R2S4T6V/complete",
    headers={"Authorization": f"Bearer {os.environ['PACSPILOT_TOKEN']}", "Content-Type": "application/json"},
    data=data.encode("utf-8"),
)
print(res.status_code, res.text)