Delete Bag Files
DELETE/api/v1/bags
Moves one or more .bag files from BAGS_FS to the trash directory. Files already in trash/ are permanently deleted instead — restricted to the developer role. All files are validated for existence before any deletion begins. Paths must be relative to BAGS_FS root (e.g. critical_bags/scan_001.bag).
Request
- application/json
Body
required
files string[]required
Possible values: >= 1
Relative paths of .bag files to delete.
Responses
- 200
- 400
- 403
- 500
Delete operation completed (partial success included)
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
success booleanrequired
message stringrequired
data objectrequired
deleted string[]required
failed object[]required
file stringrequired
code stringrequired
Possible values: [FILE_NOT_FOUND, DELETE_FAILED, UNKNOWN]
reason stringrequired
{
"success": true,
"message": "string",
"data": {
"deleted": [
"critical_bags/scan_001.bag"
],
"failed": [
{
"file": "normal_bags/scan_999.bag",
"code": "FILE_NOT_FOUND",
"reason": "File not found"
}
]
}
}
Bad request — invalid body or path traversal detected
- application/json
- Schema
- Example (from schema)
Schema
success booleanrequired
message stringrequired
{
"success": true,
"message": "string"
}
Forbidden — files under trash/ require the developer role
- application/json
- Schema
- Example (from schema)
Schema
success booleanrequired
message stringrequired
{
"success": true,
"message": "string"
}
One or more deletions failed or internal server error
- application/json
- Schema
- Example (from schema)
Schema
success booleanrequired
message stringrequired
{
"success": true,
"message": "string"
}
Loading...