I'm using the code below to remove the product from catelog - skincare ,
var name=pdict.categoryName;
var category=CatalogMgr.getCategory('skincare');
if(category && category.products.length){
for each(var product in category.products){
if(!product.custom.productBadge1){
var assignments = product.getCategoryAssignments();
for(var i=0;i<assignments.length;i++)
{
if(assignments[i].category.ID=='skincare'){
//TO DO remove product from category
}
}
}
}
}
which API to be used here
Well, one possible way is, you can write an XML to remove the assignment and import it manually or through a job. This can be the worst-case scenario.