Skip to content
Programmable

Send replies and meetings to your CRM

Programmable Social sends a signed event when a reply comes in, a meeting is booked or a draft is sent. Here is how to catch them in Zapier, Make or n8n, check they came from us, and update your CRM. For HubSpot there is also a direct connection in Developers → Webhooks and CRM, with no automation tool in between.

First, in Programmable Social

  1. Get the receiving address from your tool (each recipe below says where). It must be https.
  2. In Developers → Webhooks and CRM, add it as a Generic JSON endpoint and tick reply.received and meeting.booked (and draft.sent if you want sends logged too).
  3. Copy the signing secret (whsec_…). It's shown once. Store it in your tool as a secret, not in a step's visible text if you can avoid it.
  4. Turn the endpoint on, then turn on the Webhooks and CRM switch in Settings → Switches. Both start off. Press Test to send one signed test event.

Every event has event, occurredAt and contact (name, company, profileUrl). A reply adds message.body; a meeting adds meeting.when. The fields, headers and retries are in the API reference.

There are more events to tick when you want them: a draft that failed, a reply that was labelled, a meeting that changed or was cancelled, a new contact, a sequence that finished or stopped, and a LinkedIn connection that was accepted. The reference has a sample of each, and Test on the endpoint sends the one you pick.

Why verify

Anyone who learns your receiving address can post to it. The signature proves the event came from us and wasn't changed: X-Programmable-Signature carries a timestamp and an HMAC-SHA256 of the timestamp and the body, keyed with your secret. Check it before you write anything to your CRM, and drop an event whose eventId (also the X-Programmable-Event-Id header) you've already handled, because a delivery can be retried or sent again.

Zapier

  1. Trigger: Webhooks by Zapier, event Catch Raw Hook, so you get the body exactly as sent and the headers. Copy its URL into Programmable Social and press Test.
  2. Action: Code by Zapier, Run JavaScript. Add Input Data: secret (your whsec_ secret), signature (the X-Programmable-Signature header from the trigger) and body (the raw body from the trigger). Paste the code below. A bad signature stops the Zap there.
  3. Filter on event if you want only replies or only meetings, then add your CRM's step (find or create the contact by profile link or name, then add a note or update a field) with the fields the code step outputs.
const crypto = require("crypto");

// secret: your whsec_ signing secret. header: X-Programmable-Signature. body: the raw body string,
// or JSON.stringify(parsedBody) if the tool has already parsed it.
// The header can carry more than one v1 (while a signing secret is being rotated): accept if any matches.
function verify(secret, header, body) {
  const pairs = header.split(",").map((p) => p.split("="));
  const t = Number((pairs.find((p) => p[0] === "t") || [])[1]);
  const sigs = pairs.filter((p) => p[0] === "v1" && p[1]).map((p) => String(p[1]));
  if (!t || !sigs.length || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const expected = Buffer.from(crypto.createHmac("sha256", secret).update(t + "." + body).digest("hex"));
  return sigs.some((s) => {
    const got = Buffer.from(s);
    return got.length === expected.length && crypto.timingSafeEqual(got, expected);
  });
}

// Input Data: secret, signature (the X-Programmable-Signature header), body (the raw body)
if (!verify(inputData.secret, inputData.signature, inputData.body)) throw new Error("Bad signature");
const e = JSON.parse(inputData.body);
output = { event: e.event, name: e.contact.name, company: e.contact.company, profileUrl: e.contact.profileUrl,
           reply: e.message ? e.message.body : "", meetingWhen: e.meeting ? e.meeting.when : "" };

Make

  1. Trigger: Webhooks → Custom webhook. In its advanced settings turn on Get request headers and JSON pass-through, so the body arrives as the exact text we sent. Copy its address into Programmable Social and press Test.
  2. Verify with Make's own functions, in a Set variable step and a filter after it. Split the header on , to get t and v1, then compute sha256(t + "." + body; "hex"; secret), Make's HMAC form of sha256 with a key. The filter continues only when that equals v1 and t is within five minutes of now. Check the exact function names against Make's current function reference.
  3. Parse the body with JSON → Parse JSON, then add your CRM module (HubSpot, Pipedrive, Salesforce and others) and map contact.name, contact.company, message.body or meeting.when.

n8n

  1. Trigger: a Webhook node, method POST. Use its production URL (https) in Programmable Social, and activate the workflow.
  2. Add a Code node with the code below. It rebuilds the exact body from the parsed JSON and checks the signature. On self-hosted n8n, the Code node needs Node's crypto module allowed (NODE_FUNCTION_ALLOW_BUILTIN=crypto), and the secret in an environment variable.
  3. Add an IF or Switch node on event, then your CRM node.
const crypto = require("crypto");

// secret: your whsec_ signing secret. header: X-Programmable-Signature. body: the raw body string,
// or JSON.stringify(parsedBody) if the tool has already parsed it.
// The header can carry more than one v1 (while a signing secret is being rotated): accept if any matches.
function verify(secret, header, body) {
  const pairs = header.split(",").map((p) => p.split("="));
  const t = Number((pairs.find((p) => p[0] === "t") || [])[1]);
  const sigs = pairs.filter((p) => p[0] === "v1" && p[1]).map((p) => String(p[1]));
  if (!t || !sigs.length || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const expected = Buffer.from(crypto.createHmac("sha256", secret).update(t + "." + body).digest("hex"));
  return sigs.some((s) => {
    const got = Buffer.from(s);
    return got.length === expected.length && crypto.timingSafeEqual(got, expected);
  });
}

// Run once for all items. The Webhook node's output: headers and body.
const item = $input.first().json;
const raw = JSON.stringify(item.body); // the body exactly as we signed it
if (!verify($env.PROGRAMMABLE_WEBHOOK_SECRET, item.headers["x-programmable-signature"] || "", raw)) {
  throw new Error("Bad signature");
}
return [{ json: item.body }];

If nothing arrives

  • Developers → Webhooks and CRM lists each delivery with its status and last error.
  • Both locks must be on: the endpoint, and the Webhooks and CRM switch. A paused account sends nothing.
  • Nothing is sent about a person on the do-not-contact list.
  • The address must be https on port 443 or 8443, on a public host, and must answer without a redirect.

Zapier, Make and n8n are trademarks of their owners. Programmable Social isn't affiliated with them; check their own documentation for their current steps.

Something missing or wrong? Email [email protected].