Skip to main content

Create a test webhook endpoint | Developer Documentation

Create a test webhook endpoint

Updated: Nov 7, 2025
If you aren’t ready to create your own webhook endpoint yet, you can deploy a test webhook app on Render.com that accepts webhook requests and dumps their contents to Render’s console.
Only use this app for testing purposes.

Requirements

    A Render account.A GitHub account.

    Step 1: Create a GitHub repository

    Sign into your GitHub account and create a new repo (public or private) with a name of your choice. Within the repo, create an app.js file and paste this code into it:
    // Import Express.jsconst express =require('express');// Create an Express appconst app = express();// Middleware to parse JSON bodies
    app.use(express.json());// Set port and verify_tokenconst port = process.env.PORT ||3000;const verifyToken = process.env.VERIFY_TOKEN;// Route for GET requests
    app.get('/',(req, res)=>{const{'hub.mode': mode,'hub.challenge': challenge,'hub.verify_token': token }= req.query;if(mode ==='subscribe'&& token === verifyToken){
        console.log('WEBHOOK VERIFIED');
        res.status(200).send(challenge);}else{
        res.status(403).end();}});// Route for POST requests
    app.post('/',(req, res)=>{const timestamp =newDate().toISOString().replace('T',' ').slice(0,19);
      console.log(`\n\nWebhook received ${timestamp}\n`);
      console.log(JSON.stringify(req.body,null,2));
      res.status(200).end();});// Start the server
    app.listen(port,()=>{
      console.log(`\nListening on port ${port}\n`);});

    Step 2: Deploy a Node Express app on Render

    Follow Render’s instructions for deploying a Node Express app, with these differences:
      Skip step 1Use these settings for step 3:
        Build command: npm install expressStart command: node app.jsIn the Environment Variables section, add the variable VERIFY_TOKEN and set it to a string of your choice (e.g. vibecode).
        When you’re done, click the Deploy your web service button. This will take you to the app log where you will see your app being built, which can take a few minutes. You’ll know it’s done when you see “Your service is live” in the log.
        Copy your deployed test webhook app URL, which is displayed at the top of the page under your GitHub repo name. (If you view the URL, you’ll get a 403 error, which is expected).

        Step 3: Add your test webhook app URL to your Meta app

        Open a new window/tab, and navigate to the (Meta) App Dashboard > WhatsApp > Webhooks > Configuration panel.
        Paste your test webhook app URL in the Callback URL field, and add the VERIFY_TOKEN environment variable string you set earlier to the Verify token field, then click Verify and save.
        If verification is successful, the Meta app dashboard should refresh and you should see a list of webhook fields you can subscribe to.
        Subscribe to the messages webhook field if you haven’t already.
        Also, in Render’s app log, if you see “WEBHOOK VERIFIED”, your test webhook app URL has been successfully verified.

        Step 4: Send a test message

        Back in the Meta app dashboard Configuration panel, scroll down to the messages webhook field, subscribe to the field if you haven’t already, then click the Test link.
        This will send a test message to your test webhook app. Confirm that it appears in Render app log with “Webhook received” followed by a test JSON payload:

        Troubleshooting

        If the test messages webhook doesn’t appear in the Render app dashboard log:
          Confirm that you successfully added your test webhook app URL to your Meta app (Step 3).Confirm that your app is subscribed to the messages webhook field.Make sure you are sending a messages test webhook; some test webhooks only work when your app is in Live mode, while others only work in Development mode (messages test webhooks work in both modes).