cURL
curl --request DELETE \ --url https://api.example.com/api/management/categories/{id}
{ "success": true, "timestamp": "<string>", "data": null, "message": "<string>", "error": {} }
Delete a category by ID
DELETE /api/management/categories/{id}
Authorization: Bearer <token>
curl -X DELETE "http://localhost:8080/api/management/categories/1" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
{ "success": true, "timestamp": "2026-03-03T10:30:00Z", "data": null, "message": "Category deleted successfully", "error": null }
{ "success": false, "timestamp": "2026-03-03T10:30:00Z", "data": null, "message": null, "error": { "message": "Category not found with id: 999", "details": [] } }
{ "success": false, "timestamp": "2026-03-03T10:30:00Z", "data": null, "message": null, "error": { "message": "Unauthorized", "details": [] } }
{ "success": false, "timestamp": "2026-03-03T10:30:00Z", "data": null, "message": null, "error": { "message": "Access denied. ADMIN role required.", "details": [] } }
{ "success": false, "timestamp": "2026-03-03T10:30:00Z", "data": null, "message": null, "error": { "message": "Cannot delete category as it is associated with existing books", "details": [] } }
apps/spring-boot-app/src/main/java/me/seyrek/library_management_system/category/controller/CategoryManagementController.java:34