Skip to main content

Examples

These examples start simple and build up. Each shows the alert in plain language, then the full body for POST /v2/businesses/{business}/alerts. In the dashboard you build the same thing with the alert builder, or describe it to Harlyy AI.

IDs such as loc_gulberg and rcat_hygiene are placeholders. Use the IDs of your own locations, surveys, steps and so on. Review category IDs come from GET /v2/review-categories.

Simple​

Every one-star review​

Notify me whenever anyone leaves a one-star review.

{
"name": "One-star reviews",
"type": "review",
"conditions": {
"logic": "all",
"conditions": [{ "field": "rating", "operator": "eq", "values": ["1"] }]
},
"settings": { "staff": ["staff_me"] }
}

settings.mode defaults to instant and channels to all of them, so this emails, pushes and WhatsApps you about each one-star review as it arrives.

Every review of a new branch​

While our DHA branch is new, tell the manager about every review.

{
"name": "All DHA reviews",
"type": "review",
"scope": {
"logic": "all",
"conditions": [
{ "field": "location", "operator": "eq", "values": ["loc_dha"] }
]
},
"conditions": { "logic": "all", "conditions": [] },
"settings": { "staff": ["staff_dha_manager"], "channels": ["whatsapp"] }
}

Empty conditions match everything in scope.

Bad survey ratings at one location​

Email the Gulberg team when a Dine-in submission at Gulberg rates any question 2 or below.

{
"name": "Gulberg bad ratings",
"type": "survey",
"scope": {
"logic": "all",
"conditions": [
{ "field": "survey", "operator": "eq", "values": ["sur_dine_in"] },
{ "field": "location", "operator": "eq", "values": ["loc_gulberg"] }
]
},
"conditions": {
"logic": "all",
"conditions": [
{ "field": "lowestRating", "operator": "lte", "values": ["2"] }
]
},
"settings": { "teams": ["team_gulberg"], "channels": ["mail"] }
}

A mention of a phrase​

Tell me when a Google review mentions burnt pizza.

{
"name": "Burnt pizza",
"type": "review",
"scope": {
"logic": "all",
"conditions": [
{ "field": "platform", "operator": "eq", "values": ["google"] }
]
},
"conditions": {
"logic": "all",
"conditions": [
{
"field": "content",
"operator": "contains-any",
"values": [
"burnt pizza",
"burned pizza",
"pizza burn*",
"charred pizza",
"overcooked pizza"
],
"text": { "match": "phrase", "proximity": 2 }
}
]
},
"settings": { "staff": ["staff_me", "staff_head_chef"] }
}

proximity: 2 also catches "the pizza was completely burnt", and burn* catches burnt, burned and burning.

Intermediate​

Hygiene complaints​

Email the operations team about any review that complains about hygiene, whatever words they use.

Topics are labelled sentence by sentence, so negativeCategories catches "the toilets were filthy" without the word hygiene. The phrases catch reviews whose topics haven't been analysed, such as very short ones.

{
"name": "Hygiene complaints",
"type": "review",
"conditions": {
"logic": "any",
"conditions": [
{
"field": "negativeCategories",
"operator": "contains-any",
"values": ["rcat_hygiene"]
},
{
"field": "content",
"operator": "contains-any",
"values": [
"dirty",
"filthy",
"unhygienic",
"unclean",
"cockroach*",
"rat",
"rats",
"hair in",
"smelly toilet*"
]
}
]
},
"settings": { "teams": ["team_operations"], "channels": ["mail"] }
}

A specific survey question​

When someone rates "How was the food temperature?" 1 or 2 and mentions it was cold, tell the kitchen.

step.* fields read one survey step, so they need the step ID, and the step must be on the survey in scope.

{
"name": "Cold food",
"type": "survey",
"scope": {
"logic": "all",
"conditions": [
{ "field": "survey", "operator": "eq", "values": ["sur_dine_in"] }
]
},
"conditions": {
"logic": "all",
"conditions": [
{
"field": "step.rating",
"step": "step_food_temperature",
"operator": "in",
"values": ["1", "2"]
},
{
"field": "comment",
"operator": "contains-any",
"values": ["cold", "lukewarm", "luke warm", "not hot", "freezing"]
}
]
},
"settings": { "teams": ["team_kitchen"] }
}

