Delete a file
Requires scope `files:delete`. Deletes the file from its run, whether or not it was uploaded. The file stays in storage, its row records who deleted it, and `POST /files/{fileId}/restore` brings it back. Deleted files are left out of the run's file lists and downloads. Pass `include_linked=true` to delete the files linked to it too: for a raw file, the processed files made from it and the `run.json` saved with its capture when every raw file in that folder is being deleted. `linked` lists them. Returns `409` while the file is queued or processing, unless its processing has stalled (wait for processing to finish), and `409` (`details.reason: run_deleted`) when the run was deleted. Deleting a file that is already deleted succeeds with `already_applied: true`. A token that registered a watcher may act only on instruments whose active watcher it registered, and gets 403 for any other.
Requires scope files:delete. Deletes the file from its run, whether or not it was uploaded. The file stays in storage, its row records who deleted it, and POST /files/{fileId}/restore brings it back. Deleted files are left out of the run's file lists and downloads. Pass include_linked=true to delete the files linked to it too: for a raw file, the processed files made from it and the run.json saved with its capture when every raw file in that folder is being deleted. linked lists them. Returns 409 while the file is queued or processing, unless its processing has stalled (wait for processing to finish), and 409 (details.reason: run_deleted) when the run was deleted. Deleting a file that is already deleted succeeds with already_applied: true. A token that registered a watcher may act only on instruments whose active watcher it registered, and gets 403 for any other.
Authorization
bearerAuth Personal access tokens begin with dhub_… and are restricted by their assigned scopes.
In: header
Path Parameters
Query Parameters
true also deletes (or restores) the files linked to this one. Default false.
Value in
- "true"
- "false"
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/files/1"{ "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" } ]}{ "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 } }}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.
Restore a file POST
Requires scope `files:delete`. Brings a deleted file back to its run and clears who deleted it. Pass `include_linked=true` to restore the deleted files linked to it too, which `linked` lists, each with its own result. Returns `409` (`details.reason: path_in_use`, with `details.held_by` naming the file) when another file of the run now has this file's name or path, and `409` (`details.reason: run_deleted`) when the run was deleted. Restoring a file that isn't deleted succeeds with `already_applied: true`. A token that registered a watcher may act only on instruments whose active watcher it registered, and gets 403 for any other.