CORE-5649 extracted some validation logic
CORE-5649 filter out already attached
CORE-5650 Implemented endpoint
CORE-5601 change bulk attach/detach endpoint

The type can now be (attach|detach)