Product Tags API
Manage product tags across your catalog: list, rename, merge, and delete tags via the Admin API.
Overview
Tags are free-form labels attached to products. They power collection filtering, search facets, and custom storefront logic. The Tags API provides centralized management — rename a tag once and it updates across all products atomically.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /admin/tags | List all tags with product counts |
PUT | /admin/tags/:tag/rename | Rename a tag across all products |
DELETE | /admin/tags/:tag | Remove a tag from all products |
curl -X GET "https://cartly.pro/admin/tags" \
-H "Authorization: Bearer ADMIN_JWT"
# Response
# [
# { "tag": "summer", "count": 24 },
# { "tag": "sale", "count": 12 },
# { "tag": "new-arrival", "count": 8 }
# ]curl -X PUT "https://cartly.pro/admin/tags/summer/rename?new_name=summer-collection" \
-H "Authorization: Bearer ADMIN_JWT"
# Updates all products that have the "summer" tag
# Returns: 200 OK with updated countcurl -X DELETE "https://cartly.pro/admin/tags/old-promo" \
-H "Authorization: Bearer ADMIN_JWT"
# Removes "old-promo" from all products
# Returns: 204 No ContentUsing Tags on Products
Tags are stored as a string[] field on products. To add or update tags on a product, include the tags array in any product update request.
curl -X PUT "https://cartly.pro/admin/products/PRODUCT_ID" \
-H "Authorization: Bearer ADMIN_JWT" \
-H "Content-Type: application/json" \
-d '{
"tags": ["summer", "sale", "new-arrival"]
}'The array replaces all existing tags. To append a tag, fetch the current tags first and include them in the new array.
Collection Tag Filtering
Collections support tag-based automatic filtering via the tag_filter field. When set, only products with the matching tag are included in collection results on the storefront and in the Admin API.
curl -X PUT "https://cartly.pro/admin/collections/COLLECTION_ID" \
-H "Authorization: Bearer ADMIN_JWT" \
-H "Content-Type: application/json" \
-d '{
"tag_filter": "summer"
}'
# Collection will now include only products tagged with "summer"Tag filtering is evaluated at query time — adding or removing a tag from a product immediately affects which collections it appears in.