-
Notifications
You must be signed in to change notification settings - Fork 0
Webhook Callout API
Automatically trigger Make.com (or any webhook service) when deals are created, change stages, or get contacts added.
Make.com:
- Create a scenario at make.com
- Add Webhooks → Custom webhook
- Copy the URL (e.g.,
https://hook.make.com/abc123)
Other services: Use their webhook URL
- Go to Admin Panel → Teams
- Click the checklist icon next to your team
- For each stage (s0-s4), enter:
- Webhook URL: Paste your Make.com URL
- Token: Optional (for authentication)
- Click Save
Create a new deal or change a deal's stage. Check execution history to see the data arrive.
Webhooks fire automatically for these events:
| Event | When | Event Type |
|---|---|---|
| Deal Created | New deal is created | deal.created |
| Stage Changed | Deal moves between stages (s0→s1, s1→s2, etc.) | deal.stage_changed |
| Contact Added | First contact is added to a deal (0 → 1+ contacts) | deal.contact_added |
Important: Webhooks are triggered per stage. Configure the webhook for the stage you want to monitor.
Here's what Make.com receives:
{
"event": "deal.created",
"timestamp": "2025-10-20T10:30:00.000Z",
"deal": {
"id": "deal_123",
"name": "Acme Corp Deal",
"stage": "s1",
"previousStage": "s0",
"amount": 50000,
"currency": "USD",
"probability": 75,
"expectedCloseDate": "2025-12-31",
"createdAt": "2025-10-01T10:00:00.000Z",
"updatedAt": "2025-10-20T10:30:00.000Z",
"team": "team_456",
"owner": "user_789",
"customFields": {
"industry": "Technology"
},
"sharingKey": "key123"
},
"account": {
"id": "acc_123",
"name": "Acme Corp",
"industry": "Technology",
"website": "https://acme.com",
"phone": "+1234567890",
"email": "contact@acme.com",
"address": "123 Main St",
"customFields": {}
},
"contacts": [
{
"id": "con_123",
"firstName": "John",
"lastName": "Doe",
"fullName": "John Doe",
"email": "john.doe@acme.com",
"phone": "+1234567890",
"mobile": "+0987654321",
"title": "CEO",
"customFields": {}
}
],
"primaryContact": {
"id": "con_123",
"firstName": "John",
"lastName": "Doe",
"fullName": "John Doe",
"email": "john.doe@acme.com",
"phone": "+1234567890",
"mobile": "+0987654321",
"title": "CEO",
"customFields": {}
},
"team": {
"id": "team_456",
"name": "Sales Team",
"category": "sales"
}
}Notes:
-
contacts= array of all related contacts -
primaryContact= first contact (for convenience) - All fields may be
nullif not available
Scenario:
Webhook → Filter (event = "deal.created") → Gmail (Send Email)
Filter:
{{event}} = "deal.created"
Email Template:
To: {{primaryContact.email}}
Subject: Welcome!
Body: Hi {{primaryContact.firstName}}, thank you for the {{deal.amount}} deal!
Scenario:
Webhook → Filter (event = "deal.stage_changed") → Slack (Post Message)
Filter:
{{event}} = "deal.stage_changed"
AND {{deal.stage}} = "s3"
Slack Message:
Deal "{{deal.name}}" reached stage s3!
Amount: {{deal.amount}} {{deal.currency}}
Contact: {{primaryContact.fullName}}
Scenario:
Webhook → Google Sheets (Add Row)
Columns:
- Deal Name:
{{deal.name}} - Amount:
{{deal.amount}} - Stage:
{{deal.stage}} - Contact:
{{primaryContact.fullName}} - Email:
{{primaryContact.email}} - Date:
{{timestamp}}
Scenario:
Webhook → Router
├─ Route 1: event = "deal.created" → Action A
├─ Route 2: event = "deal.stage_changed" → Action B
└─ Route 3: event = "deal.contact_added" → Action C
By event type:
{{event}} = "deal.created"
{{event}} = "deal.stage_changed"
{{event}} = "deal.contact_added"
By stage:
{{deal.stage}} = "s2"
By amount:
{{deal.amount}} > 10000
By contact domain:
{{primaryContact.email}} contains "@important-company.com"
By team:
{{team.name}} = "Sales Team"
Multiple contacts:
{{length(contacts)}} > 1
- Check webhook URL is saved in admin UI
- Create/update a deal to trigger it
- Check Firebase logs:
firebase functions:log --only dealWebhookTrigger
- Check webhook URL is correct
- Try without bearer token first
- Check Make.com scenario is active
- View Make.com execution history for error details
- Token is sent in both
Authorization: Bearer {token}andx-make-apikey: {token}headers - Make.com uses
x-make-apikey - Other services typically use
Authorization
Firebase Console:
firebase functions:log --only dealWebhookTriggerFirestore:
- Go to Firebase Console → Firestore
- Open
webhook_logscollection - Filter by
success: true/false
Make.com:
- Go to your scenario
- Click webhook module
- View execution history
GCP Cloud Monitoring:
- Go to GCP Console → Monitoring → Alerting
- Create Alert Policy
- Filter:
severity="ERROR" AND resource.labels.function_name="dealWebhookTrigger" - Add notification channel (email/SMS/Slack)
Bearer Token:
- Add a token in admin UI for authentication
- Token is sent in both
Authorizationandx-make-apikeyheaders - Recommended for production
HTTPS Only:
- Only use HTTPS webhook URLs
- Make.com URLs are always HTTPS
- Max 3 retries on failure (with exponential backoff)
- 30 second timeout per request
- No retry on 4xx errors (client errors)
- Auto retry on 5xx errors (server errors)
-
All calls logged to
webhook_logsFirestore collection
✅ Configure webhooks per team and stage in admin UI
✅ Webhooks fire on deal creation, stage changes, and contact additions
✅ Full deal, account, contact, and team data included
✅ Works with Make.com, Zapier, n8n, and any webhook service
✅ Automatic retries and error logging
✅ All events tracked in Firestore