Skip to main content

Overview

Webhooks allow your application to receive real-time notifications when events occur in your Vambe account. Instead of polling for changes, Vambe will send HTTP POST requests to your specified endpoint when events happen.

Common Use Cases

  • Message Notifications: Get notified when customers send messages
  • Ticket Updates: Track when tickets are created, updated, or closed
  • Pipeline Changes: Monitor when contacts move through pipeline stages
  • Contact Events: Know when new contacts are created
  • Integration Sync: Keep external systems in sync with Vambe data

How Webhooks Work

  1. Configure Webhook: Set up a webhook URL in your Vambe account
  2. Events Occur: Customer sends message, ticket created, stage changed, etc.
  3. Vambe Sends Request: HTTP POST sent to your webhook URL
  4. Your Server Responds: Process the event and return 200 OK
  5. Retry Logic: If your server doesn’t respond, Vambe retries

Webhook Management API

Use the webhooks API to manage your webhook configurations programmatically.

Available Endpoints

Check the Automation & Pipelines API tab for webhook management endpoints:
  • Create Webhook: POST /api/webhooks
  • List Webhooks: GET /api/webhooks
  • Get Webhook: GET /api/webhooks/{id}
  • Update Webhook: PUT /api/webhooks/{id}
  • Delete Webhook: DELETE /api/webhooks/{id}
  • Restore Webhook: POST /api/webhooks/{id}/restore
  • Get Topics: GET /api/webhooks/topics
  • Get Webhook Calls: GET /api/webhooks/calls

Event Types (Topics)

Subscribe to specific events to receive notifications:

Message Events

message.received - Customer sends an inbound message
message.sent - Your team sends an outbound message
Note: The error_details field in message.sent is optional and only present when there are delivery errors.

Ticket Events

ticket.created - New support ticket opened
ticket.updated - Ticket status or assignment changes ticket.closed - Ticket is resolved/closed

Contact Events

contact.created - New contact added to system contact.updated - Contact information modified contact.tag_added - A tag is assigned to a contact or to one of its tickets
  • This event uses the entity envelope (topic, entity_data) instead of type and data: dispatch on event.type ?? event.topic, as the receiver examples below do.
  • Customer tags (tag.entity_type = "contact", shown as Cliente in the app) belong to the person, not to a single channel: every contact of the same customer (WhatsApp, Instagram, email…) shows them. The event fires once per assignment to the customer, with contact_id set to the contact it was applied from and ticket_id = null. Assigning a tag the customer already has, from any channel, does not fire it again; removing it and assigning it again does.
  • Customers without contacts (for example, created only from orders) can be tagged from their customer page. Then contact_id and contact are null, and entity_data.ai_customer_id identifies the customer. Webhooks filtered by channel do not receive these events, since there is no channel.
  • Ticket tags (tag.entity_type = "ticket") fire it once per assignment to a ticket, with ticket_id set, and again if the tag is removed and re-added.
  • entity_data.id identifies the tag assignment, not the tag: use tag_id (or tag.value) to know which tag was assigned.

Pipeline Events

stage.changed - Contact moves to different pipeline stage

Webhook Payload Structure

When an event occurs, Vambe sends a POST request to your webhook URL:

Setting Up Webhooks

1. Create a Webhook Endpoint

Your server must have an endpoint that:
  • Accepts POST requests
  • Returns 200 OK status
  • Responds within 5 seconds
  • Processes events asynchronously (don’t block the response)

2. Configure in Vambe

Use the API to create a webhook configuration:

3. Test Your Webhook

  • Send a test message to trigger the webhook
  • Check your server logs to verify receipt
  • Ensure you’re returning 200 OK

Security Best Practices

  1. Validate Requests: Verify requests are from Vambe
  2. Use HTTPS: Always use secure endpoints
  3. Verify Signatures: Check webhook signatures if provided
  4. Rate Limiting: Implement rate limiting on your endpoint
  5. Idempotency: Handle duplicate events gracefully

Error Handling

If your webhook endpoint fails to respond:
  • Retry Logic: Vambe will retry failed webhooks
  • Backoff Strategy: Increasing delays between retries
  • Max Retries: After several failures, webhook may be disabled
  • Monitor Logs: Check webhook call logs via API

Real-World Use Cases

Use Case 1: Auto-Response to High-Priority Messages

Use Case 2: CRM Integration on Ticket Creation

Use Case 3: Update Analytics on Stage Change

Use Case 4: Auto-Assignment Based on Message Content

Webhook Management with API

Create a Webhook

List All Webhooks

Update Webhook

Delete Webhook

Get Available Topics

View Webhook Call History

Debugging Webhooks

Log Everything During Development

Test Webhook Locally with ngrok

Common Issues

Issue: Webhook not receiving events
  • βœ… Verify webhook is active (GET /api/webhooks)
  • βœ… Check URL is publicly accessible
  • βœ… Verify subscribed to correct topics
  • βœ… Check firewall/security groups
Issue: Receiving duplicate events
  • βœ… Implement idempotency with event IDs
  • βœ… Track processed events in database
  • βœ… Return 200 OK even if duplicate
Issue: Webhook timing out
  • βœ… Process events asynchronously
  • βœ… Return 200 OK immediately
  • βœ… Don’t wait for external API calls

Advanced Patterns

Idempotency Pattern

Queue-Based Processing

Event Filtering