Files
List files stored in a workspace. Requires the files scope and a workspace_id.
GET
/v1/filesfiles scopeList files in a workspace. Returns metadata only.
| Parameter | Type | Description |
|---|---|---|
| workspace_id * | string | Workspace to list files from. |
| prefix | string | Filter by path prefix, e.g. results/. |
| limit | integer | Max results (default 100). |
files = client.files.list(workspace_id="ws_abc123")
for f in files:
print(f"{f['name']} — {f['size'] / 1024:.1f} KB key={f['key']}")POST
/v1/files/uploadfiles scopeUpload a file via multipart/form-data. Max 500 MB. For larger files use the presigned URL flow.
| Form field | Type | Description |
|---|---|---|
| file * | binary | File bytes. |
| workspace_id * | string | Destination workspace. |
| path | string | Optional folder path, e.g. raw/. |
| description | string | Optional description. |
result = client.files.upload(
"sample.vcf",
workspace_id="ws_abc123",
path="raw/",
)
file_key = result["key"] # pass this to query or downloadGET
/v1/files/downloadfiles scopeReturns a presigned S3 download URL valid for ~1 hour. Fetch that URL directly to get the file bytes.
| Parameter | Type | Description |
|---|---|---|
| workspace_id * | string | Workspace the file belongs to. |
| key * | string | S3 key of the file. |
# Download directly to disk (one-liner)
local_path = client.files.download(
result["key"], workspace_id="ws_abc123", dest="./output/"
)
print(f"Saved to {local_path}")DELETE
/v1/filesfiles scopeDelete a file. Requires workspace_id and key as query parameters.
client.files.delete(result["key"], workspace_id="ws_abc123")
Large file upload (>500 MB)
Use a two-step presigned URL flow to upload large files directly to S3.
1. POST /v1/files/upload-url
2. PUT to S3
3. POST /v1/files/upload-confirm
import requests, os
path = "large_genome.bam"
size = os.path.getsize(path)
# 1. Request presigned URL
info = client.files.upload_large(
filename=os.path.basename(path),
workspace_id="ws_abc123",
content_type="application/octet-stream",
size=size,
path="bam/",
)
# 2. PUT bytes directly to S3
with open(path, "rb") as f:
requests.put(info["uploadUrl"], data=f,
headers={"Content-Type": "application/octet-stream"})
# 3. Confirm
result = client.files.upload_confirm(
file_key=info["fileKey"],
workspace_id="ws_abc123",
filename=os.path.basename(path),
size=size,
)
print(result["key"])