# Webhooks

This feature empowers users to transmit data and notifications from Whautomate to other platforms, streamlining communication and automation processes.

## General Use Cases

The list of webhook events is currently available for use. 👇

**Clients**

* **Client Created:** Triggered when a new client is created
* **Client Tag Added:** Triggered when a tag is added to the client
* **Client Tag Removed:** Triggered when a tag is removed from the client

**Contacts**

* **Contact Created:** Triggered when a new contact is created
* **Contact Tag Added:** Triggered when a tag is added to the contact
* **Contact Tag Removed:** Triggered when a tag is removed from the contact&#x20;

**Messages**

* **WhatsApp, Instagram, Messenger, Telegram** and **Live Chat Incoming Messages:** \
  Triggered when a new message is received from the client.
* **WhatsApp, Instagram, Messenger, Telegram** and **Live Chat Outgoing Messages:** \
  Triggered when sending a new message to the client.

**Appointments**

* **Appointment Updates:** Triggered when an appointment is **booked, rescheduled, cancelled,** etc by a client.

**Classes**

* **Class Participant Updates:** Triggered when a class is **booked, rescheduled, cancelled,** etc by a client.

**Invoices**

* **Invoice Updates:** Triggered when an invoice is **created** or the invoice status is updated as a **draft,** **paid, pending, and sent.**

## Here are two methods to setup a webhook.

### **1. Setting Up a New Webhook**

{% hint style="info" %}

* You can configure up to 5 webhooks, each capable of notifying your application about multiple selected events.
* Note that this method does not offer a customized payload option; only HTTP POST requests are supported.
  {% endhint %}

**Step 1:** Go to the **Whautomate app,** select the **Integration** menu option, and Select the **Webhooks** **Connect** button to continue.

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FFLvUtCsT5RgybEgfUBQJ%2Fimage.png?alt=media&#x26;token=f31df605-379f-45ff-bfef-4347c1693ff5" alt=""><figcaption></figcaption></figure>

Step 2: Select the **New Webhook** button to continue

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FjU4roluDeabGHofcWO2b%2Fimage.png?alt=media&#x26;token=5d5b252f-1148-4337-85a7-43c52f7c5877" alt=""><figcaption></figcaption></figure>

**Step 3: Configure Webhook Settings**

**(i)** Enter the Webhook name Eg. **Contact Created**

**(ii)** Enter **the Server URL** where the webhook notifications will be sent.

**(iii)** Choose the events you want to receive notifications for. You can select multiple events for a single webhook. Eg. **Contact Created**

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FFPEFmuMdZRqKCnDYKCEH%2Fimage.png?alt=media&#x26;token=16a31545-b958-4c79-a81d-3f295eb49fe5" alt=""><figcaption></figcaption></figure>

Step 4: **Save** your webhook configuration.

Test the webhook to ensure it is working correctly.

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2F4h8KnPochTROB3HLJVfZ%2Fimage.png?alt=media&#x26;token=b3e78397-f2a4-4b87-b0d1-1952dc9d9743" alt=""><figcaption></figcaption></figure>

### **2. Setting Up a Customized Webhook with Payload Customization**

{% hint style="success" %}
This method allows you to send custom webhook payloads via RESTful endpoints, offering flexibility in data transfer and integration with external applications.
{% endhint %}

Step 1: Go to the **Whautomate app,** Select the **Automation** menu option, Click the **Add Rule** button, and then select the **Create Rule From Scratch** option to continue.

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FZnkHA6pXOcRrYnw4Zxpg%2FWebhook%20Automation%201.png?alt=media&#x26;token=f23244c1-4304-4ef7-9165-0b924c2dc598" alt=""><figcaption></figcaption></figure>

Step 2: Select the Trigger **When a Client is created** option.

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fi2n2xSGBBBosZ9C3xp9E%2FWebhook%20Automation%202.png?alt=media&#x26;token=a06a351b-d11e-4eca-8dcb-57656a6328a5" alt=""><figcaption></figcaption></figure>

Step 3: To add conditions, simply click on the "**Add Condition**" button.

Please set up the condition based on your specific use case. Note that I skipped the condition section in this case.

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2F4o6dK95Tihx3EYaLUVNH%2Fimage.png?alt=media&#x26;token=41e8b2ab-50fa-41e4-8f42-c7c14c02e24c" alt=""><figcaption></figcaption></figure>

Step 4: Select a send **Action** type as the **Webhooks by Whautomate** option 👇

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FtpgETEnTMCRPB6leZtP9%2FWebhook%20Automation%203.png?alt=media&#x26;token=eb0fa09a-0be8-4abf-be95-66b2971ace2e" alt=""><figcaption></figcaption></figure>

