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