Delete Entity
Delete an entity permanently.
This endpoint performs a soft delete on the specified entity, marking it as deleted while preserving the data for audit purposes. The entity will no longer appear in normal queries but can be recovered if needed.
Args: entity_id: Unique identifier of the entity to delete user: Authenticated user information (used for audit trails)
Returns: HTTP 204 (No Content) on successful deletion
Note: - This is typically a soft delete operation - Entity data is preserved for audit and recovery purposes - Deleted entities are excluded from normal queries - Some entities may have cascade delete rules for related data - A record of a company hidden from the caller is answered as a missing one: 204, and nothing is deleted - The service's delete gate (validate_entity_delete) runs before the delete, so a role refused an edit of the record is refused its delete
Raises: HTTPException: - 400: Invalid entity ID format - 401: Authentication required - 403: Insufficient permissions to delete this entity - 404: Entity not found (returns silently for idempotency) - 409: Cannot delete due to existing relationships - 500: Internal server error during deletion
Path Parameters
- Type: stringentity
_id required
Responses
- 204
Successful Response
- application/json
curl 'https://crm.dreamhub.ai/api/v1/contracts/{entity_id}' \
--request DELETE \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'

