Remove runs from a lab notebook
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.
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.
Authorization
bearerAuth Personal access tokens begin with dhub_… and are restricted by their assigned scopes.
In: header
Path Parameters
uuidRequest 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
curl -X POST "https://example.com/lab-notebooks/9b2c4e1a-7d3f-4a5b-8c6d-0e1f2a3b4c5d/runs/remove" \ -H "Content-Type: application/json" \ -d '{ "runs": [ { "instrument_id": "string", "run_id": "string" } ] }'{ "lab_notebook_id": "68d3dae3-a03e-426a-9c74-40c2ae60b51f", "results": [ { "instrument_id": "string", "run_id": "string", "outcome": "removed" } ], "counts": { "removed": 0, "not_in_lab_notebook": 0, "run_deleted": 0, "not_found": 0 }}{ "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 } }}Add runs to a lab notebook POST
Requires scope `lab-notebooks:write`. Reports an outcome for each run instead of failing the whole request. Runs already in the lab notebook stay as they are. Returns 409 when the lab notebook is deleted. 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.
Create a run file record POST
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.