iglooX DocsDevelopers

Guide

Message automations

Message automations match an incoming trigger message and send a merchant's configured steps. A stable share URL opens WhatsApp with the first trigger message prefilled. The user still needs to send that message. Typing any configured phrase directly starts the same steps, including for someone who is not a registered customer. The automation does not register them.

This release supports WhatsApp messages and static URL buttons. Other channels and custom actions are not available yet.

Create and share

Use POST /merchants/{uuid}/messaging/message-automations with messaging:write:

{
  "name": "Menu enquiries",
  "trigger_messages": [
    "Please send the menu",
    "Show me your menu"
  ],
  "steps": [
    {
      "send_when": "first_match",
      "interaction_scope": "merchant",
      "body": {
        "text": "Hi {{sender_profile_name}}, welcome to {{merchant_name}}.",
        "header": null,
        "action": null
      }
    },
    {
      "send_when": "always",
      "interaction_scope": "automation",
      "body": {
        "text": "View our latest menu.",
        "header": null,
        "action": {
          "type": "url",
          "label": "Open menu",
          "target": {
            "type": "static",
            "url": "https://example.com/menu?source=whatsapp"
          }
        }
      }
    }
  ]
}

Use the returned url, for example https://links.igloox.co/11111111-1111-4111-8111-111111111111, in a link or QR image. The API returns the stable URL rather than generating a QR image. Staging links use links.staging.igloox.co.

You can prepare an automation before connecting WhatsApp. Public links return an HTML unavailable page with 503 until the merchant has a usable connection. Unknown links return 404; archived links return 410. A successful GET returns 302 to the current WhatsApp destination. HEAD checks availability without counting an open. Handled responses prohibit caching and omit referrer information. The public host needs neither OAuth nor an API-version header.

Matching and changes

Matching uses the whole normalized phrase: case is ignored, apostrophes are removed, other punctuation becomes spaces, and extra whitespace is collapsed. For example, PLEASE send the menu! matches Please send the menu. Accent differences are retained. Phrases must be unique after normalization within the merchant, including archived automations, and cannot overlap registration, balance, top-up or PIN-reset commands. Later registration-command changes are checked against these reservations too. Standalone STOP is reserved for marketing opt-out. The opt-out check ignores case and surrounding whitespace.

PATCH /messaging/message-automations/{uuid} edits the name, trigger messages, steps or is_archived. Omitted fields keep their values; supplied arrays replace the complete ordered list. Reordering triggers changes the share link's prefilled message while retaining its URL. Removing or editing a phrase stops the old phrase matching, including text already prefilled in someone's WhatsApp app.

Archive with {"is_archived":true} and reactivate with {"is_archived":false} through the edit endpoint. Archival preserves history and phrase reservations, blocks new attempts and stops remaining steps at their next pre-send check. Reactivation requires a new matching message; it does not resume an earlier attempt.

Retrieve configuration with GET /messaging/message-automations/{uuid} or page-search with POST /merchants/{uuid}/messaging/message-automations/search. Either messaging:read or messaging:write is accepted. Searches include archived automations unless filters.is_archived is supplied, and filters.query searches names and original trigger phrases. All management operations enforce the principal's merchant access independently of scopes.

Steps and placeholders

Each step uses send_when, interaction_scope, then a nested body. Include text, header and action inside body, using null for an absent header or action. send_when and body are required; interaction_scope defaults to automation when omitted. Responses always include all three fields. Flattened steps and omitted conditions are rejected. Plain text, image/video headers and static HTTPS URL buttons are supported. A text header needs a URL action. The step schemas describe text/button bounds, allowed media and conditional text limits. Media must belong to the merchant. Quick replies and generated bot-action buttons are not supported.

Read capabilities.message_automations.supported_params from the merchant response to populate the step editor before creating an automation. It is available even when the merchant has no automations or WhatsApp connection, under the existing merchant-read authorization. Capabilities are read-only and are ignored when editing a merchant.

Automation responses retain the same list as supported_params. Both locations use the same { name, description, example } metadata and authoritative automation-text placeholder list:

  • {{merchant_name}}
  • {{merchant_contact_number}}
  • {{membership_benefits}}
  • {{loyalty_programs_list}}
  • {{sender_profile_name}}

{{sender_profile_name}} uses the incoming message sender's WhatsApp profile name for both members and guests. It resolves to N/A when the profile name is missing, empty or whitespace-only, even when a member has a saved customer name. The advertised metadata is:

{
  "name": "{{sender_profile_name}}",
  "description": "The incoming sender's WhatsApp profile name, or N/A if missing or blank.",
  "example": "Alex Tan"
}

Parameters are resolved for delivery of each step. Placeholders are supported only in message text. Headers, button labels and configured URLs remain static. Other customer and transaction placeholders, including {{customer_name}}, remain unsupported.

Eligible steps are sent in their configured order through the bot within the customer-service window, without submitting them as WhatsApp templates. Availability and the service window are checked again before each send. A failed send ends the attempt and abandons the remaining steps; there is no automatic resend or continuation. The same provider message ID is handled once, including duplicate webhook deliveries or queue redelivery. A deliberate resend with a new message ID starts a new attempt using current configuration.

