This performs a soft delete operation, marking the category as inactive while preserving data integrity and audit trails.
Deleting a category will also mark all its subcategories and objects as inactive. This action cannot be undone through the API.
Prerequisites
- Valid API key with category management permissions
- Category must exist and be accessible to your account
- Category should not have active subcategories or objects (will return 409 if it does)
Request
curl -X DELETE "https://api.g2cplatform.com/v2/categories/123e4567-e89b-12d3-a456-426614174000" \
-H "X-API-Key: your-api-key"
Path Parameters
| Parameter | Type | Required | Description |
|---|
categoryId | string (uuid) | Yes | Unique identifier for the category to delete |
Response
No content - category deleted successfully
Response Codes
| Status Code | Description |
|---|
| 204 | Category deleted successfully |
| 401 | Unauthorized - invalid API key |
| 404 | Category not found |
| 409 | Cannot delete category (has active subcategories or objects) |
| 500 | Internal server error |
Usage Notes
- Soft Delete: Categories are marked as inactive rather than permanently removed
- Cascade Effect: Deleting a category affects all subcategories and objects within it
- Audit Trail: Deletion events are logged for compliance and audit purposes
- Dependencies: Categories with active subcategories or objects cannot be deleted
- Recovery: Contact support if you need to recover a deleted category
Best Practices
- Check Dependencies: Use the Get Category endpoint to check for subcategories and objects before deletion
- Backup Important Data: Export or backup important category data before deletion
- Inform Users: Notify relevant users before deleting shared categories
- Use Carefully: Consider deactivating instead of deleting if you might need the category later