> For the complete documentation index, see [llms.txt](https://docs.hackle.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hackle.io/en/crm-marketing/webhook-guide/use-cases/webhook-slack.md).

# Send Slack Messages via Webhook

{% hint style="info" %}
Use Hackle webhooks to automate various Slack messages to be delivered at the desired time.

This guide provides instructions on how to send event-based personalized Slack messages.
{% endhint %}

### Configure the Webhook

Follow the steps below to set up the Slack message send webhook.

{% stepper %}
{% step %}
**Create a Slack App**

First, add the Webhook app to the Slack channel you want to send messages to.

Create a new app in Slack.

![](/files/oqIm9469mHolkQGI4RyT)

![Click Create New App.](/files/cALgkOwMMAnnbkzUEGmb)

![Select From scratch.](/files/6iDm9vpGfiro9jtHRkMa)
{% endstep %}

{% step %}
**Register Incoming Webhooks**

Open the app you created and navigate to the `Incoming Webhooks` menu.

Change the toggle to `On`.

![Change the Toggle to on.](/files/EExF3qX07FPvMTRhfnm9)

![](/files/8MODizVI8icr4Sbz9rPk)

Click `Add New Webhook to Workspace`.

Then select the Slack channel you want to send messages to.
{% endstep %}

{% step %}
**Confirm the Webhook URL**

Copy the generated Webhook URL.

This URL will be used shortly for the webhook campaign settings.

![](/files/V5ZQeL3lc4NFX5osHp4a)
{% endstep %}

{% step %}
**Create a Webhook Campaign**

Create a new webhook campaign in the Hackle Dashboard.

![Click Create New Campaign.](/files/x1iux9pWB75C9udjDaB2)
{% endstep %}

{% step %}
**Configure Request Information**

**Endpoint Settings**

Paste the Webhook URL copied previously.

{% hint style="info" %}
Slack message sending must be configured as a `POST` request.
{% endhint %}

![](/files/xDeUcdrHEP0YYAZxVCGf)

**Body Settings**

First, you can test with a simple message as below.

```json
{
  "text": "Hello, World!"
}
```

Paste the above JSON into the Body input field and save.

![](/files/WT1hCn0nFLdn5YGW8s8p)
{% endstep %}

{% step %}
**Send a Test Message**

Verify that the configured webhook works correctly.

Click the `Send Test Message` button.

![](/files/nP5WPsET5At4CoQNoJO8)

If the call succeeds, you can see the following result.

![Test send result](/files/gxTB4nMErVLZEx4zhtoe)

{% hint style="info" %}
Test sending actually sends an HTTP request to the registered Endpoint.

The response value also shows the actual value returned from the Endpoint as-is.
{% endhint %}

Also check the Slack channel to confirm the message has arrived.

![](/files/Ove2D7DOGR7FRUyDItSn)
{% endstep %}

{% step %}
**Configure Personalized Messages**

Now modify the Body to send Slack messages in the desired format at the desired time.

First, decide which event to use as the trigger.

* Navigate to [Dashboard > Event Explorer](https://dashboard.hackle.io/event-discovery).
* Search for the event you want to use as a trigger.
* Check the properties collected along with the event.
* Event properties and user properties are used for personalization.

If you're not familiar with event properties and user properties, refer to the [Property Guide](/en/event-management/properties.md).

{% hint style="info" %}
Fields such as `fallback`, `text`, `pretext`, `color`, and `attachments` follow the Slack [Message Payload](https://api.slack.com/surfaces/messages#payloads) specification.

You can freely compose messages to match the Slack format.
{% endhint %}

Personalization syntax uses [Liquid](https://shopify.github.io/liquid/).

You can type it directly, but if you're not familiar with it, using the `Add Personalization Variable` modal is more convenient.

![You can open the Add Personalization Variable modal.](/files/wYCB75xH4pwMRI5Xacdv)

**Slack Message Delivery Body Sample**

```json
{
  "fallback": "Failed to compose in-app message display notification message.",
  "text": "{{event_properties.in_app_message_key | default: "key"}}th in-app message displayed",
  "pretext": "{{event_properties.in_app_message_display_type | default: "unknown"}}",
  "color": "good",
  "attachments": [
    {
      "fallback": "fallback",
      "pretext": "Performed {{event_properties.action_type | default: "unknown"}} for {{event_properties.button_text | default:"button name"}}",
      "color": "#0065ff",
      "fields": [
        {
          "title": "[In-App Message Display Notification]",
          "value": "In-app message info is at Hackle 👉 <http://dashboard.hackle.io/in-app-messages/{{event_properties.in_app_message_id}}/|link>",
          "short": false
        }
      ]
    }
  ]
}
```

Modify the Body as above and save the campaign.
{% endstep %}

{% step %}
**Event-based Send Settings**

Click the `Send Settings` button in the webhook campaign.

![](/files/7NJG9V0uUyjiNM7jY9xO)

Select `Event-based` as the send type.

Set the trigger event to `$in_app_action`.

{% hint style="info" %}
To trigger only for a specific in-app message action, use `Trigger Event > Add Filter`.

* `in_app_message_key`
* `in_app_message_id`
* `in_app_message_display_type`

You can apply the desired conditions using these properties.
{% endhint %}

![Event-based send settings](/files/AJDc8vCa4U4myWP9FBpc)
{% endstep %}

{% step %}
**Complete**

Now click `Start` to activate the webhook campaign.

Then trigger the `$in_app_action` event by performing an action such as clicking the close button on the target in-app message.

When the webhook is triggered successfully, the message is sent to Slack.

![Message sent successfully](/files/xKclWT01VMgxe2w3qHfU)
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.hackle.io/en/crm-marketing/webhook-guide/use-cases/webhook-slack.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
