Documentation Index Fetch the complete documentation index at: https://docs.contazen.ro/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Delete Expense Category endpoint allows you to permanently remove custom expense categories that are no longer needed. This operation has strict safety checks to prevent data loss.
Important Restrictions :
You can only delete custom categories that you created
System default categories cannot be deleted
Categories must have no expenses assigned to them
Categories must have no subcategories under them
Categories must belong to your firm
Path Parameters
The unique identifier of the expense category to delete
Safety Checks
Before deleting a category, the system performs several validation checks:
System Protection : Cannot delete system/default categories
Usage Check : Cannot delete categories that have expenses assigned
Hierarchy Check : Cannot delete categories that have subcategories
Ownership : Can only delete categories belonging to your firm
Response
Success message confirming the category deletion
The ID of the deleted category
Pre-Deletion Checklist
Before attempting to delete a category:
Move or delete all expenses using this category
Delete or reassign all subcategories under this category
Confirm it’s a custom category (not a system default)
Delete Category
Delete Category
Safe Delete with Checks
Delete Category
Safe Delete with Validation
curl -X DELETE "https://api.contazen.ro/v1/expense-categories/25" \
-H "Authorization: Bearer YOUR_API_KEY"
200 - Success
400 - Missing ID
404 - Not Found
403 - System Category
400 - Has Expenses
400 - Has Subcategories
403 - Permission Denied
500 - Delete Failed
{
"success" : true ,
"message" : "Category deleted successfully" ,
"id" : 25
}
Best Practices
Before Deleting Categories
Check Dependencies : Use the List Expenses API to find expenses using this category
Reassign Expenses : Move expenses to different categories before deletion
Handle Subcategories : Delete or reassign all subcategories first
Backup Important Data : Export expense data if the category contains historical records
Alternative to Deletion
Instead of deleting categories, consider:
Hide Categories : Set is_visible: false to hide unused categories
Rename Categories : Update the name for repurposing
Archive Approach : Keep historical categories for reporting consistency
Use your API key (sk_live_xxx or sk_test_xxx)