Skip to main content
Webhooks in Automations
Ira avatar
Written by Ira
Updated over a month ago

Webhooks allow you to extend Omnisend's automation capabilities by connecting external systems and services. They enable you to trigger events in other platforms or send real-time data, enhancing the functionality of your automation workflows.

Note: Webhooks in Automations are currently in Beta and can be enabled upon request. If you'd like to enable webhooks, please contact our support team at [email protected] via the in-app chat or reach out to your Customer Success Manager (if applicable).


Important ⚠️ Implementing webhooks requires significant effort on your side and often requires developer involvement. You may need to prepare dedicated API endpoints, handle payloads, and ensure proper integration between Omnisend and external systems.

In this guide, we will walk you through how to set up and use webhooks in Omnisend automations, with examples and use cases.


What are Webhooks?

Webhooks are HTTP callbacks that send real-time data from Omnisend to other services when specific automation events occur. This allows you to:

  • Notify third-party systems about automation events.

  • Send personalized messages through platforms like WhatsApp.

  • Trigger custom workflows in CRMs, project management tools, or communication platforms like Slack.

Analogy 💡 A Restaurant Pager System

Imagine you're at a restaurant and given a pager to notify you when your table is ready. This pager is like a webhook, alerting you about specific events without you having to check manually.


Understanding Webhook Structure and Components

When setting up webhooks in Omnisend, it's crucial to understand the key components involved in configuring a webhook request.

This section breaks down the structure and components you’ll encounter when editing a webhook in Omnisend:

Component 1. Webhook URL

  • The URL is the destination endpoint where your webhook data will be sent. This is typically an external system or service that will handle and process the data sent from Omnisend.

  • Example: https://api.yourservice.com/webhook-endpoint

Important ⚠️Ensure that this URL is correct and accessible. If the receiving service requires secure communication, make sure the URL starts with https:// for encrypted transmission.

Component 2. Headers

  • Webhooks allow you to include additional headers with your request. Headers are key-value pairs that contain metadata about the webhook request or serve as authentication for the receiving system.

  • Key. The name of the header (e.g., Authorization, Content-Type).

  • Value. The value associated with the header key (e.g., Bearer your_access_token, application/json).

  • Example Headers:

    • Authorization: Bearer your_access_token

    • Content-Type: application/json

  • Common Use Case. If your receiving service requires authentication, such as an API key or token, you would pass that in the headers.

Tip 💡 Always validate that the necessary headers are set up correctly to avoid unauthorized or failed requests.

Component 3. Body

  • The Body is where the actual data (payload) is sent. It contains the relevant information you want to pass to the external system, such as customer details, order information, or specific event triggers.

  • Format. The body is usually structured in JSON format, which allows most services to handle it easily and read it.

  • Example Body (JSON Payload):

    { "customer_id": "{{contact.id}}", "email": "{{contact.email}}", "order_value": "{{event.order_value}}", "purchase_time": "{{event.purchase_time}}" }
  • Customizing the Body. You can tailor the payload to include only the specific data that the receiving service needs. Omnisend provides variables (e.g., {{contact.email}}) that dynamically insert data from your automation into the payload.

Important ⚠️Ensure the body structure matches what the receiving endpoint expects. This includes the proper format (JSON, XML, etc.) and field names.

Testing the Webhook

  • After setting the URL, headers, and body, it’s essential to test the webhook to verify that the data is being sent correctly. Always ensure the response from the receiving system is as expected and that there are no errors in transmission.


How to Set Up Webhooks in Omnisend Automations

Step 1. Create an Automation Workflow
Start by creating a new automation or editing an existing one within Omnisend.

Step 2. Add a Webhook Action
In your automation flow, draft and drop a 'Webhook' block at the point where you want the external event to trigger.

Step 3. Configure the Webhook URL and Headers
Enter the external system’s webhook URL, which will receive data. This could be a CRM, a communication tool, or an API service like the WhatsApp Business API. Headers are key-value pairs that contain metadata about the webhook request or serve as authentication for the receiving system.

Step 4. Map the Payload
Customize the data payload you want to send with the webhook. Omnisend allows you to pass customer details, order information, or other relevant data.

Step 5. Test the Webhook
After setting it up, test the webhook to ensure the external system is sending and receiving data correctly.


Sending a Message via Slack Using Webhooks

Slack can be integrated with Omnisend to send notifications to specific channels when an automation event occurs.

Step 1. Create an Incoming Webhook in Slack.

  • Go to Slack API and set up an incoming webhook.

  • Choose a channel where the messages will be sent.

  • Copy the webhook URL provided by Slack.

Step 2. Add the Webhook to Omnisend Automation.

  • In your Omnisend workflow, insert the webhook block at the desired point in your automation.

  • Input the Slack webhook URL.

  • Customize the Payload. Define the message format you’d like to send. For Slack, the payload might look like this:

