Skip to main content

Webhooks Integration

Webhooks allow you to send real-time data from WhautoMail to external applications when specific events occur - no need for manual updates or polling.


โœ… General Use Casesโ€‹

Below are the available webhook event types:

๐Ÿ‘ฅ Contactsโ€‹

  • Contact Created: Triggered when a new contact is created
  • Contact Tag Added: Triggered when a tag is added to a contact
  • Contact Tag Removed: Triggered when a tag is removed from a contact

โš™๏ธ How to Setup a Webhookโ€‹

Here are two methods to setup a webhook.

Method 1: Quick Setup โ€“ New Webhookโ€‹

Limitations
  • You can configure up to 5 webhooks; each can listen to multiple selected events
  • Only HTTP POST requests are supported
  • Payload customization is not available in this method

Steps:โ€‹

  1. Open the WhautoMail app, go to the Integration menu, and select Webhooks Connect
  2. Click the New Webhook button
  3. Fill in the following:
    • Webhook Name (e.g., Contact Created)
    • Server URL: Where the webhook payload will be sent
    • Events to Track: Select one or more events (e.g., Contact Created)
  4. Click Save to finish the setup

Method 2: Advanced Setup โ€“ Customized Payload via Automationโ€‹

โœ… This method supports:

  • Full payload customization
  • Dynamic variables
  • Custom headers using RESTful endpoints

Steps:โ€‹

  1. Go to the Automation menu โ†’ Click Add Rule โ†’ Choose Create Rule from Scratch
  2. Set the trigger: e.g., When a Contact is created
  3. (Optional) Click Add Condition to filter the trigger logic
  4. Choose an Action: Select Send Webhook by WhautoMail
  5. Fill out the Webhook Configuration:
    • Request Method: Select POST
    • URL: Enter your webhook receiver endpoint
    • Payload: Customize the JSON payload using dynamic variables (#) from WhautoMail
    • Headers: Use the default header or click Add Header to include custom headers
  6. Click Send Test Webhook to test your setup
  7. Click Save once done

๐Ÿงช How to Test Webhooksโ€‹

Testing is critical before going live. Here's how to do it:

Step 1: Create a Test Endpointโ€‹

  1. Visit https://requestbin.com and sign up
  2. Click Create Request Bin to generate a test webhook URL
  3. Copy the generated Request URL

Step 2: Configure in WhautoMailโ€‹

  1. Paste the Request URL into your Webhook setup in WhautoMail (Step 5 above)
  2. Trigger the automation (e.g., create a new contact)

Step 3: Verify the Payloadโ€‹

  1. Return to RequestBin and inspect the incoming test payload
  2. Verify the data structure and content
  3. Once verified, click Save in WhautoMail
tip

The Request URL is your endpoint that listens to real-time events from WhautoMail. Use services like RequestBin (Pipedream) for testing, or connect your live system directly.


๐Ÿ“‹ Webhook Payload Exampleโ€‹

Here's an example of what a webhook payload might look like:

{
"event": "contact.created",
"timestamp": "2024-10-20T14:23:00Z",
"data": {
"contact_id": "12345",
"name": "John Doe",
"email": "johndoe@example.com",
"tags": ["New Lead"],
"status": "subscribed",
"created_at": "2024-10-20T14:23:00Z"
}
}

๐Ÿ” Security Best Practicesโ€‹

Verify Webhook Sourcesโ€‹

  • Implement signature verification to ensure webhooks are from WhautoMail
  • Use HTTPS endpoints only
  • Validate incoming payload structure

Handle Errors Gracefullyโ€‹

  • Return 200 OK status code to acknowledge receipt
  • Implement retry logic for failed processing
  • Log all webhook events for debugging

Monitor Webhook Performanceโ€‹

  • Track webhook delivery success rates
  • Set up alerts for failed deliveries
  • Monitor response times

๐Ÿ”ง Troubleshootingโ€‹

Webhook Not Triggeringโ€‹

Check Event Configuration

  • Verify the correct event is selected
  • Ensure the trigger conditions are met
  • Check if the automation is enabled

Verify Endpoint URL

  • Ensure the URL is accessible
  • Check for typos in the URL
  • Verify HTTPS is used (if required)

Payload Not Receivedโ€‹

Check Server Logs

  • Verify your server is receiving requests
  • Check firewall settings
  • Ensure port is open

Test with RequestBin

  • Use RequestBin to verify WhautoMail is sending data
  • Compare payload structure

Authentication Issuesโ€‹

Verify Headers

  • Check custom headers are configured correctly
  • Ensure authentication tokens are valid
  • Verify API keys if required

๐Ÿ’ฌ Need Support?โ€‹

Having trouble configuring or testing webhooks? Contact our support team at support@whautomail.com - we're here to help.