Create a run file record
Requires scope `files:create`. PAT only; browser sessions are rejected. A token that registered a watcher may act only on instruments whose active watcher it registered, and gets 403 for any other. The location must be the file's own: `s3_key` must be `<instrumentId>/<runId>/<filename>`, using the run ID as stored, `filename` can't contain `/`, and `s3_bucket` must be Data Hub's raw bucket for a `raw` file or its processed bucket for a `processed` one. Any other location gets `400`. `source_file_id` is for a `processed` file and names the raw file of this run that it was made from; any other value gets `400`. An existing processed file that has no source yet is linked to it; one that has a source keeps it. A processed file made from a deleted raw file is saved deleted, and when the key belongs to a deleted processed file, that file is saved again as the new output. `409` means the run is deleted, or another file already uses that key or path.
Requires scope files:create. PAT only; browser sessions are rejected. A token that registered a watcher may act only on instruments whose active watcher it registered, and gets 403 for any other. The location must be the file's own: s3_key must be <instrumentId>/<runId>/<filename>, using the run ID as stored, filename can't contain /, and s3_bucket must be Data Hub's raw bucket for a raw file or its processed bucket for a processed one. Any other location gets 400. source_file_id is for a processed file and names the raw file of this run that it was made from; any other value gets 400. An existing processed file that has no source yet is linked to it; one that has a source keeps it. A processed file made from a deleted raw file is saved deleted, and when the key belongs to a deleted processed file, that file is saved again as the new output. 409 means the run is deleted, or another file already uses that key or path.
Authorization
bearerAuth Personal access tokens begin with dhub_… and are restricted by their assigned scopes.
In: header
Path Parameters
The run ID. Spaces at the start or end are ignored.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/instruments/plate-reader/runs/run-2026-001/files" \ -H "Content-Type: application/json" \ -d '{ "s3_bucket": "string", "s3_key": "string", "filename": "string" }'{ "id": 0, "instrument_run_id": "09e81fd0-3875-4ea7-a8b5-166f38633c23", "filename": "string", "relative_path": "string", "s3_bucket": "string", "s3_key": "string", "content_type": "string", "size_bytes": 0, "category": "raw", "status": "detected", "metadata": { "property1": null, "property2": null }, "error_message": "string", "detected_at": "2019-08-24T14:15:22Z", "upload_requested_at": "2019-08-24T14:15:22Z", "uploaded_at": "2019-08-24T14:15:22Z", "processed_at": "2019-08-24T14:15:22Z", "processing_started_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "file_created_at": "2019-08-24T14:15:22Z", "deleted_at": "2019-08-24T14:15:22Z"}{ "id": 0, "instrument_run_id": "09e81fd0-3875-4ea7-a8b5-166f38633c23", "filename": "string", "relative_path": "string", "s3_bucket": "string", "s3_key": "string", "content_type": "string", "size_bytes": 0, "category": "raw", "status": "detected", "metadata": { "property1": null, "property2": null }, "error_message": "string", "detected_at": "2019-08-24T14:15:22Z", "upload_requested_at": "2019-08-24T14:15:22Z", "uploaded_at": "2019-08-24T14:15:22Z", "processed_at": "2019-08-24T14:15:22Z", "processing_started_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "file_created_at": "2019-08-24T14:15:22Z", "deleted_at": "2019-08-24T14:15:22Z"}{ "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null } }}Remove runs from a lab notebook POST
Requires scope `lab-notebooks:write`. Reports an outcome for each run instead of failing the whole request. The lab notebook stays, even with no runs left. Returns 409 when the lab notebook is deleted. A POST rather than a DELETE with a body, which some proxies and clients drop. A token that registered a watcher gets 403 for the whole request when any listed run is on an instrument whose active watcher it didn't register.
Update a file PATCH
Requires scope `files:update`. PAT only; browser sessions are rejected. Returns `409` (`details.reason: file_deleted`) when the file was deleted. A token that registered a watcher may act only on instruments whose active watcher it registered, and gets 403 for any other.