Summary
Add a new endpoint to the BrAPI Core specification for batch deletion of studies, following the exact pattern of POST /delete/images.
Motivation
- Allow BrAPI clients to delete one or more studies programmatically
- Provide a standardized deletion interface for platforms like Gigwa to expose their existing study deletion functionality
- Maintain consistency with the existing deletion pattern (
/delete/images)
Endpoint Definition
Path: POST /delete/studies
Request Body:
{
"studyDbIds": ["study1", "study2", "study3"]
}
| Parameter |
Type |
Required |
Description |
| studyDbIds |
array[string] |
Yes |
List of study identifiers to delete |
Response (200 OK):
{
"@context": ["https://brapi.org/jsonld/context/metadata.jsonld"],
"metadata": {},
"result": {
"deletedStudies": [
{ "studyDbId": "study1", "success": true, "message": "Study deleted successfully." },
{ "studyDbId": "study2", "success": false, "message": "Study not found." },
{ "studyDbId": "study3", "success": false, "message": "Cannot delete: study has associated observation units." }
]
}
}
| Field |
Type |
Description |
| result.deletedStudies |
array[object] |
Results for each requested deletion |
| .studyDbId |
string |
Study identifier from request |
| .success |
boolean |
Whether deletion succeeded |
| .message |
string |
Human-readable status or error reason |
Status Codes:
200: Request processed (check individual success flags)
400: Malformed request body
401: Authentication required
403: Insufficient permissions
500: Server error
Design Decisions
Pattern Consistency: Follows POST /delete/images exactly:
- Path:
/delete/studies
- Request field:
studyDbIds
- Response field:
deletedStudies
Dependency Handling: Specification does not mandate cascading deletion. Implementations decide validation rules (e.g., block deletion if observation units exist).
Operation Characteristics:
- Synchronous (deletion results embedded in the response)
- Not idempotent (second request returns "not found")
- Batch processing with per-item reporting
Security: The endpoint must enforce appropriate authorization to ensure only permitted users can delete studies. Implementations should verify the requesting user has the necessary permissions for each study before deletion.
Summary
Add a new endpoint to the BrAPI Core specification for batch deletion of studies, following the exact pattern of
POST /delete/images.Motivation
/delete/images)Endpoint Definition
Path:
POST /delete/studiesRequest Body:
{ "studyDbIds": ["study1", "study2", "study3"] }Response (200 OK):
{ "@context": ["https://brapi.org/jsonld/context/metadata.jsonld"], "metadata": {}, "result": { "deletedStudies": [ { "studyDbId": "study1", "success": true, "message": "Study deleted successfully." }, { "studyDbId": "study2", "success": false, "message": "Study not found." }, { "studyDbId": "study3", "success": false, "message": "Cannot delete: study has associated observation units." } ] } }Status Codes:
200: Request processed (check individual success flags)400: Malformed request body401: Authentication required403: Insufficient permissions500: Server errorDesign Decisions
Pattern Consistency: Follows
POST /delete/imagesexactly:/delete/studiesstudyDbIdsdeletedStudiesDependency Handling: Specification does not mandate cascading deletion. Implementations decide validation rules (e.g., block deletion if observation units exist).
Operation Characteristics:
Security: The endpoint must enforce appropriate authorization to ensure only permitted users can delete studies. Implementations should verify the requesting user has the necessary permissions for each study before deletion.