# Auto Reply

## Overview

Auto Reply lets you answer common WhatsApp messages instantly, around the clock, without an operator. You define keyword rules; when an incoming message matches a rule's keyword, WaDesk sends back the reply you configured automatically.

Open it from the Auto Reply page (admin/owner role). The page lists all your rules with a stats strip showing total rules, how many are active vs. paused, the total times they've fired, and how many fired in the last 24 hours. You can view rules as a list or a grid, and filter by number, status, or reply type. The page also highlights your top performers — the four most-triggered active rules.

> Always on. Auto replies fire on incoming messages even when no one is logged in. On every incoming message, WaDesk matches a rule, charges one message credit to the wallet of the number's owner, and sends the reply — all in the background, whether or not anyone is at the dashboard.

## How Matching Works

On every incoming message, WaDesk finds the number that received it and checks that number's active rules against the message in stages, returning the first rule that fires:

1. Direct match — the message is checked against each rule's keyword using its matching method (exact, contains, or fuzzy).
2. Saved translations — if nothing matched, WaDesk checks each rule's saved translations of the keyword.
3. Live translation — still nothing? It detects the message's language, translates it to English, and tries again. This catches any language the translator supports.
4. Fuzzy fallback — finally, fuzzy rules are checked by how similar the message is to the keyword.

The three matching methods:

Matching method | Fires when…
--- | ---
Exact | The message equals the keyword exactly (ignoring upper/lower case). Best for precise triggers like menu or stop.
Contains | The keyword appears anywhere in the message (so "what's your pricing plan?" matches the keyword pricing).
Fuzzy | The message is similar enough to the keyword, based on a similarity threshold you set (0–100, default 80). Catches typos like "pricng".

A single rule can hold several keywords at once — enter them as a comma-separated list (for example `hi, hello, hey`) and any one of them triggers the reply.

> Multilingual + auto-translate. Auto Reply detects the customer's language and will still match a rule even if they write the keyword in another language — either from a saved translation on the rule, or by detecting and translating it on the fly (cached for 24 hours, so a new language is only looked up once). The reply is then delivered in the matched language automatically, with no extra setup. Saving a rule is instant; the translation work happens when a message comes in, not when you save.

## Reply Types

When a rule matches it can do more than send text. Choose a reply type when you build the rule:

Reply type | What it sends
--- | ---
Custom | Your own content — text, image, video, document, or an approved template. Supports multiple content variants.
Flow | Starts an automation flow for the contact, handing the conversation to your visual flow builder (requires a valid, active flow).
Share contact | Sends a chosen contact's details (name, phone, email) back as a WhatsApp contact card.
Send catalog | Sends your product catalog as a multi-product list.
Request location | Asks the customer to share their location.

For custom replies, the message can be text, image, video, document, or a template. Text replies (and image/video captions) support `{{placeholder}}` variables that fill in before sending — both workspace-wide values (e.g. `{{promo_key}}`) and contact fields like `{{name}}`, `{{first_name}}`, `{{mobile}}`, and `{{email}}` — so the customer never sees a raw placeholder.

## Creating an Auto Reply

1. On the Auto Reply page, click Create.
2. Enter the keyword(s) — one word or a comma-separated list.
3. Pick the matching method (exact, contains, or fuzzy). For fuzzy, set the similarity percentage (0–100, default 80).
4. Choose the number(s) the rule applies to. If your workspace has more than one connected number you can select several, and WaDesk creates one rule per number for you.
5. Choose the reply type and fill in its content (your message variants, the flow, the target contact, the catalog, etc.).
6. Optionally set a cooldown and timeout (see below).
7. Save. New rules are active by default.

> Connect a number first. Auto replies fire on a specific WhatsApp number, so you need at least one active number in the workspace before you can create or import rules. The total number of auto-reply rules is set by your plan, and the feature itself must be included in your plan.

## Cooldowns & Timeouts

Two optional timers stop a rule from spamming a customer:

- Cooldown — the minimum number of seconds before the same rule fires again for the same contact. Prevents repeat replies when someone sends the keyword several times in a row.
- Timeout — a window (in seconds) used to govern how the rule behaves over a conversation.

Both accept 0 up to 86,400 seconds (24 hours). Leave them blank to keep the rule simple.

## Media Replies