A staff member mentioned​

Tell me when a submission is about Ali and picks the "Rude" metric.

{
"name": "Ali – rude",
"type": "survey",
"scope": {
"logic": "all",
"conditions": [
{ "field": "survey", "operator": "eq", "values": ["sur_dine_in"] }
]
},
"conditions": {
"logic": "all",
"conditions": [
{ "field": "staff", "operator": "contains-any", "values": ["staff_ali"] },
{
"field": "step.metrics",
"step": "step_service_metrics",
"operator": "contains-any",
"values": ["met_rude"]
}
]
},
"settings": { "staff": ["staff_me"] }
}

Unreplied bad reviews, with a cooldown​

Remind the marketing team about low-rated Google reviews without a reply, at most once every 6 hours.

{
"name": "Unreplied bad reviews",
"type": "review",
"scope": {
"logic": "all",
"conditions": [
{ "field": "platform", "operator": "eq", "values": ["google"] }
]
},
"conditions": {
"logic": "all",
"conditions": [
{ "field": "rating", "operator": "lte", "values": ["3"] },
{ "field": "hasReply", "operator": "eq", "values": ["false"] }
]
},
"settings": { "teams": ["team_marketing"], "cooldown": "6h" }
}

Viral complaints on social media​

WhatsApp me when a TikTok or Instagram complaint about us passes 1,000 views.

{
"name": "Viral complaints",
"type": "social",
"scope": {
"logic": "all",
"conditions": [
{
"field": "platform",
"operator": "in",
"values": ["tiktok", "instagram"]
}
]
},
"conditions": {
"logic": "all",
"conditions": [
{
"field": "intents",
"operator": "contains-any",
"values": ["complaint", "health & safety"]
},
{ "field": "views", "operator": "gte", "values": ["1000"] }
]
},
"settings": { "staff": ["staff_me"], "channels": ["whatsapp"] }
}

Engagement is counted when Harlyy analyses the post, so this catches posts that were already popular when found.

A competitor's rating drops​

Tell me when any competitor's Google rating drops by 0.1 or more.

{
"name": "Competitor rating drops",
"type": "competitor-listing",
"scope": {
"logic": "all",
"conditions": [
{ "field": "platform", "operator": "eq", "values": ["google"] }
]
},
"conditions": {
"logic": "all",
"conditions": [
{ "field": "ratingChange", "operator": "lte", "values": ["-0.1"] }
]
},
"settings": { "staff": ["staff_me"] }
}

Advanced​

A spike in bad submissions​

If at least 5 submissions in an hour rate anything 2 or below, and that's at least 30% of the submissions that hour, alert the area managers, at most every 6 hours.

{
"name": "Bad submission spike",
"type": "survey",
"scope": {
"logic": "all",
"conditions": [
{ "field": "survey", "operator": "eq", "values": ["sur_dine_in"] }
]
},
"conditions": {
"logic": "all",
"conditions": [
{ "field": "lowestRating", "operator": "lte", "values": ["2"] }
]
},
"settings": {
"mode": "threshold",
"interval": "1h",
"minimum": 5,
"percentage": 0.3,
"cooldown": "6h",
"teams": ["team_area_managers"]
}
}

The percentage is a share of the in-scope submissions (Dine-in), so a busy hour with a few unhappy customers doesn't notify, while a run of bad experiences in a quiet hour does.

Food safety, everywhere​

Any review, of any platform, that's negative about food safety, or mentions food poisoning, except Foodpanda reviews that only complain about delivery. Tell the food safety team instantly.

{
"name": "Food safety",
"type": "review",
"conditions": {
"logic": "all",
"groups": [
{
"logic": "any",
"conditions": [
{
"field": "negativeCategories",
"operator": "contains-any",
"values": ["rcat_food_safety", "rcat_hygiene"]
},
{
"field": "content",
"operator": "contains-any",
"values": [
"food poisoning",
"got sick",
"fell sick",
"stomach ache",
"vomit*",
"diarrh*",
"undercooked chicken",
"raw chicken"
],
"text": { "match": "phrase", "proximity": 1 }
}
]
},
{
"logic": "all",
"negate": true,
"conditions": [
{ "field": "platform", "operator": "eq", "values": ["food-panda"] },
{
"field": "negativeCategories",
"operator": "contains-all",
"values": ["rcat_delivery"]
},
{
"field": "negativeCategories",
"operator": "not-contains",
"values": ["rcat_food_safety", "rcat_hygiene"]
}
]
}
]
},
"settings": { "teams": ["team_food_safety"] }
}

