Workflow Action: Custom Webhook
Overview
The Custom Webhook Action in Stack allows you to seamlessly integrate with external systems by sending real-time data using HTTP methods like POST, GET, PUT, and DELETE. This feature facilitates automation, data exchange, and interaction with third-party services, APIs, and custom applications without any coding required.
Action Name
Custom Webhook
Action Description
The Custom Webhook Action lets you send HTTP requests to specified URLs, enabling integration with external services for automated data exchange. It supports various HTTP methods, customizable headers, query parameters, and multiple authentication options to meet the requirements of any third-party service.
Supported Features
- HTTP Methods: POST, GET, PUT, DELETE
- Custom Headers & Query Parameters: Pass authentication, content-type, or other necessary data
- Authorization Methods:
- Basic Auth: Requires a username and password
- Bearer Token: Requires a token from the platform
- API Key: Requires a key-value pair of the key name and its value
- Data Mapping: Autocomplete suggestions to map custom values like contact info, lead status, and more
Action Details
Step-by-Step Guide
-
Choose the Action Type:
- Select "Custom Webhook" from the list of available actions in the workflow builder.
-
Name Your Action:
- Enter a descriptive name, such as "Send Data to External API."
-
Enter the Webhook URL:
- Provide the URL of the external system’s endpoint where the data should be sent (e.g., a CRM, payment gateway, or custom API).
-
Select HTTP Method:
- Choose from POST, GET, PUT, or DELETE depending on the type of data operation required by the external service.
-
Select Authorization Method (Optional):
- Choose the necessary authorization method such as API keys, Bearer Tokens, or Basic Auth to ensure secure communication with the external service.
-
Configure Headers & Query Parameters (Optional):
- Add any required headers like
Authorization: Bearer <API_KEY>or content-type headers to define the data format (Content-Type: application/json). - Use query parameters to pass additional information, filter data, or adjust the external API’s response.
- Add any required headers like
-
Map Data:
- Insert relevant data (e.g., contact name, email, phone number) into the request body. Structure the payload in JSON or another format required by the external system.
Example Payload:
{
"first_name": "`{{contact.first_name}}`",
"last_name": "`{{contact.last_name}}`",
"email": "`{{contact.email}}`",
"phone": "`{{contact.phone}}`"
} -
Save and Activate the Workflow:
- Once set up, activate the workflow. The webhook will trigger and send data in real time based on the workflow conditions.
Example
Scenario
A business wants to send contact information to an external CRM whenever a new lead is created in your system.
-
Create Workflow Trigger:
- Set up a workflow trigger for when a new lead is created.
-
Add Custom Webhook Action:
- Choose "Custom Webhook" and name it "Send Lead Data to CRM."
-
Webhook URL:
https://api.externaltestcrm.com/leads/create
-
HTTP Method:
- POST
-
Payload:
{
"first_name": "`{{contact.first_name}}`",
"last_name": "`{{contact.last_name}}`",
"email": "`{{contact.email}}`",
"phone": "`{{contact.phone}}`"
} -
Headers:
- Add an API key to authenticate the request
- Authorization: Bearer xyz123
- Content-Type: application/json
-
Test the Webhook:
- Use a tool like Webhook.site or Postman to confirm the data is correctly sent and received.
-
Save and Activate:
- Once activated, the webhook will automatically send lead data to the CRM whenever a new lead is created.
Outcome
Every new lead is synced with the external CRM, improving automation and reducing manual data entry.