# Automated WhatsApp Messaging with Pipedrive Triggers

**Step 1: Create a Webhook for Automated WhatsApp Messaging**

1. **Open Webhooks Menu and Add a New Webhook**

* In the Pipedrive interface, click on the “More” section (three dots) on the left side of the screen.
* Select “Automations” and then choose “Webhooks.”
* In the Webhooks menu, select the “Automated Webhooks” subsection.
* Click the “+ Webhook” button in the top-right corner.
* Choose “Add Automated Webhook.”

  <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2FovAECaqlgE3etUBB9tqE%2FGroup%20224.png?alt=media&#x26;token=91e4f17f-409b-4249-a453-7d93723db867" alt=""><figcaption></figcaption></figure>

2. **Configure Webhook Details:**

* **Webhook Name:** Enter a name for the webhook (e.g., “Automated WhatsApp Messaging”). You can name it as desired for better identification.
* **Endpoint URL:** Copy the URL from your connection settings by clicking “Copy a Webhook URL.” Paste this URL into the “Endpoint URL” field.
* Click “Save” to complete the webhook setup.

  <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2FcLQZdUbn4V324HtmfnUs%2FGroup%20226.png?alt=media&#x26;token=6dffd32a-3237-4692-b6e0-e4fdd49dfdf6" alt=""><figcaption></figcaption></figure>

**Step 2: Create an Automation**

1. **Add a New Automation:**

* Return to the “Automations” section.
* Click the “+ Automation” button to create a new automation.

  <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2FajVfp2YOw6wVv7YqE8uz%2FGroup%20227%20(1).png?alt=media&#x26;token=d5ee9c0c-76e9-4582-9513-f069c8ea83fb" alt=""><figcaption></figcaption></figure>

2. **Set Up Trigger Event:**

* Select the desired triggering event. For example, we want to send a message when a new deal is created in a certain funnel and stage:
* Select “Deal” as the trigger.

  <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2FWddfaPisHpaR6rcjgxxy%2FGroup%20229.png?alt=media&#x26;token=d9f2b896-e8de-4ccc-a3f3-f072b2f7417d" alt=""><figcaption></figcaption></figure>
* Set the Event to “Added.”
* Click “Apply Trigger.”

  <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2FrrFohMeSBV13sRv7x7mF%2FGroup%20228.png?alt=media&#x26;token=39f9a004-9c0e-468f-88bc-8831e01ae903" alt=""><figcaption></figcaption></figure>

3. **Configure Trigger Conditions:**

* Set the conditions for the trigger, such as choosing the pipeline and stage where the deal will be created.
* Adjust the parameters as needed and save the conditions.

  <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2FpWx0gD3B1iVNT2dB29Rv%2FGroup%20230%20(1).png?alt=media&#x26;token=a0962921-715a-4e11-80f3-f9715ac5af4e" alt=""><figcaption></figcaption></figure>

**Step 3: Add Action to Send Webhook Request**

1. **Add an Action:**

* Click the “+” button and select:

* Action: “Webhook”

  <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2FTd3nr8laso4lismq97S1%2FGroup%20231.png?alt=media&#x26;token=072405fd-8158-49af-800e-adfd769b872f" alt=""><figcaption></figcaption></figure>

* Action Type: “Send Webhook Request”

* Click “Next”&#x20;

  <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2F8QUhoRJpjP0xFeJoYohA%2FGroup%20233.png?alt=media&#x26;token=d4a2a3fa-6c04-4c3f-a0a0-bc313e737828" alt=""><figcaption></figcaption></figure>

* Keep these fields as default and Click “Next” <br>

  <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2Faxy6gZnJbEQe2lU7UWgy%2FGroup%20252.png?alt=media&#x26;token=fe3a0487-a198-4e5a-a228-fc65776abc4d" alt=""><figcaption></figcaption></figure>

2. **Configure Webhook Action:**

