Removes label assignments from entities in bulk. An organization can remove assignments from up to 10 entities per request. Only one identifier type (labelIds, labelNames, or labelExternalIds) may be provided per removal item.
Bash
curl -X DELETE "https://{host}/api_gateway/v2/labels/assignments" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"entityType": "PRODUCT",
"removals": [
{
"entityId": "SKU-001",
"labelIds": [101, 102]
}
]
}'
Requires authentication with a valid bearer token.
The token must have write access to the Labels resource.
Field Type Required Description entityTypeenum Required Entity type of the assigned entities. One of: CUSTOMER, PRODUCT, STORE. removalsarray Required List of removal objects. Maximum 10 per request. .entityIdstring Required Identifier of the entity to remove labels from. .labelIdsarray Conditional System-assigned label IDs to remove. Only one of labelIds, labelNames, or labelExternalIds may be provided per item. .labelNamesarray Conditional Display names of labels to remove. Only one of labelIds, labelNames, or labelExternalIds may be provided per item. .labelExternalIdsarray Conditional Caller-defined identifiers of labels to remove. Only one of labelIds, labelNames, or labelExternalIds may be provided per item.
JSON
{
"data": [
{
"entityId": "SKU-001",
"removedLabelIds": [101, 102]
}
]
}
Field Type Description dataarray Removal results per entity. .entityIdstring Entity identifier from the request. .removedLabelIdsarray System-assigned IDs of the labels removed from this entity.
Code Error number Type Description LABEL_INVALID_ENTITY_TYPE23006 Error entityType is not one of CUSTOMER, PRODUCT, STORE. HTTP 400.ASSIGNMENT_BATCH_SIZE_EXCEEDED23032 Error More than 10 removal items in a single request. HTTP 400.