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
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.
Your webhook URL will look like this:
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.
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"
}'
// 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);
});
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
$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;
}
?>
All webhook URLs are unique and secure. SMASHSEND handles retries and error handling automatically.
Every webhook request must include an 'email' field to identify the contact for the automation.
Include any additional fields in your request. All data will be available throughout your automation flow.
Webhooks accept JSON, form-data, and URL-encoded payloads for maximum compatibility.
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
}
Common Issues:
Testing Tips:
Need Help?
Check out our video tutorial or contact support for assistance with your webhook integration.