#### Add the Details of Webhook Configuration

(i) Select the **Request Method** option as **POST**

(ii) **URL:** Enter the URL where the webhook notifications will be sent.

(iii) **Payload:** The "Payload" refers to the data associated with the automation trigger. It includes the content or information transferred from Whautomate to the external system or service via the webhook. You can customise this payload according to your need.

> Please enter (#) to choose from variables in the payload to be populated dynamically when customising the payload.

(iv) **Headers:** I used the Whautomate default header. If you want to use a new header, select the Add Header button and create. 👇

Step 5: To test the Webhook, please select the **"Send Test Webhook"** button.

Step 6: After filling in all the details Click the **Save** button. 👇

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FwHRBPSwQQFUP2Jbr9Ugt%2Fimage.png?alt=media&#x26;token=a200cd0f-06e3-4ca8-bdb4-922b48b1bf58" alt=""><figcaption></figcaption></figure>

#### How to Test Webhooks Requests

Step 1: Go to the <https://requestbin.com/>[ ](https://pipedream.com/requestbin)website, sign up for your account and then select the Create Request Bin button to continue which will give you enough credits for testing the webhooks.

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FX7ZTMNwKStcW2mr79FZI%2FWebhook%20Configuration1.png?alt=media&#x26;token=c2543eaf-071b-4309-b083-8444a03cb062" alt=""><figcaption></figcaption></figure>

Step 2: Copy the webhook request URL and Paste it into the Whautomate platform 👇

> The Request URL is where Whautomate sends data and events. It's an external system that receives HTTP requests. Specify the URL of the receiving system for seamless data transmission and optimal performance.&#x20;

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FXc0yI6YhqdnspL2aUe3e%2FWebhook%20Configuration%202.png?alt=media&#x26;token=f24d78c3-3a05-4879-ad8f-e448bc2e5cb0" alt=""><figcaption></figcaption></figure>

Step 3: Go to the Whautomate app and paste the Request URL to the **Create New Client Webhook Automation** **Action** section URL field.

<mark style="background-color:yellow;">Note: Implement the automation trigger and conditions outlined in the upper section, which corresponds to those utilized in the</mark> [<mark style="background-color:yellow;">Get Started</mark>](#get-started)

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FmnBHPfUb3IW9IOjQV33X%2FWebhook%20Configuration%203.png?alt=media&#x26;token=615c0a6b-e46f-4894-b516-32bc27b4ba02" alt=""><figcaption></figcaption></figure>

Step 5: To test the Webhook, please select the **"Send Test Webhook"** button.

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FY8ElYWLLmKnfGBGGZjl0%2FWebhook%20Configuration%204.png?alt=media&#x26;token=621f09c1-9952-446f-8d97-82653c713472" alt=""><figcaption></figcaption></figure>

Step 6: Go back to the **Pipedream** app and select the test event to check the test payload data.

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FfFCdwODR4vSE5W5WGXiM%2FWebhook%20Configuration%205.png?alt=media&#x26;token=81eb437a-4edc-4297-ab32-9e792b2ce488" alt=""><figcaption></figcaption></figure>

Step 7: After filling in all the details Click the **Save** button. 👇

<figure><img src="https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FrHFEBGAtXxd6nyLKSIsm%2Fimage.png?alt=media&#x26;token=4009bb50-6765-4f3b-a68c-2c2dad107304" alt=""><figcaption></figcaption></figure>

**Here are the articles in this section:**

{% content-ref url="webhooks/clients" %}
[clients](https://help.whautomate.com/product-guides/integrations/webhooks/clients)
{% endcontent-ref %}

{% content-ref url="webhooks/contacts" %}
[contacts](https://help.whautomate.com/product-guides/integrations/webhooks/contacts)
{% endcontent-ref %}

{% content-ref url="webhooks/messages" %}
[messages](https://help.whautomate.com/product-guides/integrations/webhooks/messages)
{% endcontent-ref %}

{% content-ref url="webhooks/appointments" %}
[appointments](https://help.whautomate.com/product-guides/integrations/webhooks/appointments)
{% endcontent-ref %}

{% content-ref url="webhooks/classes" %}
[classes](https://help.whautomate.com/product-guides/integrations/webhooks/classes)
{% endcontent-ref %}

{% content-ref url="webhooks/invoice-updates" %}
[invoice-updates](https://help.whautomate.com/product-guides/integrations/webhooks/invoice-updates)
{% endcontent-ref %}
