Webhook
Add leads to your Whappy campaign automatically using webhooks
Webhooks provide an automated way to add leads to your Whappy campaigns. Instead of manually importing leads or using other integrations, you can send lead data directly to Whappy via HTTP POST requests.
When to Use Webhooks
Webhooks are perfect for:
- Website Forms: Automatically add leads when someone fills out a contact form
- Custom Applications: Integrate with your existing software systems
- Third-party Tools: Connect services that aren’t directly supported
- Real-time Lead Import: Add leads immediately as they’re generated
Setting Up Your Webhook
1. Get Your API Key
Navigate to Integrations → Webhook in your Whappy dashboard to find your unique API key. This key authenticates your requests and ensures leads are added to your account.
Keep your API key secure and never share it publicly. Anyone with this key can add leads to your account.
2. API Endpoint
Send POST requests to:
3. Required Headers
Include these headers in your requests:
Request Format
Required Fields
- name: Lead’s full name
- phone: Lead’s phone number (including country code)
Optional Fields
- email: Lead’s email address
- company: Lead’s company name
- source: Where the lead came from (e.g., “Website”, “Facebook”)
- custom_fields: Additional data as key-value pairs
Example Request Body
Code Examples
Response Format
Successful Response
Error Response
Using Custom Fields
Custom fields you include in your webhook payload can be used as variables in your WhatsApp message templates. For example:
If you send:
You can use {{budget}}
and {{timeline}}
in your WhatsApp templates:
Testing Your Webhook
- Use the API Key from your dashboard
- Test with a simple cURL request to verify connectivity
- Check the Leads section to confirm the lead was added
- Verify your campaign processes the lead correctly
Start with a simple test request using just the required fields (name and phone) before adding custom fields.
Common Use Cases
Website Contact Forms
Add this JavaScript to your website forms:
Security Best Practices
- Use HTTPS only for all webhook requests
- Store API keys securely (environment variables, not in code)
- Validate data before sending to prevent errors
- Handle errors gracefully in your application
- Monitor webhook usage to detect unusual activity
Troubleshooting
Lead not appearing?
- Check your API key is correct
- Verify the phone number format includes country code
- Ensure your campaign is running
Getting errors?
- Confirm all required fields are included
- Check the request format matches the examples
- Verify your API key has the correct permissions
Need help? Check our troubleshooting guide or contact support.