This is a recipe, not a Slack app or a Teams app. The signed alert that POST /monitor sends has its own JSON shape, and Slack and Teams each expect another, so something of yours sits in the middle: it checks the signature, writes the message and posts it.
A monitoring subscription posts a signed JSON body to the webhook_url you gave it (see Monitoring and webhooks and the supplier webhook recipe). A Slack incoming webhook wants text or blocks, and a Teams workflow webhook wants a card envelope. Our body has neither, and we do not post in their formats. The relay below receives our alert, verifies it, builds the Slack and Teams messages and sends them. Prometiam has no Slack or Teams app, and no listing in either store; Integrations says what exists.
The alert is a JSON body, signed with HMAC-SHA256 over the raw body using the webhook_secret that POST /monitor returned once. The signature is in the header X-Prometiam-Signature: sha256=<hex>. Verify it on the bytes you received, before parsing them, and compare in constant time. The body, as in the monitoring documentation:
{
"event": "company_monitor.alert",
"alert_type": "corporate_event",
"monitor_id": 42,
"label": "acme-vendor",
"company": { "id": 812044, "company_number": "A28015865", "name": "TELEFONICA SA", "country": "ES" },
"event_date": "2026-07-02",
"detail": { "event_type": "capital_change", "previous_value": "3000000", "new_value": "5000000", "notice_url": "https://www.boe.es/borme/..." },
"created_at": "2026-07-03T05:10:00Z"
}
This payload is the documentation's illustrative example, not a live alert. alert_type is corporate_event, status_change, dissolution or sanctions_match. The shape of detail depends on the alert, so the relay prints what it finds there and does not assume field names beyond notice_url.
The Slack payload comes from Slack's own package on npm, @slack/webhook (version 8.1.0 on 26 November 2026, Node 20 or later). Its README says to create an IncomingWebhook with the URL Slack gave you and call send() with text, or with blocks. Its types, from @slack/types, define a header block (plain text, up to 150 characters), a section block (up to 3,000 characters of text) and a context block. Retries are off by default, and a 4xx, rate limits included, fails at once. The relay sends a plain-text fallback in text and Block Kit blocks for the display.
Microsoft Learn, in "Create Incoming Webhooks" (read on 26 November 2026), says Office 365 Connectors in Teams, including connector-based Incoming Webhooks, were retired in May 2026. To receive webhook requests and post to a channel or chat, it says to use the Workflows app, with a template such as "Send webhook alerts to a channel" or a flow that starts with When a Teams webhook request is received. You copy the URL the workflow gives you, and send it a POST. Learn says:
If you still have an old connector URL, check with Microsoft whether it works at all: Learn states the retirement as done. The relay posts the Adaptive Card envelope that Learn's JavaScript example uses (type: "message", an attachment with contentType: "application/vnd.microsoft.card.adaptive").
One file, Node 20 or later, with npm install @slack/webhook. The Slack and Teams URLs and the webhook secret come from the environment. Set only the destinations you want.
const http = require('node:http');
const crypto = require('node:crypto');
const { IncomingWebhook } = require('@slack/webhook');
const SECRET = process.env.PROMETIAM_WEBHOOK_SECRET; // webhook_secret from POST /monitor
const SLACK_URL = process.env.SLACK_WEBHOOK_URL; // Slack incoming webhook
const TEAMS_URL = process.env.TEAMS_WORKFLOW_URL; // Teams "When a Teams webhook request is received" URL
const LABELS = {
corporate_event: 'Corporate event',
status_change: 'Status change',
dissolution: 'Dissolution',
sanctions_match: 'Sanctions match (beta screening)',
};
// 1. Verify: HMAC-SHA256 of the raw body, hex, header "sha256=<hex>".
function verify(rawBody, header) {
if (!SECRET || !header) return false;
const expected = 'sha256=' + crypto.createHmac('sha256', SECRET).update(rawBody).digest('hex');
const a = Buffer.from(expected), b = Buffer.from(header);
return a.length === b.length && crypto.timingSafeEqual(a, b);
}
// 2. Map one alert to a short text and a list of facts.
function describe(alert) {
const c = alert.company || {};
const title = `${LABELS[alert.alert_type] || alert.alert_type}: ${c.name || c.company_number} (${c.country})`;
const facts = [['Company number', c.company_number], ['Event date', alert.event_date], ['Label', alert.label]];
for (const [k, v] of Object.entries(alert.detail || {})) {
if (k !== 'notice_url' && v !== null && typeof v !== 'object') facts.push([k, String(v)]);
}
return { title, facts: facts.filter(([, v]) => v), url: alert.detail && alert.detail.notice_url };
}
// 3a. Slack: the package's IncomingWebhook, with Block Kit blocks and a plain-text fallback.
const esc = (t) => String(t).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); // Slack mrkdwn
function slackMessage(m) {
const lines = m.facts.map(([k, v]) => `*${k}:* ${esc(v)}`).join('\n');
return {
text: m.title,
blocks: [
{ type: 'header', text: { type: 'plain_text', text: m.title.slice(0, 150) } },
{ type: 'section', text: { type: 'mrkdwn', text: lines + (m.url ? `\n<${m.url}|Open the notice>` : '') } },
{ type: 'context', elements: [{ type: 'mrkdwn', text: 'Prometiam monitoring alert. A lead to review, not a finding.' }] },
],
};
}
// 3b. Teams: the Adaptive Card envelope Microsoft Learn shows for a workflow webhook.
function teamsMessage(m) {
return {
type: 'message',
attachments: [{
contentType: 'application/vnd.microsoft.card.adaptive',
contentUrl: null,
content: {
$schema: 'http://adaptivecards.io/schemas/adaptive-card.json',
type: 'AdaptiveCard',
version: '1.2',
body: [
{ type: 'TextBlock', text: m.title, weight: 'Bolder', size: 'Medium', wrap: true },
{ type: 'FactSet', facts: m.facts.map(([title, value]) => ({ title, value })) },
...(m.url ? [{ type: 'TextBlock', text: `[Open the notice](${m.url})`, wrap: true }] : []),
],
},
}],
};
}
async function relay(alert) {
const m = describe(alert);
if (SLACK_URL) await new IncomingWebhook(SLACK_URL).send(slackMessage(m));
if (TEAMS_URL) {
const r = await fetch(TEAMS_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(teamsMessage(m)) });
if (!r.ok) throw new Error(`Teams answered ${r.status}`);
}
}
http.createServer((req, res) => {
const chunks = [];
req.on('data', (c) => chunks.push(c));
req.on('end', async () => {
const raw = Buffer.concat(chunks); // the exact bytes, before any JSON parsing
if (!verify(raw, req.headers['x-prometiam-signature'])) { res.writeHead(401).end(); return; }
try {
const alert = JSON.parse(raw.toString('utf8'));
if (alert.event !== 'company_monitor.alert') { res.writeHead(200).end(); return; }
await relay(alert);
res.writeHead(200).end('ok');
} catch (e) {
console.error(e.message);
res.writeHead(500).end(); // a non-2xx tells the sender it did not land
}
});
}).listen(process.env.PORT || 8080);
The relay ran locally. A test script played Slack and Teams with a stub server on 127.0.0.1, signed the example alert with a made-up secret, and posted it to the relay. No real Slack workspace and no real Teams channel was used, so the messages below show what would be posted, not how they render. Four posts: the signed alert, the same signature on an altered body, an alert signed with another secret, and an alert with no signature.
// Local test: a stub plays Slack and Teams; no real channel is used.
const http = require('node:http');
const crypto = require('node:crypto');
const { spawn } = require('node:child_process');
const SECRET = 'whsec_local_test_only';
const got = [];
const stub = http.createServer((req, res) => {
let b = ''; req.on('data', (c) => (b += c));
req.on('end', () => { got.push({ path: req.url, body: JSON.parse(b) }); res.writeHead(200).end('ok'); });
}).listen(9101, async () => {
const relay = spawn('node', ['relay.js'], { env: { ...process.env, PORT: '9102', PROMETIAM_WEBHOOK_SECRET: SECRET,
SLACK_WEBHOOK_URL: 'http://127.0.0.1:9101/slack', TEAMS_WORKFLOW_URL: 'http://127.0.0.1:9101/teams' }, stdio: 'inherit' });
await new Promise((r) => setTimeout(r, 600));
const alert = {
event: 'company_monitor.alert', alert_type: 'corporate_event', monitor_id: 42, label: 'acme-vendor',
company: { id: 812044, company_number: 'A28015865', name: 'TELEFONICA SA', country: 'ES' },
event_date: '2026-07-02',
detail: { event_type: 'capital_change', previous_value: '3000000', new_value: '5000000', notice_url: 'https://www.boe.es/borme/...' },
created_at: '2026-07-03T05:10:00Z',
};
const body = JSON.stringify(alert);
const sig = 'sha256=' + crypto.createHmac('sha256', SECRET).update(body).digest('hex');
const post = (b, s) => fetch('http://127.0.0.1:9102/', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Prometiam-Signature': s }, body: b }).then((r) => r.status);
console.log('signed alert ->', await post(body, sig));
console.log('tampered body ->', await post(body.replace('5000000', '9000000'), sig));
console.log('wrong secret ->', await post(body, 'sha256=' + crypto.createHmac('sha256', 'other').update(body).digest('hex')));
console.log('no signature ->', await post(body, ''));
console.log('stub received', got.length, 'messages');
for (const g of got) console.log(g.path, JSON.stringify(g.body, null, 1));
relay.kill(); stub.close();
});
signed alert -> 200 tampered body -> 401 wrong secret -> 401 no signature -> 401 stub received 2 messages
The stub received the Slack body, whose section block read: *Company number:* A28015865, *Event date:* 2026-07-02, *Label:* acme-vendor, *event_type:* capital_change, *previous_value:* 3000000, *new_value:* 5000000 and a link to the notice. It received the Teams body as an Adaptive Card with a bold title ("Corporate event: TELEFONICA SA (ES)") and a FactSet of the same facts. What was not run: a real Slack or Teams post, so the card rendering, the Workflows trigger and any tenant policy are untested here.
The n8n node covers our API calls, not receiving our webhook, so the relay is built from n8n's core nodes. I read the n8n-nodes-base package (version 2.49.7 on 26 November 2026) for the nodes below; the outline was not imported into n8n and not run.
sha256= plus that value with the X-Prometiam-Signature header. A non-matching request ends here. Confirm in your n8n that the value you hash is the raw text, since a re-serialised body fails.alert_type, if you want a different message for sanctions_match.text for Slack and the card for Teams.Managing monitored companies (POST, GET and DELETE /monitor) costs 0 credits, and so does the relay. What each plan can watch: free trial 3 companies, Starter EUR 9.99 25, Professional EUR 29.99 250, Scale EUR 99.99 2,500, Enterprise on request. The trial lasts 14 days with 500 credits, a card is required and nothing is charged during it.
GET /monitor and you can read it there. Answer with a 2xx quickly and do slow work afterwards.The free trial lasts 14 days and includes 500 credits. A card is required and nothing is charged during the trial; it then continues as Starter (EUR 9.99/month) unless you cancel.