Read it as: (food-safety topic or a food-poisoning phrase) and not (a Foodpanda review whose complaints are about delivery and not food safety).

Several surveys, one question each​

Across our Dine-in and Delivery surveys, alert me when the "Overall" question on either is rated 1.

A submission answers one survey, so steps from two surveys must be alternatives (any), never both required. The scope allows either survey.

{
"name": "Overall rated 1",
"type": "survey",
"scope": {
"logic": "all",
"conditions": [
{
"field": "survey",
"operator": "in",
"values": ["sur_dine_in", "sur_delivery"]
}
]
},
"conditions": {
"logic": "any",
"conditions": [
{
"field": "step.rating",
"step": "step_dine_in_overall",
"operator": "eq",
"values": ["1"]
},
{
"field": "step.rating",
"step": "step_delivery_overall",
"operator": "eq",
"values": ["1"]
}
]
},
"settings": { "staff": ["staff_me"] }
}

Requiring both ("logic": "all") is rejected as a contradiction.

High-value unhappy customers​

Tell the guest relations team about abandoned or completed submissions with contact details, a fraud risk under 40, and either a bad rating or an angry comment, but not if they attached nothing and wrote nothing.

{
"name": "Recoverable unhappy guests",
"type": "survey",
"scope": {
"logic": "all",
"conditions": [
{ "field": "survey", "operator": "eq", "values": ["sur_dine_in"] },
{ "field": "hasCustomer", "operator": "eq", "values": ["true"] }
]
},
"conditions": {
"logic": "all",
"conditions": [
{ "field": "riskScore", "operator": "lt", "values": ["40"] }
],
"groups": [
{
"logic": "any",
"conditions": [
{ "field": "lowestRating", "operator": "lte", "values": ["2"] },
{
"field": "comment",
"operator": "contains-any",
"values": [
"never again",
"worst",
"disgusting",
"refund",
"manager",
"complain*"
]
}
]
},
{
"logic": "all",
"negate": true,
"conditions": [
{ "field": "comment", "operator": "not-exists" },
{ "field": "hasMedia", "operator": "eq", "values": ["false"] }
]
}
]
},
"settings": {
"teams": ["team_guest_relations"],
"channels": ["mail", "mobile"]
}
}

riskScore lt 40 doesn't match submissions whose risk isn't calculated yet. Use any of riskScore lt 40 and riskScore not-exists to include them.

Brand reputation on social, in Urdu​

Alert the social team about Urdu or English posts and comments on our own accounts that are negative about us, or any post that's a lead.

{
"name": "Own accounts: negative or leads",
"type": "social",
"scope": {
"logic": "all",
"conditions": [
{ "field": "ownAccount", "operator": "eq", "values": ["true"] },
{ "field": "language", "operator": "in", "values": ["ur", "en"] }
]
},
"conditions": {
"logic": "any",
"conditions": [
{
"field": "sentiment",
"operator": "contains-any",
"values": ["negative", "mixed"]
},
{ "field": "intents", "operator": "contains-any", "values": ["lead"] }
]
},
"settings": { "teams": ["team_social"], "cooldown": "30m" }
}

Competitors losing on what you're good at​

When a competitor gets a review complaining about service, tell marketing, so we can lean on our service in campaigns.

{
"name": "Competitor service complaints",
"type": "competitor-review",
"conditions": {
"logic": "all",
"conditions": [
{ "field": "rating", "operator": "lte", "values": ["2"] },
{
"field": "negativeCategories",
"operator": "contains-any",
"values": ["rcat_service", "rcat_staff"]
}
]
},
"settings": {
"teams": ["team_marketing"],
"channels": ["mail"],
"cooldown": "1d"
}
}