Technical Documentation

Universal Webhooks: Delivery to Sheets, Slack & CRMs

Stream form leads into Google Sheets, Slack, Discord, HubSpot, Zoho, and custom APIs with native presets, custom headers, SSRF safety, and HMAC signatures.

Last updated:
Direct Answer

What is the core specification for universal webhooks: delivery to sheets, slack & crms?

Form2Lead dispatches HTTP POST payloads immediately after validating each form submission. With our Universal Webhook Engine, you can stream leads directly to Google Sheets (via Apps Script with 302 redirect support), Slack (native Block Kit cards), Discord (rich Embeds), HubSpot CRM (Forms API v3), Zoho CRM (with custom auth headers), or custom webhooks (with HMAC-SHA256 signatures) — with automatic retries for up to 8 attempts.

// Example Code
// Verify Form2Lead HMAC-SHA256 Signature in Node.js / Express
import crypto from 'crypto';

export function verifyForm2LeadWebhook(rawBody, signatureHeader, secret) {
  // signatureHeader format: "t=1729267200,v1=abcdef0123456789..."
  const parts = Object.fromEntries(
    signatureHeader.split(',').map((part) => part.split('='))
  );
  const timestamp = parts.t;
  const signature = parts.v1;

  if (!timestamp || !signature) return false;

  // Prevent replay attacks (reject payloads older than 5 minutes)
  const age = Math.floor(Date.now() / 1000) - parseInt(timestamp, 10);
  if (age > 300) return false;

  const expectedSignature = crypto
    .createHmac('sha256', secret)
    .update(`${timestamp}.${rawBody}`)
    .digest('hex');

  return crypto.timingSafeEqual(
    Buffer.from(signature, 'hex'),
    Buffer.from(expectedSignature, 'hex')
  );
}

Universal Multi-Format Architecture

Traditional webhooks fail because different services demand different payload structures: Slack requires Block Kit, Discord requires Embeds, HubSpot requires a specialized fields array, and spreadsheets require flat key-value pairs. Form2Lead solves this with 5 specialized format presets: Standard JSON (canonical Stripe-style event envelope), Google Sheets & Flat JSON (unpacked top-level keys), Slack Incoming Webhook (native Block Kit cards), Discord Webhook (rich Embeds with field grids), and HubSpot Forms API (direct v3 integration without middleware).

Real-Time Format Auto-Detection

When you paste an endpoint URL into Form2Lead, the dashboard automatically detects the target service based on domain patterns (hooks.slack.com, discord.com/api/webhooks, script.google.com, api.hsforms.com) and selects the optimal payload format and headers automatically. You can also manually switch formats or customize headers at any time.

Google Sheets via Apps Script (Free & Direct)

Google Apps Script Web Apps return an HTTP 302 Found redirect to script.googleusercontent.com upon receiving a POST request. Most form backends fail here because their HTTP clients either reject redirects or fail SSRF checks. Form2Lead implements safe multi-hop redirect following with per-hop IP verification. Paired with our Flat JSON preset, every submission appends directly into your Google Sheet without Zapier, Make, or any third-party subscription fees.

Slack & Discord Direct Notifications

Sending standard JSON to a Slack or Discord webhook results in HTTP 400 Bad Request. Form2Lead transforms lead submissions into rich native cards: Slack receives formatted Block Kit blocks with submission fields, timestamp, and a deep-link button to view the lead in your Form2Lead inbox; Discord receives a rich colored Embed card with organized field grids.

HubSpot & Zoho CRM Integration

