Skip to content

Upload the VCFs

A client uploads each VCF for a case to S3, as in step 2 of the happy path scenario. For each file, it asks the BIOS API for an upload URL, then sends the file to that URL.

Request an upload URL

The client requests the URL for the case's vcfs requirement. CASE_ID is the case_id from the Create a case response. The client should send a new UUID in the Idempotency-Key header for each file, and the same key if it retries the request.

IDEMPOTENCY_KEY=$(uuidgen)

UPLOAD_URL=$(curl -s -X POST https://sandbox.biosgenomics.com/api/v1/cases/$CASE_ID/requirements/vcfs/upload \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Idempotency-Key: \"$IDEMPOTENCY_KEY\"" \
  -H "Content-Type: application/json" \
  -d @upload.json \
  | jq -r .upload_url)
upload.json
{
  "filename": "TEST-ACCESSION-0001.vcf.gz",
  "content_type": "application/gzip",
  "size_bytes": 48213904
}

Response

The BIOS API returns 200 with the upload URL, which expires at expires_at, 15 minutes after the request. If the URL expires before the upload finishes, the client can request another.

{
  "case_id": "case_01kfb7q2r3s4t5v6w7x8y9z0ab",
  "requirement_key": "vcfs",
  "upload_session_id": "upl_01kfb8c4d5e6f7g8h9j0kmnpqr",
  "upload_mode": "single_put",
  "bucket": "bios-cases-sandbox-us-west-2",
  "object_key": "org_01kf9c8d7e6f5g4h3j2k1m0npq/case_01kfb7q2r3s4t5v6w7x8y9z0ab/bifrost/requirements/vcfs/uploads/upl_01kfb8c4d5e6f7g8h9j0kmnpqr/TEST-ACCESSION-0001.vcf.gz",
  "upload_url": "https://bios-cases-sandbox-us-west-2.s3.us-west-2.amazonaws.com/org_01kf9c8d7e6f5g4h3j2k1m0npq/case_01kfb7q2r3s4t5v6w7x8y9z0ab/bifrost/requirements/vcfs/uploads/upl_01kfb8c4d5e6f7g8h9j0kmnpqr/TEST-ACCESSION-0001.vcf.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Date=20261117T195841Z&X-Amz-Expires=900&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=...",
  "expires_at": "2026-11-17T20:13:41.207315Z"
}

Upload the file

The client must send the whole file to upload_url in one PUT, because upload_mode is single_put. It must send the Content-Type it gave as content_type, because the URL's signature covers that header.

curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: application/gzip" \
  --upload-file TEST-ACCESSION-0001.vcf.gz

S3 returns 200 with an empty body. Shortly after S3 stores the file, BIOS will record it and set the vcfs requirement's status to uploaded. Before it submits the case, the client can check that status with GET /cases/{case_id}.