Skip to content

Webhooks integration

Send buyer intent leads to any endpoint

Needle POSTs one JSON event per hot or worth-engaging lead to the HTTPS URL you choose, signed with a secret only you and Needle hold. Use it for your own API, for Zapier through "Webhooks by Zapier", or for any tool without a native integration.

7-day free trial - no card. Cancel anytime.

How it works

  1. Step 1

    Save a brand and turn on Auto Search

    Add the problem phrases, competitors, and communities you care about. Needle reruns the search on your schedule.

  2. Step 2

    Add your endpoint

    Paste an HTTPS URL that accepts POST requests, then click Test and enable. Needle sends a test event and shows the signing secret once - copy it.

  3. Step 3

    Verify, then handle the event

    Check X-Needle-Signature against the raw body, dedupe on event_id, and route the lead wherever you need.

Why teams use the webhook

Available on the Growth plan and up.

  • Reach any tool

    Connect a CRM, ticketing system, or internal app that has no native Needle integration.

  • No-code friendly

    Point it at a "Webhooks by Zapier" catch hook, or use the Make and n8n destinations, which come with ready-made templates.

  • Signed and deduped

    Every request is signed with HMAC-SHA256 using a secret for that endpoint, and carries a stable event_id so retries never create duplicates on your side.

  • Resilient delivery

    Failed requests are retried. If your endpoint starts returning 401, 403, 404, or 410, Needle pauses it and shows the error in the dashboard.

The payload: LeadEvent v1

One event per lead, sent as the JSON request body. Values below are illustrative. The schema only gains optional fields; anything breaking becomes v2.

Example event

{
  "schema": "needle.lead_event.v1",
  "event": "lead.created",
  "event_id": "9f2c…64 hex characters…e1",
  "occurred_at": "2026-10-30T12:00:00.000Z",
  "brand": { "id": "brand_123", "name": "Acme" },
  "lead": {
    "id": "t3_example",
    "platform": "reddit",
    "url": "https://www.reddit.com/r/agency/comments/example/",
    "author": "example_user",
    "title": "Which CRM do small agencies actually stick with?",
    "excerpt": "We're a 6-person agency and our spreadsheet pipeline is falling apart…",
    "posted_at": "2026-10-30T09:41:00.000Z",
    "tier": "hot_lead",
    "lead_score": 0.82,
    "relevance": 0.71,
    "intent_type": null,
    "evidence": null,
    "matched_term": "crm for agencies",
    "competitor_mentions": ["HubSpot"],
    "dashboard_url": "https://useneedle.net/dashboard/search/auto?brandId=brand_123"
  }
}

Fields

Nullable fields are null, not missing, when Needle has no value.

FieldTypeWhat it holds
schemastringAlways "needle.lead_event.v1" for this version.
eventstring"lead.created" for a real lead, "test" when you click Test and enable.
event_idstring64-character hex SHA-256, stable for the same brand and post. Use it to dedupe.
occurred_atstringISO 8601 time the event was built.
brand.id, brand.namestringThe Needle brand that found the lead.
lead.idstring | nullThe post id on its platform, when known.
lead.platformstringCommunity the post is from, for example "reddit" or "hackernews".
lead.urlstringLink to the post or thread.
lead.authorstring | nullUsername on that platform.
lead.titlestringPost title, or its first line (up to 140 characters).
lead.excerptstringFirst ~500 characters of the post text.
lead.posted_atstring | nullISO 8601 time the post was published.
lead.tierstring"hot_lead" or "worth_engaging".
lead.lead_scorenumber | nullBuying-intent score from 0 to 1, when scored.
lead.relevancenumber | nullHow closely the post matches your brand, 0 to 1.
lead.intent_typestring | nullKind of intent, when available. Null for now on most leads.
lead.evidencestring | nullThe sentence that shows the intent, when available.
lead.matched_termstring | nullThe search phrase that matched, when known.
lead.competitor_mentionsstring[]Competitors named in the post (can be empty).
lead.dashboard_urlstringOpens the brand’s Auto Search results in Needle (with UTM tags).

Request headers

Return any 2xx status quickly; do slow work after responding.

HeaderValue
Content-Typeapplication/json
X-Needle-Event-IdSame value as event_id in the body.
X-Needle-Signaturet=<unix seconds>,v1=<hex HMAC-SHA256(secret, "<t>.<raw body>")>

Verify the signature

Use the whole signing secret, including the whsec_ prefix, as the HMAC key. Recompute HMAC-SHA256 over "<t>.<raw body>" using the bytes you received (not re-serialized JSON), compare in constant time, and reject timestamps more than 5 minutes old.

Node.js (Express)

import crypto from 'node:crypto';
import express from 'express';

const app = express();
const SECRET = process.env.NEEDLE_SIGNING_SECRET; // whsec_..., the whole value

// express.raw keeps the exact bytes Needle signed. Do not JSON-parse first.
app.post(
  '/needle-webhook',
  express.raw({ type: 'application/json' }),
  (req, res) => {
    const header = req.get('X-Needle-Signature') || '';
    const parts = Object.fromEntries(
      header.split(',').map(kv => {
        const i = kv.indexOf('=');
        return [kv.slice(0, i).trim(), kv.slice(i + 1).trim()];
      })
    );
    const t = Number(parts.t);
    const raw = req.body.toString('utf8');
    const expected = crypto
      .createHmac('sha256', SECRET)
      .update(`${t}.${raw}`)
      .digest('hex');

    const fresh =
      Number.isInteger(t) && Math.abs(Date.now() / 1000 - t) <= 5 * 60;
    const given = Buffer.from(parts.v1 || '');
    const valid =
      given.length === expected.length &&
      crypto.timingSafeEqual(given, Buffer.from(expected));
    if (!fresh || !valid) return res.status(400).send('invalid signature');

    const event = JSON.parse(raw);
    if (event.event === 'test') return res.sendStatus(200);
    // Dedupe on event.event_id, then store or route event.lead.
    return res.sendStatus(200);
  }
);

Python (Flask)

import hashlib
import hmac
import json
import os
import time

from flask import Flask, abort, request

app = Flask(__name__)
SECRET = os.environ["NEEDLE_SIGNING_SECRET"].encode()  # whsec_..., the whole value


@app.post("/needle-webhook")
def needle_webhook():
    raw = request.get_data()  # exact bytes Needle signed; parse only after verifying
    header = request.headers.get("X-Needle-Signature", "")
    parts = dict(kv.split("=", 1) for kv in header.split(",") if "=" in kv)
    try:
        t = int(parts["t"])
    except (KeyError, ValueError):
        abort(400)
    if abs(time.time() - t) > 5 * 60:
        abort(400)

    expected = hmac.new(SECRET, f"{t}.".encode() + raw, hashlib.sha256).hexdigest()
    if not hmac.compare_digest(expected, parts.get("v1", "")):
        abort(400)

    event = json.loads(raw)
    if event["event"] == "test":
        return "", 200
    # Dedupe on event["event_id"], then store or route event["lead"].
    return "", 200

When a custom webhook is the wrong choice

  • You want alerts in team chat

    Slack, Discord, Google Chat, and Teams are native destinations with digests and hot-lead alerts. No endpoint to run.

  • You only need a lead log

    Google Sheets (with our Apps Script), Notion, or Airtable keep a running list without any code on your side.

  • You want an email for every lead

    Community posts carry usernames, not emails, and the payload does not include one. For outbound, route leads through Clay to enrich them first.

Frequently asked questions

Setup, limits, and every platform are covered in the docs.

What does the payload look like?
A LeadEvent v1 JSON object: schema, event ("lead.created" or "test"), event_id, occurred_at, brand (id and name), and lead (platform, url, author, title, excerpt, posted_at, tier, lead_score, relevance, intent_type, evidence, matched_term, competitor_mentions, dashboard_url).
How do I know a request came from Needle?
Each request carries X-Needle-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">, keyed with the signing secret Needle showed when you clicked Test and enable. Recompute it, compare in constant time, and reject timestamps older than 5 minutes.
I lost the signing secret. What now?
Needle shows it only once. Run Test and enable again: Needle issues a new secret for the endpoint, and you update your receiver with it.
Does the endpoint have to use HTTPS?
Yes. Needle only sends to https:// URLs.
What happens if my endpoint is down?
Network errors and 5xx responses are retried. A 401, 403, 404, or 410 pauses the webhook and records the error so you can fix the URL and re-enable it.
How often is it called?
Needle sends one request per hot or worth-engaging lead after each Auto Search run - at most 25 per destination per run - and never sends the same lead to the same destination twice within 30 days. Runs follow the interval you set per brand: every 4 to 24 hours on Growth, as often as hourly on Scale.
Does it work with Zapier?
Yes, through "Webhooks by Zapier": use a Catch Hook trigger and paste its URL here. Zapier steps can then map lead.url, lead.title, and the other fields. There is no Needle app in the Zapier directory yet.
Does Needle reply or post for me?
No. Needle finds and ranks conversations and can draft a reply for you to edit. You decide whether to respond, and you post it yourself.

Connect Needle to Webhooks today

Send ranked buyer threads to Webhooks on your Auto Search schedule, so the conversations worth replying to land where your team already works.