Connect and automate

Webhooks (Outbound)

How to trigger external APIs when records are inserted, updated, or deleted.

Integration builders5 min read

Webhooks (Outbound): Connecting to the Outside World

Outbound Webhooks allow your NoCodeBackend database to communicate asynchronously with external services and APIs in real-time.

Whenever a record is created, updated, or deleted, NoCodeBackend can instantly fire an HTTP POST request to a target URL containing the data payload. This deep-dive guide explores how to configure webhooks, secure them, and integrate them with automation platforms like Zapier, Make (Integromat), or your own microservices.


1. Detailed Overview

Unlike Pre Hooks (which run synchronously before data is saved to validate it), Webhooks run asynchronously after data is saved to the database.

This means Webhooks do not block the API response. When a client sends a POST request to your database, the database saves the row, instantly returns a 201 Created to the client, and then queues the webhook execution in the background.

Why Use Webhooks?

  • Automation: Trigger Zapier workflows without Zapier having to constantly "poll" your database for changes.
  • Notifications: Send emails via SendGrid, SMS via Twilio, or Slack messages when specific events occur.
  • Data Synchronization: Keep an external search engine (like Algolia or Elasticsearch) synced with your MySQL database in real-time.
  • Payment Fulfillment: Provision resources or unlock features after Stripe inserts a new record into your subscriptions table.

2. Step-by-Step Guide: Zapier Integration

Let's build a webhook that sends a Welcome Email via Zapier whenever a new user registers in your application.

Step 2.1: Setting up the Catch Hook in Zapier

  1. Log into Zapier and create a new Zap.
  2. For the Trigger, select the built-in Webhooks by Zapier app.
  3. Choose the Catch Hook event.
  4. Zapier will provide you with a unique Custom Webhook URL (e.g., https://hooks.zapier.com/hooks/catch/12345/abcde/). Copy this URL.

Step 2.2: Configuring NoCodeBackend

  1. Go to the Webhooks tab in your NoCodeBackend dashboard.
  2. Click Create Webhook.
  3. Select Table: users
  4. Trigger Event: Insert (Fires only when a new row is created).
  5. Target URL: Paste the Zapier URL you copied in Step 2.1.
  6. Description: "Send Zapier Welcome Email".
  7. Click Save. The webhook is immediately active.

Step 2.3: Testing the Flow

  1. Go to the Manage Records tab and insert a new row into the users table, or use the API Docs (Swagger) to execute a POST request.
  2. Once the record is saved, switch back to Zapier.
  3. Click Test Trigger. Zapier will instantly find the request sent by NoCodeBackend.
  4. You will see the entire database row (including the id, created_at, email, etc.) in the Zapier payload.
  5. Add an Action step in Zapier (e.g., Gmail -> Send Email) and map the email field from the webhook payload to the recipient address.

3. Configuration & Parameters

When NoCodeBackend fires a webhook, it sends a standard HTTP POST request. You must ensure your receiving server can accept and parse application/json.

The Webhook Payload Structure

The JSON body sent to your Target URL will look like this:

{
  "event": "insert",
  "table": "users",
  "record": {
    "id": 1045,
    "email": "newuser@example.com",
    "full_name": "Jane Doe",
    "created_at": "2023-10-27T10:00:00Z"
  },
  "old_record": null,
  "timestamp": "2023-10-27T10:00:00Z"
}
  • event: The trigger type (insert, update, or delete).
  • table: The name of the table that triggered the event.
  • record: The complete state of the row after the operation.
  • old_record: Only populated during update and delete events. It contains the state of the row before the operation occurred, allowing you to compare what changed.

Headers and Security

By default, NoCodeBackend sends the following headers:

  • Content-Type: application/json
  • User-Agent: NoCodeBackend-Webhook/1.0

If your target endpoint requires authentication (e.g., calling an internal protected API), you can configure Custom Headers in the Webhook settings.

  • Example: Add a header Authorization: Bearer your_secret_token to secure the endpoint.

4. Best Practices & Edge Cases

  • Idempotency: Because webhooks operate over the chaotic internet, network drops can cause NoCodeBackend to retry a failed webhook delivery. Your receiving server must be "idempotent"—meaning if it receives the exact same payload twice, it shouldn't send two welcome emails. Use the database id or the timestamp to track which events you have already processed.
  • Filtering Logic: Currently, webhooks fire for every event on the table. If you only want to trigger an action when a status changes to completed, you must build that IF/ELSE logic in your receiving server (or Zapier path) by comparing record.status against old_record.status.
  • Timeouts: NoCodeBackend expects a response (even an empty 200 OK) from your target URL within 5 seconds. If your server takes 10 seconds to process the email, the webhook will register as "Failed" in the logs and may be retried. Always respond with a 200 OK immediately, and process the heavy tasks asynchronously on your end.

5. Troubleshooting

Common Errors

Error: Webhook Log shows 400 or 500 Status Code

  • Cause: NoCodeBackend successfully delivered the payload, but the target URL (e.g., Zapier or your custom server) crashed or rejected the formatting.
  • Resolution: Check the logs of the receiving server. Ensure it is configured to accept POST requests and application/json bodies.

Error: Webhook Log shows Timeout (ECONNRESET)

  • Cause: Your receiving server took longer than 5 seconds to respond, or the server is completely offline/firewalled.
  • Resolution: Optimize your endpoint to return a 200 OK before beginning heavy processing tasks, or check your firewall rules to ensure the target URL is accessible from the public internet.

Error: My API request is slow since adding webhooks

  • Cause: Impossible. Webhooks run in an isolated background queue. They have zero impact on the latency of the core REST API request. If your API is slow, check your Pre Hooks or database indexing.
Webhooks (Outbound) | Help Center