Manage contact labels for email marketing when segments don't fit the criteria. Labels allow manual or programmatic tagging of contacts for campaign targeting.
From wix-ecom-coworknpx claudepluginhub itayher/wix-ecom-cowork --plugin wix-ecom-coworkThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Manage contact labels for email marketing when segments don't fit the criteria. Labels allow manual or programmatic tagging of contacts for campaign targeting.
df7c18eb-009b-4868-9891-15e19dddbe67${API_KEY}${SITE_ID}Labels in Wix use format: custom.label-name
Examples:
custom.itay-test1custom.high-value-customerscustom.recent-buyerscustom.vip-2024Endpoint: POST https://www.wixapis.com/contacts/v4/contacts/query
Query contacts based on criteria, then assign labels:
curl -X POST "https://www.wixapis.com/contacts/v4/contacts/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": {},
"paging": {
"limit": 100,
"offset": 0
}
}
}'
Response:
{
"contacts": [
{
"id": "contact-123",
"emailAddress": "customer@example.com",
"firstName": "John",
"lastName": "Doe",
"labels": ["custom.vip", "custom.newsletter"]
}
],
"metadata": {
"count": 100,
"total": 523
}
}
Find contacts who meet USER'S criteria (spend amount and timeframe from user request):
# Get orders from last week
DAYS_AGO=7
START_DATE=$(date -u -v-${DAYS_AGO}d +"%Y-%m-%dT00:00:00.000Z" 2>/dev/null || date -u -d "${DAYS_AGO} days ago" +"%Y-%m-%dT00:00:00.000Z")
orders=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d "{
\"query\": {
\"filter\": \"{\\\"dateCreated\\\": {\\\"\\$gte\\\": \\\"$START_DATE\\\"}, \\\"paymentStatus\\\": \\\"PAID\\\"}\",
\"paging\": {\"limit\": 1000}
}
}")
# Aggregate by customer email, filter by spend
high_spenders=$(echo "$orders" | jq -r '
[.orders[] | {email: .buyerInfo.email, total: (.priceSummary.total | tonumber)}] |
group_by(.email) |
map({
email: .[0].email,
totalSpent: ([.[].total] | add)
}) |
map(select(.totalSpent >= 100)) |
.[].email
')
echo "Found $(echo "$high_spenders" | wc -l) high spenders"
contact_ids=()
echo "$high_spenders" | while read -r email; do
contact=$(curl -s -X POST "https://www.wixapis.com/contacts/v4/contacts/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d "{
\"query\": {
\"filter\": \"{\\\"emailAddress\\\": \\\"${email}\\\"}\"
}
}")
contact_id=$(echo "$contact" | jq -r '.contacts[0].id // empty')
if [ -n "$contact_id" ]; then
echo "$contact_id"
fi
done > /tmp/contact_ids.txt
contact_count=$(cat /tmp/contact_ids.txt | wc -l)
echo "ā Found ${contact_count} contact IDs"
LABEL_ID="custom.high-spenders-last-week"
echo "š·ļø Assigning label '${LABEL_ID}' to ${contact_count} contacts..."
assigned=0
cat /tmp/contact_ids.txt | while read -r contact_id; do
# Update contact to add label
curl -s -X PATCH "https://www.wixapis.com/contacts/v4/contacts/${contact_id}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"info": {
"labelKeys": {
"add": ["'"${LABEL_ID}"'"]
}
}
}
}' > /dev/null
assigned=$((assigned + 1))
echo " ā
Contact ${assigned}/${contact_count}"
sleep 0.1
done
echo "\nā
Labeled ${assigned} contacts with '${LABEL_ID}'"
Format: custom.descriptive-name
Good Examples:
custom.vip-customers-2024custom.abandoned-cart-last-weekcustom.spent-{amount}-plus (amount from user criteria)custom.repeat-buyerscustom.new-subscribersBad Examples:
custom.label1custom.testcustom.abcCustomers who spent ${USER_AMOUNT}+ in last ${USER_DAYS} days:
Note: USER_AMOUNT and USER_DAYS come from user's request, not hardcoded!
LABEL_ID="custom.recent-big-spenders"
MIN_SPEND=200
DAYS=14
# Query orders ā filter by spend ā get emails ā get contact IDs ā assign label
Customers who added to cart but didn't purchase:
LABEL_ID="custom.cart-abandoners-feb"
# Query cart abandonment events
# Get contact IDs
# Assign label
Customers who bought from specific category:
LABEL_ID="custom.electronics-buyers"
CATEGORY_ID="electronics-cat-id"
# Query orders with products from category
# Extract buyer emails
# Get contact IDs
# Assign label
CONTACT_ID="contact-123"
LABEL_TO_REMOVE="custom.old-label"
curl -X PATCH "https://www.wixapis.com/contacts/v4/contacts/${CONTACT_ID}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"info": {
"labelKeys": {
"remove": ["'"${LABEL_TO_REMOVE}"'"]
}
}
}
}'