Skip to content

Webhook Callout API

Pierre Lecointre edited this page Nov 7, 2025 · 1 revision

Webhook Integration Guide

Automatically trigger Make.com (or any webhook service) when deals are created, change stages, or get contacts added.


Quick Setup (5 minutes) - Make.com example

1. Get Your Webhook URL

Make.com:

  1. Create a scenario at make.com
  2. Add WebhooksCustom webhook
  3. Copy the URL (e.g., https://hook.make.com/abc123)

Other services: Use their webhook URL

2. Configure in Stood CRM

  1. Go to Admin PanelTeams
  2. Click the checklist icon next to your team
  3. For each stage (s0-s4), enter:
    • Webhook URL: Paste your Make.com URL
    • Token: Optional (for authentication)
  4. Click Save

3. Test It

Create a new deal or change a deal's stage. Check execution history to see the data arrive.


When Webhooks Trigger

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.


Webhook Payload

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 null if not available

Make.com Examples

Example 1: Send Email When Deal Created

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!

Example 2: Notify Team on Stage Change

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}}

Example 3: Add to Google Sheets

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}}

Example 4: Different Actions per Event

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

Common Filters in Make.com

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

Troubleshooting

Webhook Not Firing?

  1. Check webhook URL is saved in admin UI
  2. Create/update a deal to trigger it
  3. Check Firebase logs: firebase functions:log --only dealWebhookTrigger

Getting Errors in Make.com?

  1. Check webhook URL is correct
  2. Try without bearer token first
  3. Check Make.com scenario is active
  4. View Make.com execution history for error details

Authentication Issues?

  • Token is sent in both Authorization: Bearer {token} and x-make-apikey: {token} headers
  • Make.com uses x-make-apikey
  • Other services typically use Authorization

Monitoring

View Recent Webhook Calls

Firebase Console:

firebase functions:log --only dealWebhookTrigger

Firestore:

  1. Go to Firebase Console → Firestore
  2. Open webhook_logs collection
  3. Filter by success: true/false

Make.com:

  • Go to your scenario
  • Click webhook module
  • View execution history

Set Up Alerts

GCP Cloud Monitoring:

  1. Go to GCP Console → Monitoring → Alerting
  2. Create Alert Policy
  3. Filter: severity="ERROR" AND resource.labels.function_name="dealWebhookTrigger"
  4. Add notification channel (email/SMS/Slack)

Security

Bearer Token:

  • Add a token in admin UI for authentication
  • Token is sent in both Authorization and x-make-apikey headers
  • Recommended for production

HTTPS Only:

  • Only use HTTPS webhook URLs
  • Make.com URLs are always HTTPS

Limits & Behavior

  • 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_logs Firestore collection

Summary

✅ 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


Contact - Stood CRM support & integration

Clone this wiki locally