Flow Webhooks

Flow webhooks allow you to trigger SMASHSEND automation flows from external applications using simple HTTP POST requests. This enables you to integrate SMASHSEND with any system that can make HTTP requests, creating powerful automated workflows.

When you create a webhook trigger in your flow, SMASHSEND generates a unique URL that you can call to start the automation with custom data.

Watch

How to Use Flow Webhooks

Getting Started

1

Create a Webhook Trigger Flow

In your SMASHSEND workspace, create a new automation flow and select "Webhook" as your trigger. This will generate a unique webhook URL for your flow.

2

Copy Your Webhook URL

Your webhook URL will look like this:

https://api.smashsend.com/v1/flows/flw_EXAMPLE123/wrk_EXAMPLE456/call
3

Send HTTP POST Requests

Make POST requests to your webhook URL with JSON data to trigger your flow. The 'email' field is required, but you can include any additional data.

Code Examples

cURL Example

curl -X POST "https://api.smashsend.com/v1/flows/YOUR_FLOW_ID/YOUR_WORKSPACE_ID/call" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "firstName": "John",
    "lastName": "Doe",
    "company": "Acme Corp",
    "customField": "any value"
  }'

JavaScript Example

// Using fetch API
const webhookUrl = "https://api.smashsend.com/v1/flows/YOUR_FLOW_ID/YOUR_WORKSPACE_ID/call";
const payload = {
  email: "user@example.com",
  firstName: "John",
  lastName: "Doe",
  company: "Acme Corp",
  customField: "any value"
};

fetch(webhookUrl, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log("Success:", data))
.catch(error => console.error("Error:", error));

// Using axios
const axios = require('axios');

axios.post(webhookUrl, payload)
  .then(response => {
    console.log("Success:", response.data);
  })
  .catch(error => {
    console.error("Error:", error);
  });

Python Example

import requests
import json

# Webhook URL from your SMASHSEND flow
webhook_url = "https://api.smashsend.com/v1/flows/YOUR_FLOW_ID/YOUR_WORKSPACE_ID/call"

# Data to send to the flow
payload = {
    "email": "user@example.com",
    "firstName": "John",
    "lastName": "Doe",
    "company": "Acme Corp",
    "customField": "any value"
}

response = requests.post(webhook_url, json=payload)

if response.status_code == 200:
    print("Success:", response.json())
else:
    print("Error:", response.status_code, response.text)

PHP Example

<?php
$webhookUrl = "https://api.smashsend.com/v1/flows/YOUR_FLOW_ID/YOUR_WORKSPACE_ID/call";

$payload = [
    "email" => "user@example.com",
    "firstName" => "John",
    "lastName" => "Doe",
    "company" => "Acme Corp",
    "customField" => "any value"
];

$options = [
    'http' => [
        'header' => "Content-Type: application/json\r\n",
        'method' => 'POST',
        'content' => json_encode($payload)
    ]
];

$context = stream_context_create($options);
$result = file_get_contents($webhookUrl, false, $context);

if ($result === false) {
    echo "Error calling webhook";
} else {
    echo "Success: " . $result;
}
?>

Key Features

🔒 Secure & Reliable

All webhook URLs are unique and secure. SMASHSEND handles retries and error handling automatically.

📨 Email Required

Every webhook request must include an 'email' field to identify the contact for the automation.

🎯 Custom Data

Include any additional fields in your request. All data will be available throughout your automation flow.

🔄 Multiple Formats

Webhooks accept JSON, form-data, and URL-encoded payloads for maximum compatibility.

Common Use Cases

  • E-commerce Integration: Trigger welcome emails when customers sign up on your website
  • Form Submissions: Start nurture sequences when users submit contact forms
  • CRM Integration: Sync new leads from your CRM to SMASHSEND automatically
  • Event Tracking: Trigger targeted emails based on user behavior in your app
  • Third-party Tools: Connect SMASHSEND with Zapier, Make, or custom applications

Response Format

Successful webhook calls return a 200 status code with a JSON response:

{
  "success": true,
  "flowRunId": "run_ABC123",
  "message": "Flow triggered successfully"
}

If there's an error, you'll receive an appropriate HTTP status code with error details:

{
  "error": "Validation failed",
  "message": "Email field is required",
  "statusCode": 400
}

Troubleshooting

Common Issues:

  • 400 Bad Request: Missing required 'email' field or invalid JSON format
  • 404 Not Found: Invalid flow ID or workspace ID in the URL
  • 405 Method Not Allowed: Make sure you're using POST, not GET
  • 500 Server Error: Flow configuration issue - check your automation setup

Testing Tips:

  • Use tools like Postman or curl to test your webhook URLs
  • Check your flow's run history to see if triggers are being received
  • Validate your JSON payload format before sending
  • Ensure your flow is published and active

Need Help?

Check out our video tutorial or contact support for assistance with your webhook integration.