A custom reply isn't limited to text. Set the message type to image, video, or document and upload the file when building the rule. Images and videos can carry a caption (which also supports placeholders). Documents are sent with their original filename so the customer recognizes them. WaDesk delivers each as the right WhatsApp message type.

## Managing Rules

From the list or grid view you can:

- Toggle a rule active or paused with one click — a paused rule never fires but is kept for later.
- Edit a rule to change its keywords, matching, number, reply, or timers. (Editing a rule that applies to several numbers changes only that one number's copy.)
- Delete a rule (its content files are removed too).
- Search rules by keyword, number, or reply content, and filter by number, status (active / paused), or type.

### Bulk Actions

Select several rules at once to delete, activate, or deactivate them together — handy when reorganizing a large rule set.

## Importing Rules from CSV

To set up many rules quickly, import them from a spreadsheet:

1. Click Import and download the sample CSV to see the exact column layout.
2. Fill in your rows using the columns below.
3. Upload the file (CSV or TXT, up to 5 MB). WaDesk reports how many rules were imported and how many rows were skipped.

The sample file ships with these column headers and two example rows:

Column | Meaning / accepted values
--- | ---
`keyword` | The trigger word(s). Required — rows with no keyword are skipped.
`matching_method` | `exact`, `contains`, or `fuzzy` (defaults to exact if blank or invalid).
`fuzzy_similarity` | 0–100 (defaults to 80).
`device_id` | Which number the rule applies to. Leave blank to use your first active number.
`reply_type` | `custom` (default), `flow`, `share_contact`, `send_catalog`, or `request_location`.
`message_type` | `text` (default), `image`, `video`, `document`, or `template`.
`reply_text` | The reply body (for custom text rules).
`status` | `active`/`paused` (also accepts 1/0, yes/no, true/false).
`cooldown`, `timeout` | Seconds (0–86400).

> Smart matching. The importer recognizes common column-name spellings (for example `keywords`, `trigger`, `match_type`, `device_phone`, `message`/`body`), matches a row to a number by its ID or its phone number, and falls back to your first active number when none is named. Rows are skipped when they have no keyword, a custom-text rule with no reply text, or a flow type pointing at a flow that isn't in this workspace. Re-importing the same keyword for the same number updates the existing rule rather than creating a duplicate.

## Engine Support

Auto Reply works across all three WhatsApp engines. Each rule is tied to the engine of the number it's attached to, and the Auto Reply page only shows rules for the workspace's active engine. So a workspace that switches engines won't see rules from the old one, and a multi-engine workspace can have Unofficial API rules on one number and Cloud API rules on another at the same time.

> Out of credits. If the number's owner has an empty wallet, the auto reply doesn't go out — WaDesk stays quiet. It still records that the keyword would have matched, so your analytics stay accurate.

## Per-Rule Analytics

Open a rule's detail page to see how it's performing over the last 30 days:

- A recent fires feed (last 8) and the top contacts who triggered it.
- An hour-of-day heatmap and a daily firing chart (30 days).
- Which keyword variant matched, and how many unique customers triggered it.
- A conversion funnel: incoming messages → matched any rule → matched this rule → reply sent. Note that the "reply sent" stage reflects matched/triggered auto-replies, not a delivery confirmation — it mirrors the matched count rather than a delivery receipt.
- Average response time — how fast the rule finds a match, a real ceiling on how quickly it can respond.

The list page also shows total triggers, the active/paused split, fires in the last 24 hours, and your top-performing active rules.

## Troubleshooting

Symptom | Likely cause & fix
--- | ---
Rule never fires | Check it's active, set to the right number, and that the number is the one the customer messaged. Exact-match rules only fire on the whole message — switch to contains for phrases.
Fires once then goes quiet | The cooldown is doing its job — the same contact can't re-trigger the same rule until the cooldown passes. Lower or clear it if you want repeats.
Matched in analytics but nothing delivered | The number owner's wallet ran out of credits; the match is still logged. Top up the wallet.
Rule disappeared from the list | The workspace's active engine was switched — the list only shows rules for the current engine. Switch back, or recreate the rule on the new engine's number.
Customer sees raw `{{name}}` | No matching contact for that number, or the field is empty. Add the contact, or remove the placeholder.
CSV rows skipped on import | Most often: missing keyword, a custom-text rule with no reply text, or a flow type pointing at a flow that isn't in this workspace.