Data Hub
Files

Delete several files of a run

Requires scope `files:delete`. Deletes up to 100 files of one run, as `DELETE /files/{fileId}` does for one. The response lists a result for each file in the order sent, so one that can't be deleted doesn't stop the others: `404` for an ID that isn't a file of this run, `409` for a file that is queued or processing (`details.reason: file_processing`) or whose run was deleted (`details.reason: run_deleted`). Set `include_linked` to delete the files linked to them too; `linked` lists those. The request itself returns `404` only when the run doesn't exist. A token that registered a watcher may act only on instruments whose active watcher it registered, and gets 403 for any other.

POST
/instruments/{instrumentId}/runs/{runId}/files/delete

Requires scope files:delete. Deletes up to 100 files of one run, as DELETE /files/{fileId} does for one. The response lists a result for each file in the order sent, so one that can't be deleted doesn't stop the others: 404 for an ID that isn't a file of this run, 409 for a file that is queued or processing (details.reason: file_processing) or whose run was deleted (details.reason: run_deleted). Set include_linked to delete the files linked to them too; linked lists those. The request itself returns 404 only when the run doesn't exist. A token that registered a watcher may act only on instruments whose active watcher it registered, and gets 403 for any other.

Authorization

bearerAuth
AuthorizationBearer <token>

Personal access tokens begin with dhub_… and are restricted by their assigned scopes.

In: header

Path Parameters

instrumentId*string
runId*string

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

curl -X POST "https://example.com/instruments/plate-reader/runs/run-2026-001/files/delete" \  -H "Content-Type: application/json" \  -d '{    "file_ids": [      1    ]  }'
{  "instrument_id": "string",  "run_id": "string",  "results": [    {      "ok": true,      "id": 0,      "filename": "string",      "deleted_at": "2019-08-24T14:15:22Z",      "deleted_by": "string",      "deleted_by_token": {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "name": "string"      },      "already_applied": true    }  ],  "linked": [    {      "ok": true,      "id": 0,      "filename": "string",      "relation": "video",      "already_applied": false,      "deleted_at": "2019-08-24T14:15:22Z"    }  ],  "counts": {    "deleted": 0,    "already_deleted": 0,    "failed": 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    }  }}