Skip to content
MockFlow DevelopersGet an API key

Announce new, renamed, trashed and shared boards in Slack with webhooks.

Updated 14 Oct 20262 min read

A marketing lead wants to know when the team starts a new campaign board, without checking MockFlow all day. This example listens for MockFlow's webhooks: each new board in the marketing space is announced in Slack and added as a row in the content tracker, and renames, trashed boards and new people are announced too.

Download the code (Node.js 18 or later, no packages)

What it does

  • Registers a webhook for board.* and member.added.

  • Receives each event, checks its signature, and ignores an event id it has already handled.

  • Posts a line to Slack for each event, and adds every new board to tracker.csv (your tracker's API in a real setup).

  • Keeps only one space's events when SPACE_ID is set.

How it works

  1. Create the webhook with POST /webhooks, your https address and the events. The answer carries the signing secret, once; the example saves it to .env.

  2. MockFlow POSTs each event to your address with a MockFlow-Signature header. Check the signature against the raw body.

  3. Answer 200 at once, then do the work. A failure is retried, so the same event can arrive again: its id stays the same.

  4. Send a test with POST /webhooks/{webhookId}/test to check the whole path.

Webhooks cover boards being created, renamed, locked, moved, trashed and restored, and people gaining or losing access. They do not fire for each edit to the items on a board.

Run the example

Create an API key in the developer console with the scopes user:read and boards:read. Set PUBLIC_URL to the https address your receiver will have, for example from ngrok http 3000, then:

cp .env.example .env        # paste your key and PUBLIC_URL into .env
node setup.js               # registers the webhook, saves its secret
node receiver.js            # in a second terminal: node setup.js test

The key code

const raw = await readBody(req);
if (!verifySignature(raw, req.headers['mockflow-signature'], SECRET)) return res.writeHead(401).end();
res.writeHead(200).end();

const event = JSON.parse(raw);
if (seen.has(event.id)) return;
seen.add(event.id);

if (event.type === 'board.created') {
  await notifySlack(`${event.actor?.email || 'Someone'} started a new board: ${event.data.title} ${event.data.url}`);
}

Adapt it

  • Project trackers: create a task in Asana or Monday for every new client board.

  • Compliance: log every share to your audit system with member.added and member.removed.

  • Automation tools: Zapier and Make can subscribe the same way; see Building a Zapier integration.

What you need

An API key with user:read and boards:read to manage webhooks. Every plan.

Was this page helpful?

Sign in to MockFlow

The same account you use in the app and on the API.

Forgot your password?
or
Continue with GoogleContinue with MicrosoftContinue with Apple