API & Development min read Intermediate

Webhooks and Real-time Event Integration

# Webhooks and Real-time Event Integration Imagine your creator business operating with the precision of a Swiss watch—every customer action instantly triggering the perfect response across your en...

By george.olah@code24.ro Sep 29, 2025 5 views

Webhooks and Real-time Event Integration

Imagine your creator business operating with the precision of a Swiss watch—every customer action instantly triggering the perfect response across your entire digital ecosystem. Webhooks transform this vision into reality, creating real-time connections between Selgora and your favorite tools, enabling sophisticated automation that responds to customer behavior immediately rather than hours or days later.

The Real-Time Advantage

Success demands immediacy. When customers subscribe, purchase, or engage with your content, the speed of your response directly impacts their experience and your business outcomes. Webhooks eliminate the delay between customer actions and system responses, creating seamless experiences that feel almost telepathic in their responsiveness.

Why Webhooks Change Everything

Instant Response Capability: React to customer behavior in milliseconds rather than polling for changes every few minutes. This creates dynamic, personalized experiences that adapt to customer actions in real-time.

Reduced System Load: Instead of constantly checking for updates, webhooks notify your systems only when relevant events occur, dramatically reducing server overhead and improving performance.

Unlimited Integration Possibilities: Connect Selgora with any system that accepts HTTP requests, enabling custom automations limited only by your imagination and business requirements.

Understanding Selgora's Webhook Architecture

Event-Driven Communication

HTTP POST Notifications: When significant events occur in your Selgora account, the system immediately sends HTTP POST requests to URLs you specify, carrying detailed event information in JSON format.

Reliable Delivery: Webhooks include retry logic with exponential backoff to ensure critical events reach their destinations even if your receiving systems experience temporary unavailability.

Security and Verification: All webhook payloads include cryptographic signatures that allow you to verify the authenticity of incoming events, preventing malicious or spoofed notifications.

Webhook Types and Events

Marketing Flow Webhooks: Receive notifications when customers trigger specific conditions in your marketing automation workflows:

  • Customer reaches specific automation step
  • Conditional branching outcomes
  • Flow completion events
  • Error conditions requiring attention

Landing Page Form Submissions: Instant notifications when prospects complete forms on your landing pages:

  • Lead magnet signups
  • Contact form submissions
  • Survey completions
  • Newsletter subscriptions

Contact Management Events: Real-time updates about your audience interactions:

  • New contact additions
  • Contact information updates
  • List membership changes
  • Segment qualifications

Setting Up Marketing Flow Webhooks

Webhook Endpoint Configuration

Unique Webhook URLs: Each marketing flow can trigger webhooks to unique endpoints, enabling specific response logic for different customer journeys.

URL Format:

https://app.selgora.com/api/webhooks/marketing-flow/{uniqueId}

HTTP Methods Supported:

  • GET: For simple ping/notification scenarios
  • POST: For detailed data transmission (recommended)
  • PUT: For update operations
  • PATCH: For partial update operations

Marketing Flow Integration Example

E-commerce Integration: When customers purchase specific offers, trigger webhooks that:

  1. Add customer to specialized email sequences
  2. Create records in external CRM systems
  3. Notify fulfillment systems for physical products
  4. Update customer success platforms with purchase data

Implementation in Flow Builder:

  1. Create new marketing flow or edit existing flow
  2. Add "Webhook" action step at desired trigger point
  3. Configure destination URL and HTTP method
  4. Set custom headers and payload structure
  5. Test webhook delivery with sample data

Advanced Webhook Configuration

Custom Headers: Add authentication tokens, API keys, or custom identifiers:

{
  "Authorization": "Bearer your-external-system-token",
  "X-Source": "selgora-marketing-flow",
  "X-Customer-Tier": "premium"
}

Payload Customization: Structure webhook data to match receiving system requirements:

{
  "event_type": "customer_purchased",
  "customer": {
    "email": "customer@example.com",
    "purchase_amount": 297,
    "offer_name": "Advanced Creator Course"
  },
  "metadata": {
    "flow_id": "advanced_onboarding",
    "step_id": "purchase_confirmation"
  }
}

Landing Page Form Webhook Integration

Form Submission Processing

Real-time Lead Capture: Every form submission on your Selgora landing pages can trigger immediate webhooks to external systems:

Endpoint: https://app.selgora.com/api/landing-pages/form-submission Method: POST Rate Limit: 30 submissions per minute per IP

Automatic Data Processing: Form submissions automatically:

  • Create or update contacts in Selgora
  • Apply specified tags and list memberships
  • Trigger marketing flow enrollment
  • Send webhook notifications to configured endpoints

Form Webhook Configuration

Landing Page Setup:

  1. Create landing page with integrated forms
  2. Configure form fields and validation rules
  3. Set webhook destination URLs for form submissions
  4. Specify contact handling and marketing flow triggers
  5. Test form submission and webhook delivery

Integration Examples:

CRM Integration:

// Webhook receiver for form submissions
app.post('/selgora-form-webhook', (req, res) => {
  const formData = req.body;

  // Add contact to external CRM
  const crmContact = {
    email: formData.email,
    first_name: formData.first_name,
    source: 'selgora_landing_page',
    tags: formData.applied_tags,
    custom_fields: formData.custom_fields
  };

  crm.createContact(crmContact);

  // Send confirmation response
  res.status(200).json({ status: 'processed' });
});

Advanced Integration Patterns

Multi-System Orchestration

Customer Journey Automation: Design sophisticated workflows that span multiple platforms:

Example: Course Purchase Flow

  1. Customer purchases course on Selgora
  2. Marketing flow webhook notifies external systems
  3. CRM updates customer tier and purchase history
  4. Email platform sends personalized welcome sequence
  5. Community platform grants access to exclusive groups
  6. Project management tool creates customer success tasks

Technical Implementation:

def handle_course_purchase_webhook(payload):
    customer_data = payload['customer']
    offer_data = payload['offer']

    # Update CRM
    crm_client.update_customer(
        email=customer_data['email'],
        tier='course_purchaser',
        last_purchase=offer_data['name']
    )

    # Trigger email sequence
    email_platform.enroll_in_sequence(
        customer_data['email'],
        sequence='course_welcome_series'
    )

    # Grant community access
    community_platform.add_to_group(
        customer_data['email'],
        group='course_students'
    )

    # Create success task
    project_tool.create_task(
        title=f"Onboard {customer_data['name']}",
        assignee='customer_success_team',
        due_date='+3 days'
    )

Conditional Logic Implementation

Smart Webhook Routing: Use webhook payload data to trigger different responses based on customer attributes or behavior:

function processWebhookEvent(eventData) {
  const customer = eventData.customer;
  const eventType = eventData.event_type;

  // Route based on customer tier
  if (customer.tier === 'vip') {
    handleVIPCustomerEvent(eventData);
  } else if (customer.tier === 'premium') {
    handlePremiumCustomerEvent(eventData);
  } else {
    handleStandardCustomerEvent(eventData);
  }

  // Additional routing based on event type
  switch (eventType) {
    case 'subscription_started':
      triggerOnboardingSequence(customer);
      break;
    case 'subscription_cancelled':
      triggerRetentionCampaign(customer);
      break;
    case 'high_engagement_detected':
      flagForUpsellOpportunity(customer);
      break;
  }
}

Webhook Security and Authentication

Signature Verification

Cryptographic Security: Selgora signs all webhook payloads using HMAC-SHA256, allowing you to verify that incoming requests are authentic and unmodified.

Verification Implementation:

import hmac
import hashlib

def verify_webhook_signature(payload, signature, secret):
    """Verify webhook payload authenticity"""
    expected_signature = hmac.new(
        secret.encode('utf-8'),
        payload.encode('utf-8'),
        hashlib.sha256
    ).hexdigest()

    return hmac.compare_digest(signature, expected_signature)

# Usage in webhook handler
def handle_webhook(request):
    payload = request.body
    signature = request.headers.get('X-Selgora-Signature')

    if not verify_webhook_signature(payload, signature, WEBHOOK_SECRET):
        return HttpResponse('Unauthorized', status=401)

    # Process verified webhook
    process_webhook_data(json.loads(payload))
    return HttpResponse('OK')

Rate Limiting and Retry Logic

Built-in Rate Limiting: Webhooks respect rate limits to prevent overwhelming receiving systems:

  • Marketing flow webhooks: 120 requests per minute
  • Form submission webhooks: 30 requests per minute per IP

Intelligent Retry Strategy: When webhook delivery fails, Selgora implements exponential backoff retry logic:

  1. Immediate retry (0 seconds)
  2. First retry (2 seconds)
  3. Second retry (8 seconds)
  4. Third retry (32 seconds)
  5. Fourth retry (128 seconds)
  6. Final retry (512 seconds)

Popular Integration Examples

Zapier Integration

No-Code Webhook Processing: Connect Selgora webhooks to thousands of apps through Zapier:

  1. Create Zapier webhook trigger
  2. Configure Selgora marketing flow to send webhooks to Zapier URL
  3. Set up Zapier actions based on webhook data
  4. Test integration with sample events

Common Zapier Workflows:

  • New subscriber → Add to Google Sheets + Send Slack notification
  • Course purchase → Create Notion database entry + Schedule follow-up email
  • High engagement → Add to premium email list + Create CRM opportunity

Make.com (Integromat) Automation

Visual Workflow Builder: Design complex multi-step automations triggered by Selgora webhooks:

