Webhook System
SkunkCRM provides a powerful webhook system for integrating with external services like n8n, Zapier, Make.com, and custom applications.
Overview
The webhook system supports two main patterns:
- Outgoing Webhooks (Event Subscriptions) - SkunkCRM sends data TO external systems
- Incoming Webhooks (Data Receivers) - External systems send data TO SkunkCRM
🚀 Outgoing Webhooks (Event Subscriptions)
Send CRM events to external systems when things happen in SkunkCRM.
Quick Setup
- Go to SkunkCRM → Webhooks in your WordPress admin
- Click "Add Webhook"
- Configure:
- Name: "n8n Lead Processing"
- URL: Your webhook URL from n8n/Zapier/etc
- Events: Select which CRM events to send
- Authentication: Configure if needed
Available Events
Contact Events
contact_created- New contact addedcontact_updated- Contact information changedcontact_status_changed- Contact status changed (lead → customer)
Deal Events
deal_created- New deal createddeal_stage_changed- Deal moved between pipeline stagesdeal_won- Deal marked as wondeal_lost- Deal marked as lost
Activity Events
email_sent- Email sent from CRMemail_opened- Email opened by recipientemail_clicked- Link clicked in email
Automation Events
automation_triggered- Automation workflow startedautomation_completed- Automation workflow finished
Task Events
task_created- New task createdtask_completed- Task marked complete
Webhook Payload Format
All outgoing webhooks send JSON in this format:
{ "event": "contact_created", "timestamp": "2025-01-09 14:30:00", "data": { "contact": { "id": 123, "name": "John Doe", "email": "john@example.com", "company": "Acme Corp", "status": "lead", "created_at": "2025-01-09 14:30:00" }, "source": "api" }, "context": { "request_source": "api", "user_id": 1 }, "source": { "system": "SkunkCRM", "version": "1.0", "url": "https://yoursite.com" } }
Authentication Options
No Authentication
No additional headers required.
Bearer Token
Header: Authorization: Bearer your-secret-token
API Key Header
Header: X-API-Key: your-api-key
Basic Authentication
Header: Authorization: Basic base64(username:password)
📥 Incoming Webhooks (Data Receivers)
Receive data from external systems and automatically create/update contacts, deals, etc.
Quick Setup
- Generate Token: Create a secure random token (e.g.,
abc123def456) - Use Endpoint: Send POST requests to:
POST https://yoursite.com/wp-json/skunkcrm/v1/webhook/{your-token}
Example: Contact Data
curl -X POST "https://yoursite.com/wp-json/skunkcrm/v1/webhook/abc123" \ -H "Content-Type: application/json" \ -d '{ "contact": { "name": "Jane Smith", "email": "jane@example.com", "company": "Tech Corp", "phone": "+1-555-0123", "status": "lead", "source": "website_form" } }'
🛠️ REST API Reference
Webhook Management
# List all webhooks GET /wp-json/skunkcrm/v1/webhooks # Create webhook POST /wp-json/skunkcrm/v1/webhooks { "name": "n8n Integration", "url": "https://your-webhook-url.com", "events": ["contact_created", "deal_won"], "auth_type": "bearer", "auth_token": "your-secret-token" } # Get available events GET /wp-json/skunkcrm/v1/webhooks/events # Test webhook POST /wp-json/skunkcrm/v1/webhooks/123/test
🔒 Security Best Practices
- Use HTTPS: Always use HTTPS URLs for webhook endpoints
- Strong Tokens: Use cryptographically secure random tokens
- Rate Limiting: Implement appropriate rate limiting
- Logging: Monitor webhook delivery for security issues
🐛 Troubleshooting
Common Issues
Webhook not firing:
- Verify webhook is active
- Check selected events match actual CRM events
- Review WordPress error logs
Authentication failing:
- Double-check token/credentials
- Verify header format matches expected format
- Test with curl first
Payload format issues:
- Use built-in webhook test feature
- Validate JSON syntax
- Check required field mappings