Skip to main content
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

ParameterTypeRequiredDescription
categoryIdstring (uuid)YesUnique identifier for the parent category
subcategoryIdstring (uuid)YesUnique identifier for the subcategory to delete

Response

No content - subcategory deleted successfully

Response Codes

Status CodeDescription
204Subcategory deleted successfully
401Unauthorized - invalid API key
404Subcategory or parent category not found
409Cannot delete subcategory (has active objects)
500Internal 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

  1. Check Dependencies: Use the Get Subcategory endpoint to check for objects before deletion
  2. Move Objects First: Consider moving objects to another subcategory before deletion
  3. Backup Important Data: Export or backup important subcategory data before deletion
  4. Inform Users: Notify relevant users before deleting shared subcategories
  5. Use Carefully: Consider deactivating instead of deleting if you might need the subcategory later