Example Scenario: Customer completes course

  1. Webhook triggers Make.com scenario
  2. Update customer record in Airtable
  3. Send completion certificate via email
  4. Post achievement to private Facebook group
  5. Schedule follow-up survey in 7 days

Custom Business Intelligence

Real-time Analytics Dashboard: Build custom dashboards that update immediately based on Selgora events:

// Real-time dashboard update system
const dashboardUpdater = {
  async updateRevenue(webhookData) {
    const revenue = webhookData.purchase_amount;
    await database.incrementDailyRevenue(revenue);
    websocket.broadcast('revenue_update', { 
      new_total: await database.getTodayRevenue() 
    });
  },

  async updateSubscriberCount(webhookData) {
    if (webhookData.event_type === 'new_subscriber') {
      await database.incrementSubscriberCount();
      websocket.broadcast('subscriber_update', {
        new_count: await database.getTotalSubscribers()
      });
    }
  }
};

Testing and Debugging Webhooks

Webhook Testing Tools

Local Development Testing: Use ngrok to expose local development servers for webhook testing:

# Install ngrok
npm install -g ngrok

# Expose local server
ngrok http 3000

# Use generated URL in webhook configuration
# https://abc123.ngrok.io/webhook-handler

Webhook Inspection Tools:

  • RequestBin: Inspect webhook payloads and headers
  • Webhook.site: Temporary URLs for webhook testing
  • Postman: Test webhook endpoints with custom payloads

Debugging Common Issues

Webhook Delivery Failures: Common causes and solutions:

  • Timeout errors: Optimize receiving endpoint performance
  • SSL certificate issues: Ensure valid HTTPS certificates
  • Firewall blocking: Whitelist Selgora IP ranges
  • Response codes: Return 200 status for successful processing

Payload Processing Errors: Debugging strategies:

  • Log all incoming webhook payloads for analysis
  • Implement comprehensive error handling and logging
  • Validate payload structure before processing
  • Use structured logging for easy debugging

Monitoring Webhook Health

Performance Metrics: Track webhook system health:

  • Delivery success rates per endpoint
  • Average response times for webhook processing
  • Error frequency and types
  • Retry attempt success rates

Alerting Systems: Set up notifications for:

  • High webhook failure rates
  • Unusual webhook volume spikes
  • Extended endpoint unavailability
  • Processing time increases

Best Practices for Webhook Implementation

Design Principles

Idempotent Processing: Design webhook handlers to safely process duplicate events:

def handle_subscription_webhook(event_data):
    subscription_id = event_data['subscription_id']
    event_id = event_data['event_id']

    # Check if we've already processed this event
    if EventLog.objects.filter(event_id=event_id).exists():
        return HttpResponse('Already processed', status=200)

    # Process the event
    process_subscription_event(event_data)

    # Log successful processing
    EventLog.objects.create(event_id=event_id, status='processed')

    return HttpResponse('OK')

Graceful Error Handling: Implement robust error handling that doesn't break webhook delivery:

def webhook_handler(request):
    try:
        payload = json.loads(request.body)
        process_webhook(payload)
        return HttpResponse('OK')
    except json.JSONDecodeError:
        logger.error('Invalid JSON in webhook payload')
        return HttpResponse('Bad Request', status=400)
    except Exception as e:
        logger.error(f'Webhook processing error: {e}')
        # Still return 200 to prevent retries for system errors
        return HttpResponse('Processing Error', status=200)

Performance Optimization

Asynchronous Processing: Handle webhooks quickly and process data asynchronously:

import celery

@celery.task
def process_webhook_data(payload):
    # Time-intensive processing here
    update_crm_system(payload)
    send_personalized_emails(payload)
    update_analytics_dashboard(payload)

def webhook_endpoint(request):
    # Quick acknowledgment
    payload = json.loads(request.body)

    # Queue for background processing
    process_webhook_data.delay(payload)

    return HttpResponse('Queued', status=200)

Success Indicators:

  • Webhooks delivering consistently with >95% success rate
  • Receiving systems processing webhook data without errors
  • Customer automations triggering appropriately based on events
  • Real-time integrations responding within seconds of customer actions
  • Comprehensive logging and monitoring providing clear system visibility

Integration Evolution Path:

  1. Start with simple form submission webhooks
  2. Add marketing flow webhooks for basic automation
  3. Implement signature verification for security
  4. Build complex multi-system orchestration
  5. Create custom analytics and business intelligence
  6. Optimize for performance and reliability

Remember: Webhooks transform your creator business from a collection of disconnected tools into a unified, responsive ecosystem. Start with simple integrations and gradually build more sophisticated automation as your confidence and requirements grow.

The goal isn't just technical integration—it's creating seamless customer experiences that feel magical in their responsiveness and personalization.

Was this article helpful?

Your feedback helps us improve our content

Table of Contents

Need Help?

Can't find what you're looking for? Our support team is ready to assist you.

Contact Support