Add or remove tags on one or more entities. This playground calls the live API and will modify data.
Add or remove tags across every entity in a scope — an explicit list of ids, or everything matching a filter tree.
Both endpoints take the same body and differ only in direction. Only MongoDB is written inside the request; the search index catches up from the Change Stream a moment later, so an immediate re-query may still show the previous tags.
POST https://api.commerceclarity.com/api/2026-05/entities/tags/addPOST https://api.commerceclarity.com/api/2026-05/entities/tags/remove
Send either ids or filters. If both are present, ids wins and filters is ignored.
| Parameter | Type | Required | Description |
|---|---|---|---|
tags | array | Required | Non-empty array of tag names. Names the brand does not have yet are created on tags/add. No length limit. |
ids | array | Required | Non-empty array of entity _id strings. Required unless filters is sent. |
filters | object | Required | Filter tree — the same one List / Query entities takes. Tags everything it matches. Required unless ids is sent. |
filters.operator | string | Required | and or or. Mandatory whenever filters is present. |
filters.conditions | array | Optional | An empty or omitted condition list is the deliberate whole catalogue scope. |
brand_id | string | Optional | Override the active brand. |
filters scope may resolve at most 5 000 entities. The count is checked before anything is written — including before any new tag is created — so a refused request leaves no trace. An ids scope is not capped.Names are trimmed, empties are dropped, and duplicates are removed case-insensitively — the first spelling in the array wins, so the same tag cannot end up stored twice under different casing. If nothing usable is left, the request is refused with 422 and the message No usable tag names were provided.
On tags/add, names that do not exist yet are created as tags of the active brand: tagging is also how the brand's tag catalogue grows.
updated can be higher than the number of entities in the scope.inventory_tags field.curl -X POST "https://api.commerceclarity.com/api/2026-05/entities/tags/add" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tags": ["black-friday", "clearance"],
"ids": ["507f1f77bcf86cd799439011", "507f1f77bcf86cd799439012"]
}'
curl -X POST "https://api.commerceclarity.com/api/2026-05/entities/tags/add" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tags": ["black-friday"],
"filters": {
"operator": "and",
"conditions": [
{ "field": "family_id", "op": "is", "value": "507f1f77bcf86cd7994390f0" }
]
}
}'
curl -X POST "https://api.commerceclarity.com/api/2026-05/entities/tags/remove" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tags": ["black-friday"],
"filters": {
"operator": "and",
"conditions": [
{ "field": "inventory_tags", "op": "is", "value": "black-friday" }
]
}
}'
{
"status": "success",
"message": "Tags added",
"updated": 51
}message is Tags removed on the remove endpoint. updated counts the entities whose tags were touched, sibling variants included.
{
"status": "error",
"message": "The tags field is required."
}{
"status": "error",
"message": "The selection matches 12480 entities, more than the 5000 allowed for a single bulk action. Narrow the filters and try again.",
"total": 12480,
"limit": 5000
}{
"status": "error",
"message": "Unable to resolve the selected products: <reason>"
}