A timeout can leave delivery uncertain, and interruption after an incoming message is claimed can leave some or all steps unsent. These attempts are not replayed. Delayed work outside the service window does not fall back to a submitted template.

First and repeat messages

Set each step's send_when to one of:

  • always: send for every new matching incoming message.
  • first_match: send only for the phone number's first matching message within the step's interaction_scope.
  • repeat_match: send only when that phone number already has a matching incoming message in that scope.

Choose each step's interaction_scope:

  • automation (default): matching-message history for this automation and normalized phone number.
  • merchant: matching-message history for the same merchant and phone number across all automations and outlets, including automations whose steps use automation scope. Other merchants' history never participates.

Different scopes can coexist in one sequence: use a merchant-wide welcome for the restaurant's table QR codes and an automation-specific introduction for a particular campaign. always sends regardless of scope. Changing a step's scope uses existing retained history and does not reset activity. When replacing steps, include each configured scope to retain it; omitting the scope on a supplied step defaults it to automation. Omitting the entire steps field on edit retains the complete sequence and scopes.

This is lifetime history across every trigger phrase. Registered members and guests use the same rules. QR opens do not identify the sender or change their first/repeat state; manually typed triggers count just like messages sent through the share link.

Both scope results are captured when the incoming message is claimed and remain fixed throughout its response sequence, using recording order rather than the provider's sent timestamp. Existing per-automation claim coordination is retained; concurrent messages to separate automations can both observe a first merchant-wide interaction. A late message can therefore count as a repeat even if its sent timestamp is earlier. A duplicate provider message ID does not create another attempt or another count.

Matching messages count even when replies fail, the service window has closed or no configured step qualifies. If every step is skipped, the message is still handled and counted, with no replies or template fallback. Edits to content or trigger phrases and archive/reactivate cycles preserve history; a different automation has independent history when using automation scope. Raw inbound-history cleanup does not reset it. There is no history-reset control or first/repeat reporting metric in this release.

Counts and daily reporting

Management responses include lifetime statistics with two counters:

  • link_opens: successful GET redirects, including QR scans, URL taps, repeated opens and preview fetches. HEAD and unavailable responses do not count. This does not measure unique visitors or distinguish scans from taps.
  • incoming_messages: matching incoming messages, counted once per provider message ID regardless of outbound success. Manually typed matches and deliberate resends count. This is not an outbound-delivery metric.

There is no individual attribution between opens and messages: someone can send a matching message without opening the link. History survives archival and routine raw inbound-message cleanup.

Use POST /messaging/message-automations/{uuid}/statistics with either messaging scope:

{
  "period": {
    "from": "2026-11-01T16:00:00Z",
    "to": "2026-11-04T16:00:00Z"
  }
}

Both boundaries must be whole-second UTC timestamps ending in Z. The start is inclusive and the end exclusive, with an ordered period of at most 366 merchant-local days. The report returns period, the merchant's current timezone, lifetime_totals, period_totals, zero-filled daily entries and generated_at. Each daily entry contains its local date, clipped UTC from/to, and both counters. Partial first/last days are included; daylight-saving days can have different elapsed lengths.

Events are stored in UTC. Link opens use redirect time; incoming messages use the provider's sent time, so late arrivals contribute to the day they were sent. Reports use the merchant's current timezone: changing it can rebucket historical daily counts without changing lifetime totals. Totals and daily entries are read from one consistent snapshot.

Recipient details in URL buttons

At delivery, iglooX adds or replaces igloox_customer_token on configured static URL buttons for every hostname, preserving other query parameters and fragments. This applies to message automations and existing direct/template messages, including unregistered recipients. Generated top-up and PIN-reset actions are excluded.

An integration can exchange that UUID using POST /merchants/{uuid}/customers/resolve-link with either customers:read or customers:write and access to the issuing merchant:

{
  "token": "22222222-2222-4222-8222-222222222222"
}

The response contains only these fields:

{
  "customer_uuid": null,
  "name": "Menu Guest",
  "mobile_number": "+6588888888"
}

Name and phone are captured when the token is issued; name may be null. customer_uuid is the current member associated with that phone in the issuing merchant, or null, including when membership changes after issuance. Tokens can be exchanged repeatedly until exactly 24 hours after issuance; exchanges do not consume them or extend expiry. The token UUID itself grants no exchange permission, OAuth access, login or redemption authority, and exchange does not register a member.

Malformed and former signed tokens fail request validation with 400. Well-formed unknown, expired or foreign-merchant tokens return 422 with customer_link_invalid.

This replaces the former signed-token/full-customer contract. Update consuming integrations before release. Existing approved external URL-button templates need resubmission through POST /messaging/templates/{uuid}/whatsapp-submissions to include the token placeholder. Ordinary template synchronization skips an already-approved matching body, so queueing synchronization alone does not update it.

Search documentation

Search across this documentation site.