{ "text": "A new subscriber has joined! 🎉", "attachments": [ { "title": "Subscriber Details", "text": "Name: {{contact.name}} \n Email: {{contact.email}}" } ] }
  • Test the Integration. Enable the automation and check the Slack channel to confirm the message is sent successfully.


Sending Contacts to Postscript from Omnisend through Automation Webhooks

Step 1. Obtaining Your Postscript API Key

  1. Navigate to your Postscript account.

  2. Click on your name in the top-right corner, and choose API.

    • If you haven't created an API key pair yet, click Create Security Key Pair to generate one.

    • Copy the Private Key and save it somewhere safe, as you will need it later.

      3038

Step 2. Creating a Keyword in Postscript

  1. In Postscript, click Keywords on the left-hand side.

  2. Click Create Keyword in the top-right corner.

  3. Name your keyword, and decide whether to include a coupon in the reply.

  4. To edit the reply:

    • Click the purple Reply box or create an automatic reply by clicking Add Action, then customize the reply message.

    • This Keyword Reply will be sent immediately when a user subscribes via your keyword.

Step 3. Getting the Keyword ID

  1. Visit the Postscript API documentation: Postscript Get Keywords.

  2. Enter your Private Key in the header and click Try it to find the Keyword ID you want to use for contacts coming from Omnisend.

Step 4. Setting Up Automation in Omnisend

  1. Automation Trigger. Use the "Contact Enters Segment" trigger to pass contacts to Postscript.

  2. Webhook Block.

    • Add a Webhook block to your automation flow.

    • For URL, use: https://api.postscript.io/api/v2/subscribers.

    • For Headers, add:

      • Authorization: Bearer <your secret API key>

      • accept: application/json

  3. Body. Pass the following information in the request body:

    { "origin": "other", "properties": { "VIP": true }, "phone_number": "[[contact.phone_number]]", "email": "[[contact.email]]", "keyword_id": "<keywordID obtained previously>", "tags": [ "source:omnisend" ] }
    • Replace <keywordID obtained previously> with your actual keyword ID.

    • You can use "origin": "website", "social", or "other".

Step 5. Enabling the Automation

  1. Enable the automation and test it by adding a test contact with a phone number to your segment.

  2. Check if the contacts in the flow are successfully being passed to Postscript.

By following these steps, you'll be able to send contacts from Omnisend to Postscript through automation webhooks.


Sending WhatsApp Messages Using Webhooks

WhatsApp integration requires using the WhatsApp Business API or a third-party service. Below are the steps for integrating WhatsApp messaging using webhooks.

Step 1. Set Up WhatsApp Business API. 

  • Register for the WhatsApp Business API through Facebook.

  • Follow the setup process, which includes hosting the API on your server or using a third-party service.

  • Obtain the required API credentials.

Step 2. Configure Webhooks in Omnisend. 

  • Add a webhook block in your Omnisend automation workflow.

  • Input the WhatsApp Business API endpoint URL as the webhook.

Construct the HTTP Request. To send messages via WhatsApp, construct an HTTP POST request with the necessary payload. Example using cURL:

curl -X POST https://graph.facebook.com/v14.0/YOUR_PHONE_NUMBER_ID/messages \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "RECIPIENT_PHONE_NUMBER", "type": "text", "text": { "body": "Hello, this is a test message from the WhatsApp Business API." } }'

Step 3. Test the Integration. Run your automation to ensure the WhatsApp message is sent successfully.


Sending Data to a Custom API Endpoint

In some cases, you may want to send event data to a custom API endpoint, such as your own CRM system or order management platform.

Step 1. Create a Custom API Endpoint. Work with your development team to create an API endpoint that can receive Omnisend webhook data.

Step 2. Add the Webhook in Omnisend. Insert the webhook block in the desired automation and input the custom API endpoint URL.

  • Customize the Payload. The payload can include any data available from the automation, such as customer details, order information, or campaign data. Example:

{ "customer_id": "{{contact.id}}", "email": "{{contact.email}}", "order_value": "{{event.order_value}}" }

Step 3. Test & Activate. Test the webhook to ensure data is being sent correctly to your custom API endpoint.


Webhooks provide flexibility to extend your Omnisend automations, enabling communication with external platforms in real time. Whether you're sending messages through Slack, WhatsApp, or SMS platforms like Postscript, the process is similar - setting up a webhook URL, defining a payload, and testing the integration. However, keep in mind that integrating webhooks often requires development resources, especially for custom API setups.

Keep in Mind 💡 Integrating webhooks often requires development resources, especially for custom API setups, so ensure you have the necessary support.

Did this answer your question?