Endpoint
subcategory_id set to NULL automatically.
Authentication
This endpoint requires authentication via Bearer token and CSRF protection.Path Parameters
The UUID of the category to delete.
Response
Indicates whether the deletion was successful.
Confirmation message.
Example Request
Example Response
Error Responses
Not Found - Category does not exist or user does not have access.
Related Endpoints
Get Orphaned Transaction Count
Before deleting a category, you may want to check how many transactions will be affected:Example Request
Example Response
Reassign Transactions
To reassign transactions to another category before deletion:Request Body
The UUID of the destination category to reassign transactions to. Must belong to the same account.
Example Request
Example Response
Reassign Error Responses
Bad Request - Missing destination category or categories from different accounts.or
Not Found - Source or destination category not found.or
Recommended Workflow
- Check orphaned count: Use
GET /api/categories/:id/orphaned-countto see how many transactions will be affected - Reassign if needed: If transactions exist, use
POST /api/categories/:id/reassignto move them to another category - Delete category: Finally, use
DELETE /api/categories/:idto remove the category
Notes
- Deleting a category automatically sets
subcategory_idto NULL for all associated transactions - The database uses
ON DELETE SET NULLconstraint for this behavior - Subcategories associated with the category are also deleted (cascade delete)
- The user must own the category or have access to the associated account
- Consider using the reassign endpoint to preserve transaction categorization