For HubSpot, Form2Lead supports direct submission to HubSpot’s public Forms API v3 (https://api.hsforms.com/submissions/v3/integration/submit/{portalId}/{formGuid}) by serializing form inputs into HubSpot’s expected property structure. For Zoho CRM or private CRM APIs, use our Custom HTTP Headers editor to attach authentication tokens (e.g. Authorization: Zoho-oauthtoken YOUR_TOKEN or Bearer tokens) alongside our Flat JSON preset.

n8n, Make & Zapier Workflows

For automation builders, Form2Lead connects to n8n webhook nodes, Make.com Custom Webhooks, and Zapier Catch Hooks seamlessly. The Flat JSON preset provides clean top-level keys (e.g. name, email, company) while preserving submission metadata under prefixed keys (_submitted_at, _id, _form_id), eliminating complex JSON path traversals in your workflow steps.

Custom HTTP Headers & Authentication

Every webhook endpoint supports configurable HTTP request headers stored securely in JSONB. You can supply Bearer tokens, API keys, or custom authorization headers. Custom headers are merged into outbound requests alongside Form2Lead’s standard tracking and signature headers.

Security: HMAC-SHA256 Signatures & SSRF Protection

Every outbound delivery in Standard format includes an HMAC-SHA256 signature in the x-form2lead-signature header, computed over {timestamp}.{rawBody} using your per-webhook secret. Replay attacks are prevented by validating timestamps. Furthermore, Form2Lead enforces strict SSRF protection: all destination hosts and redirect targets are resolved via DNS, and connections to private subnets (127.0.0.1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, and cloud metadata 169.254.169.254) are permanently blocked.

Delivery Guarantees, Retries & Lease Recovery

Deliveries are dispatched asynchronously through an atomic database queue with distributed worker lease locking. If an endpoint times out or returns a non-2xx status, Form2Lead automatically retries delivery up to 8 times using exponential backoff (15s, 45s, 2m, 8m, 30m, 2h, 8h, 24h). Dead or crashed workers are automatically recovered via heartbeat lease expiration.

Delivery Inspector & Live Diagnostics

Webhooks in Form2Lead provide full transparency. The Delivery Inspector in your form dashboard lets you click on any delivery to view the exact JSON payload dispatched, the response HTTP status code, request duration in milliseconds, attempt count, and up to 2KB of the response body returned by the receiving server for immediate debugging.

Universal Webhooks: Delivery to Sheets, Slack & CRMs FAQ

Direct Answer

How does Form2Lead connect to Google Sheets without Zapier?

You deploy a minimal Google Apps Script Web App (5 lines of code) inside your Google Sheet. Form2Lead sends submissions in Flat JSON format and safely follows Google’s HTTP 302 Found redirect to script.googleusercontent.com, appending new rows instantly at zero cost.

Direct Answer

Why do Google Apps Script webhooks fail on other form backends?

Google Apps Script responds with an HTTP 302 redirect. Most form backends disable redirect following or block the redirect target due to overly strict or flawed SSRF checks. Form2Lead specifically supports multi-hop redirects while re-validating the target IP on every hop to guarantee security without breaking Google Sheets.

Direct Answer

Do I need a paid Zapier plan to send leads to Slack or Discord?

No! Form2Lead natively formats leads into Slack Block Kit cards and Discord Rich Embeds. You paste your Slack or Discord incoming webhook URL directly into Form2Lead, and messages post immediately with no third-party automation tools required.

Direct Answer

Can I configure multiple webhooks on a single form?

Yes. Form2Lead allows you to add multiple webhook endpoints to any form. For example, a single contact form submission can post a Block Kit card to Slack, append a row to Google Sheets, and stream a lead into your CRM simultaneously.

Direct Answer

How do I authenticate with a CRM like Zoho or HubSpot?

For HubSpot, use the public Forms API v3 endpoint with the HubSpot preset (no auth required), or use a private app token. For Zoho CRM, enter your webhook URL and add an Authorization header (e.g. Authorization: Zoho-oauthtoken YOUR_TOKEN) in the Custom Headers editor.

Direct Answer

How do I verify the authenticity of a Form2Lead webhook?

Every Standard delivery sends the x-form2lead-signature header with a timestamp and HMAC-SHA256 hash. Compute HMAC-SHA256 over `{timestamp}.{rawBody}` using your webhook signing secret and verify that it matches.

Direct Answer

What happens if my receiving server experiences downtime?

Form2Lead retries failed deliveries up to 8 times with exponential backoff over 24 hours. You can inspect delivery status, error codes, and response bodies in the dashboard, and manually trigger redeliveries with a single click.