* **Webhook:** From the list, choose the webhook you created in Step 1 (e.g., “Automated WhatsApp Messaging”).
* **Method:** Select “POST” from the list.
* Body:
* Add entry&#x20;
* For the “Key” field, enter “**phone\_number**”
* For the “Value” field, select “**Deal contact person phone**” (**Note:** Ensure that the entity selected in the “Value” field corresponds with the trigger (e.g., lead with lead, deal with deal). The value should be the client’s phone number.
* For the second  “Key” field, enter **message**.
* For the “Value” field, paste the text of your automated message.

  <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2FZMhBZMfPMOaB69JSKHXw%2FGroup%20246.png?alt=media&#x26;token=0d385171-766f-4d5f-a312-b5aa0e0f60ca" alt=""><figcaption></figcaption></figure>

  **(Optional) Add Attachment:**
* If you need to send a message with an attachment (e.g., an image or document), click “+ Add Entry.” <br>

  <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2FlxQLrkT8hbBObNDcafs1%2FGroup%20247.png?alt=media&#x26;token=432d660c-e0bd-4d05-92a7-8c2d438452af" alt=""><figcaption></figcaption></figure>
* Enter **file\_url** in the “Key” field.
* Paste the direct URL of the document or image in the “Value” field.
* Click “Save” to finalize the action.<br>

  <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2FqwtmYxCBbOOp8geb96Zg%2FGroup%20250.png?alt=media&#x26;token=58b39312-d553-4c57-85ff-d51fcda31406" alt=""><figcaption></figcaption></figure>

**Sending Multiple Attachments:**

* In the “Value” field, enclose all file URLs in square brackets `[]` and wrap each URL in double quotes `""`.
* Separate each URL with a comma.
* Ensure the field looks like this:

**Example:**\
`["https://example.com/file1.jpg", "https://example.com/file2.jpg", "https://example.com/file3.jpg"]`

{% hint style="warning" %}
Do not add multiple `file_url` entries. All files must be included in a single `file_url` field, as JSON standards do not allow duplicate keys. Only the last value will be processed if multiple `file_url` entries are added.
{% endhint %}

* Click “Save” to finalize the action.

{% hint style="info" %}
**Important Note:**\
While multiple files can be sent in one automation, WhatsApp will deliver each file as a separate message. Unfortunately, WhatsApp does not support sending multiple files as a single message.
{% endhint %}

✨ **How to Add Line Breaks in a Message?**

To insert a line break in your message, use the \n symbol where you want the line to break.

📌 **Example:**&#x20;

`Hello, {Lead contact person name} !\nThank you for reaching out to us.`

<figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2F2NltDoz1PJjd8zNFfqEG%2FGroup%20320.jpg?alt=media&#x26;token=a20b89b0-0ad0-4d37-a803-1f728af0172b" alt=""><figcaption></figcaption></figure>

This will appear as:

Hello, John!\
Thank you for reaching out to us.

**🔹 Additional Tip for Line Breaks:**

* If you use `\n\n`, it will create a double line break (move the text down by two lines).

{% hint style="warning" %}
⚠️ **Note:** The line break functionality is provided by our integration and is not natively supported in the CRM.
{% endhint %}

🤝 **How to Personalize Messages?**

You can make your messages more personal by inserting dynamic values from the deal or contact fields.\
💡 **Steps to personalize a message:**

1. Click the ➕ button on the right side of the message input field.<br>

   <figure><img src="https://1360887499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb61nIKR97C88XZEX04cC%2Fuploads%2FuUWHkmeNpvLKjWS7b6qb%2FGroup%20319%20(1).jpg?alt=media&#x26;token=2e31ca7d-6310-402b-aa9b-283571f4d608" alt=""><figcaption></figcaption></figure>
2. Select the desired value, such as **Lead contact person name**.

📌 **Example:**

`Hello, {Lead contact person name}! Your order is being processed. 🚀`

This will appear as:

`Hello, John! Your order is being processed. 🚀`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whatcrm.gitbook.io/whatcrm-docs/english/integrations-products/pipedrive/automated-whatsapp-messaging-with-pipedrive-triggers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
