Documentation · Webhooks

Webhooks

OG Manager posts a signed JSON message to your HTTPS endpoint when something happens in your workspace, so your systems can react without polling the API.

Set up an endpoint

Webhooks are part of the API, included on Starter and above.

  1. 1

    Add the endpoint

    In the app, open Webhooks, add your HTTPS URL and choose the events it receives.
  2. 2

    Copy the signing secret

    The secret (whsec_…) is shown once. Store it with your other secrets; you can rotate it from the same screen at any time.
  3. 3

    Send a test

    Send a test delivery (event webhook.test) and check that your endpoint answers with a 2xx status.

Endpoints must use https:// and resolve to a public address: URLs on private or internal networks are refused. The same endpoints can be managed through the API (webhook-endpoints, see the API reference).

Events

Subscribe to individual events, to a group with a wildcard such as lead.*, or to everything with *.

Webhook events
EventSent when
lead.createdA lead came in (form, ad, WhatsApp, call or manual entry)
lead.updatedA lead's status, owner or details changed
contact.createdA new CRM contact
appointment.bookedAn appointment was booked
appointment.cancelledAn appointment was cancelled
appointment.no_showA client did not turn up
invoice.paidAn invoice was paid in full
payment.refundedA payment was refunded
message.receivedA customer message arrived in the inbox
campaign.pausedAn ad campaign was paused
campaign.performance_changedA campaign's performance moved past its alert threshold
budget.threshold_reachedA budget line reached an alert threshold
post.publishedA social post was published
task.overdueA task passed its due date
stock.lowAn inventory item fell below its reorder level

Payload and headers

Every delivery is an HTTP POST with a JSON body. The body's data object is the record the event is about.

Example delivery (lead.created)
POST /hooks/og-manager HTTP/1.1
Content-Type: application/json
User-Agent: OGManager-Webhooks/1.0
OGM-Signature: t=1761112800,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
OGM-Event-Id: 01JB8Z3K6Q2W9Y4T0M5R7N1P8C
OGM-Event-Type: lead.created
OGM-Delivery-Id: 0192f0c4-7d2e-7a31-9b8e-5c1d2e3f4a5b
OGM-Timestamp: 1761112800

{
  "id": "01JB8Z3K6Q2W9Y4T0M5R7N1P8C",
  "type": "lead.created",
  "api_version": "2026-10-01",
  "created_at": "2026-10-22T08:00:00-04:00",
  "organization_id": "0192e5a1-3c4d-7e8f-9a0b-1c2d3e4f5a6b",
  "data": {
    "id": "0192f0c4-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
    "display_id": "LEA-000412",
    "name": "Emily Carter",
    "source": "website",
    "branch_id": "0192e5a1-9f8e-7d6c-5b4a-3c2d1e0f9a8b"
  },
  "delivery": { "id": "0192f0c4-7d2e-7a31-9b8e-5c1d2e3f4a5b", "attempt": 1 }
}
Delivery body fields
FieldMeaning
idThe event ID. The same event keeps this ID on every retry and replay: use it to ignore duplicates.
typeThe event, for example lead.created.
api_versionThe payload version of your endpoint (2026-10-01).
created_atWhen the event happened (ISO 8601).
organization_idYour workspace.
dataWhat happened: the record's ID and number and the fields that matter for this event. Fields vary by event; fetch the record through the API when you need all of it.
deliveryThis delivery's ID and attempt number (1 for the first try).

Money is in minor units with an ISO currency code ({ "amount_minor": 14900, "currency": "USD" } is $149.00). Headers repeat the event ID, type, delivery ID and timestamp so you can route a delivery before parsing it.

Verify the signature

Check every delivery before you trust it: anyone can send a POST to your URL, only OG Manager knows your secret.

  • The OGM-Signature header reads t=<unix seconds>,v1=<hex HMAC>.
  • v1 is the HMAC-SHA256 of <t>.<raw body> (the timestamp, a dot, then the body exactly as received) keyed with your endpoint secret, in lowercase hex.
  • Compute it over the raw bytes, before any JSON parsing or re-encoding, and compare in constant time.
  • Reject a timestamp more than five minutes from now, so a captured delivery cannot be replayed later.
verify.js (Node.js 18+)
import crypto from "node:crypto";

// header: "t=1761112800,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"
// Returns true or false; it never throws on a missing or malformed header.
export function verifyOgmSignature(rawBody, header, secret, toleranceSec = 300) {
  if (typeof header !== "string" || header === "") return false;
  const parts = {};
  for (const item of header.split(",")) {
    const i = item.indexOf("=");
    if (i > 0) parts[item.slice(0, i).trim()] = item.slice(i + 1).trim();
  }
  if (!/^[0-9]+$/.test(parts.t ?? "")) return false;
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > toleranceSec) return false;
  // v1 must exist and be a 64-character hex SHA-256 digest.
  if (!/^[0-9a-f]{64}$/i.test(parts.v1 ?? "")) return false;
  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${parts.t}.${rawBody}`)
    .digest();
  const received = Buffer.from(parts.v1, "hex");
  // timingSafeEqual throws a RangeError when the lengths differ, so compare lengths first.
  if (received.length !== expected.length) return false;
  return crypto.timingSafeEqual(expected, received);
}
receiver.js (Express)
import express from "express";
import { verifyOgmSignature } from "./verify.js";

const app = express();
const seen = new Set(); // use your database in production

app.post("/hooks/og-manager", express.raw({ type: "application/json" }), (req, res) => {
  const raw = req.body.toString("utf8");
  if (!verifyOgmSignature(raw, req.get("OGM-Signature"), process.env.OGM_WEBHOOK_SECRET)) {
    return res.status(400).send("Invalid signature");
  }
  const event = JSON.parse(raw);
  if (seen.has(event.id)) return res.sendStatus(200); // a retry or replay you already handled
  seen.add(event.id);
  queueForProcessing(event); // answer fast, do the work afterwards
  res.sendStatus(200);
});

A failed check should answer 400 and do nothing else. If every delivery fails the check, confirm you are using the secret of this endpoint and the unmodified body.

Responding

  • Answer with any 2xx status within 10 seconds. Queue slow work and process it after you answer.
  • Any other status, a timeout or a connection error counts as a failure and is retried. Redirects are not followed.
  • Deliveries can arrive more than once and out of order: de-duplicate on the event ID and use created_at for order.

Retries and replays

A failed delivery is retried with growing gaps (each one varied by up to 10%) for about a day, eight attempts in all.

Retry schedule
AttemptWhen
1Right away
2About 1 minute later
3About 5 minutes later
4About 15 minutes later
5About 1 hour later
6About 3 hours later
7About 6 hours later
8About 13 hours later (the last attempt)
  • After the eighth failed attempt the delivery is marked failed. Every attempt, its status code and timing show in the delivery log.
  • Replay any delivery from the delivery log, or with POST webhook-deliveries/{id}/replay. A replay is a new delivery of the same event, with the same event ID.
  • After 50 failed deliveries in a row the endpoint is disabled and its creator is notified. Fix the receiver, then enable the endpoint again; nothing is sent while it is disabled.