Handle Incoming Webhooks

Overview

The Handle Incoming Webhook trigger allows you to start a Flow when data is sent to Zaapi from an external system — such as your eCommerce platform, CRM, or any third-party tool.

When an external system sends a POST request to your Flow’s webhook URL, Zaapi will receive that data, make it available as variables within the Flow, and automatically continue with the next steps (such as sending a message or searching for a contact).

This is especially useful for automating workflows that depend on external events — for example, when an order is placed, a payment is confirmed, or a support ticket is updated.


How it Works

  1. Webhook URL Every Flow using this trigger gets its own unique webhook URL. Example:

    https://webhooks.zaapi.co/triggers/g8Yvbr0paWV9Fi5lWbEQ

    You can send a POST request to this URL from your external system.

  2. Example Data You can define an example JSON payload to configure which variables Zaapi should extract. Example:

    {
      "customer_name": "Jane Doe",
      "phone_number": "+66912345678",
      "order_number": "ORD12345",
      "total_amount": 2500
    }

    Once saved, these fields will appear as variables that can be referenced in later steps of your Flow.

  3. Variables Mapping After defining your example JSON, Zaapi automatically detects the variable names (keys) and makes them available for use in your workflow. For example, you can use:

    • {{customer_name}}

    • {{order_number}}

    • {{total_amount}}

  4. Search Contact Node Zaapi also provides a Search Contact node that allows you to find an existing customer in your account based on incoming webhook data (like email or phone number). This lets you connect external events (e.g., new order) to the right customer in Zaapi automatically.


Example Use Case: Send WhatsApp Message After an Order is Placed

Here’s an example of how you might use this trigger:

  1. In your eCommerce platform, set up a webhook to send order data to Zaapi whenever a new order is placed. The payload might look like this:

    {
      "customer_name": "Jane Doe",
      "phone_number": "+66912345678",
      "order_number": "ORD12345",
      "total_amount": 2500
    }
  2. In Zaapi Flow Builder:

    • Add the Webhook received trigger.

    • Paste in the example JSON payload above to configure the variables.

    • Add a Search Contact node to find the customer in Zaapi by their phone_number.

    • Then add a Send WhatsApp Message node and choose a WhatsApp template message. You can personalize the message using variables like:

      Hi {{customer_name}}, thanks for your order! 🎉  
      Your order number is {{order_number}} with a total of {{total_amount}} THB.  
      We'll update you once it’s shipped!
  3. Test and Publish the Flow. Each time your store sends an order webhook, Zaapi will automatically trigger this Flow and send the personalized message to the correct customer.


Tips

  • Always make sure your webhook URL is kept private — anyone with the link can send data to your Flow.

  • You can test your webhook by sending a POST request from tools like Postman or cURL.

  • Keep your example data simple and representative of real payloads, so variable mapping works correctly.

  • You can chain additional steps after receiving the webhook, such as updating a CRM record, tagging a contact, or notifying a support agent.

Last updated

Was this helpful?