Webhooks

Webhooks allow your application to receive real-time updates from MangoForm when events happen, such as when a form is submitted.

What are Webhooks?

Webhooks are a way for MangoForm to send automatic notifications to your application when specific events occur. Instead of continuously polling our API for changes, your application can receive real-time updates.

How Webhooks Work

  1. Configure Endpoint
    Set up a URL in your application that will receive webhook events from MangoForm.

  2. Register Webhook
    Add your endpoint URL to MangoForm's webhook settings for your form.

  3. Receive Events
    MangoForm sends HTTP POST requests to your endpoint when events occur.

Benefits of Using Webhooks

  • Real-time updates without polling
  • Automate workflows based on form submissions
  • Integrate with your existing systems
  • Reduce API usage and improve performance

Getting Started with Webhooks

  1. Create an endpoint in your application
    Your endpoint should be able to receive HTTP POST requests and process JSON payloads.

    // Example Node.js endpoint using Express
    const express = require('express');
    const app = express();
    app.use(express.json());
    
    app.post('/webhook/mangoform', (req, res) => {
      const event = req.body;
      
      // Process the webhook event
      console.log('Received webhook:', event);
      
      // Always respond with a 200 status code to acknowledge receipt
      res.status(200).send('Webhook received');
    });
    
    app.listen(3000, () => {
      console.log('Webhook server running on port 3000');
    });
    
  2. Register your webhook in MangoForm
    Go to your form settings and add your webhook endpoint URL.

    1. Navigate to your form in the dashboard
    2. Go to Settings → Integrations → Webhooks
    3. Click "Add Webhook" and enter your endpoint URL
    4. Optionally, set up a secret key for security
    5. Save your webhook configuration
  3. Test your webhook
    You can test your webhook by submitting a test form or using the "Test" button in the webhook settings.

Need More Help?

Check out our detailed guides for more information on working with webhooks: