- Developers
- API reference
Webhooks
RevFirst can call your server the moment someone replies, says they’re interested, or books a meeting. Every call is signed, so you can prove it came from RevFirst.
#Set up an endpoint
- In the RevFirst app, open Integrations → API & webhooks.
- Paste your address and tick the events you want. It must be a public
https://address: nolocalhost, IP addresses, private hosts or user names in the link. - Copy the signing secret (
whsec_…). It’s shown once. - Press Send a test. A sample event with
"test": trueindataarrives right away.
#Event types
| Event | When it’s sent | data contains |
|---|---|---|
reply.received | Someone replied on email or LinkedIn. Out-of-office messages and bounces are not sent. | person, reply |
lead.interested | A reply was tagged interested: they want a call, times or more information. RevFirst also opens a deal. | person, reply, deal_id |
meeting.booked | Someone booked through your calendar link. | person, meeting, deal_id |
An interested reply sends both reply.received and lead.interested, if you subscribed to both.
#Payload
Each delivery is a POST with a JSON body and these headers:
| Header | Value |
|---|---|
RevFirst-Event | The event type, e.g. lead.interested |
RevFirst-Delivery | The event id (same as the body’s id) |
RevFirst-Signature | t=<unix seconds>,v1=<hex HMAC-SHA256> |
User-Agent | RevFirst-Webhooks/1.0 |
Content-Type | application/json |
{
"id": "evt_lead_interested_5d1e7a90-2b3c-4d5e-8f60-718293a4b5c6",
"type": "lead.interested",
"created_at": "2026-11-25T06:12:51.000Z",
"data": {
"person": {
"id": "3f2a8c1e-6b0d-4c47-9a51-2f1f0c9d7e11",
"name": "Jane Doe",
"title": "Head of Sales",
"company": "Acme",
"email": "jane@acme.com",
"linkedin_url": "https://www.linkedin.com/in/example-jane-doe",
"reason": "Hiring 3 SDRs this month"
},
"reply": {
"id": "5d1e7a90-2b3c-4d5e-8f60-718293a4b5c6",
"channel": "email",
"text": "Sounds good, send me some times next week.",
"received_at": "2026-11-25T06:12:44.000Z"
},
"deal_id": "c41f0e88-9d2a-4b7e-a1c3-55e0d6b2f917"
}
}{
"id": "evt_reply_received_8a2b11d4-7c90-4e1f-b2a3-c4d5e6f70812",
"type": "reply.received",
"created_at": "2026-11-25T08:40:02.000Z",
"data": {
"person": {
"id": "3f2a8c1e-6b0d-4c47-9a51-2f1f0c9d7e11",
"name": "Jane Doe",
"title": "Head of Sales",
"company": "Acme",
"email": "jane@acme.com",
"linkedin_url": "https://www.linkedin.com/in/example-jane-doe",
"reason": "Hiring 3 SDRs this month"
},
"reply": {
"id": "8a2b11d4-7c90-4e1f-b2a3-c4d5e6f70812",
"channel": "linkedin",
"text": "Thanks, not this quarter. Try me in January.",
"received_at": "2026-11-25T08:39:57.000Z"
}
}
}{
"id": "evt_meeting_booked_e7b9a1c2-4d3f-4a6b-9c8d-0f1e2a3b4c5d",
"type": "meeting.booked",
"created_at": "2026-11-25T09:05:10.000Z",
"data": {
"person": {
"id": "3f2a8c1e-6b0d-4c47-9a51-2f1f0c9d7e11",
"name": "Jane Doe",
"title": "Head of Sales",
"company": "Acme",
"email": "jane@acme.com",
"linkedin_url": "https://www.linkedin.com/in/example-jane-doe",
"reason": "Hiring 3 SDRs this month"
},
"meeting": {
"id": "e7b9a1c2-4d3f-4a6b-9c8d-0f1e2a3b4c5d",
"starts_at": "2026-11-27T10:30:00.000Z"
},
"deal_id": "c41f0e88-9d2a-4b7e-a1c3-55e0d6b2f917"
}
}#Verify the signature
RevFirst-Signature holds a timestamp t and v1, the hex HMAC-SHA256 of "<t>.<raw body>" keyed with your signing secret. Recompute it over the raw body, compare in constant time, and reject anything older than five minutes.
import express from "express";
import { createHmac, timingSafeEqual } from "node:crypto";
const app = express();
const SECRET = process.env.REVFIRST_WEBHOOK_SECRET; // whsec_…
function fromRevFirst(rawBody, header, secret, toleranceSeconds = 300) {
const parts = Object.fromEntries((header ?? "").split(",").map((p) => p.split("=")));
const t = Number(parts.t);
if (!parts.v1 || !Number.isFinite(t)) return false;
if (Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false; // too old: maybe a replay
const want = Buffer.from(createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex"));
const got = Buffer.from(parts.v1);
return want.length === got.length && timingSafeEqual(want, got);
}
// Use the raw body: re-serialised JSON won't match the signature.
app.post("/revfirst", express.raw({ type: "application/json" }), (req, res) => {
const raw = req.body.toString("utf8");
if (!fromRevFirst(raw, req.get("RevFirst-Signature"), SECRET)) return res.sendStatus(400);
const event = JSON.parse(raw);
res.sendStatus(200); // answer fast, then do the work
handle(event); // de-duplicate on event.id
});import hashlib, hmac, json, os, time
from flask import Flask, request, abort
app = Flask(__name__)
SECRET = os.environ["REVFIRST_WEBHOOK_SECRET"] # whsec_…
def from_revfirst(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
try:
parts = dict(p.split("=", 1) for p in (header or "").split(","))
t = int(parts["t"])
except (ValueError, KeyError):
return False
if abs(time.time() - t) > tolerance: # too old: maybe a replay
return False
signed = f"{t}.".encode() + raw_body
want = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
return hmac.compare_digest(want, parts.get("v1", ""))
@app.post("/revfirst")
def revfirst():
raw = request.get_data() # the raw body, not request.json
if not from_revfirst(raw, request.headers.get("RevFirst-Signature"), SECRET):
abort(400)
event = json.loads(raw)
handle(event) # de-duplicate on event["id"]
return "", 200#Retries and delivery
- Answer with any
2xxwithin 10 seconds. Anything else, a timeout or a redirect counts as a failure. Redirects are not followed. - Failed deliveries are retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours: six tries in all.
- An endpoint that fails 20 times in a row is switched off. Fix it, then add it again in the app.
- Delivery is at least once: the same event can arrive twice. Events can arrive out of order.
- Your address is checked to be public again on every delivery.
#Best practices
- De-duplicate on
id. Store handled ids for a few days and skip repeats. - Answer first, work later. Return
200, then queue the work, so slow jobs don’t cause retries. - Use
created_at, not arrival order, when order matters. - Fetch for full detail. Call
GET /people/{id}withdata.person.idwhen you need more. - Keep the secret secret. If it leaks, delete the endpoint and add it again for a new one.
evt_reply_received_<reply id>
evt_lead_interested_<reply id>
evt_meeting_booked_<meeting id>
evt_test_<random> (Send a test)Last updated 25 November 2026 · Questions? Write to satvik@revfirst.co