API
Webhooks
Be told when something new comes in, instead of asking
How webhooks work
When a run finishes, CX-Signals sends a message to each address that chose what the run found: a POST with a JSON body, signed with that address's secret. It goes out within a minute or two. Your system checks the signature, answers with a 2xx status and saves the item.
Webhooks tell you about new items and removed ones. Changes to items you already have, such as a new label or an archived talking point, are not sent: read them with changed_since (Paging and syncing).
Events
| Event | In Settings | When it is sent |
|---|---|---|
talking_point.created | New talking point | A new talking point, sent when the run that found it has finished. Only talking points the API lists (the ones the app shows) |
signal.created | New signal | A signal found for the first time, sent when the run that found it has finished. A signal that changed is not sent again: read changes with changed_since |
watch_hit.created | Watched development happened | A "watch for" item that happened, of a talking point the API lists, sent when its run has finished |
run.finished | Analysis finished (or failed) | A run ended, whatever the outcome: completed, nothing-new, partial or failed (status). Its counts say what it found |
item.deleted | Item removed | Something was removed. Remove it from your system too, within 30 days (API Terms). A removed account comes once and stands for everything under it |
Each address chooses its events. The fields of every message are in the reference, and in the webhooks section of the OpenAPI file.
As with the API, we only ever add: a message can gain fields, so ignore a field you do not know. New events can be added too. An address only gets the events it chose, but skip a type you do not know rather than fail.
Set up an address
- A workspace admin opens Settings, Integrations and switches on the API and webhooks. The first time, the admin accepts the API Terms on behalf of your organization
- Under Webhooks, choose Add address, paste the address of your system and choose the events it should get. If the API Terms have changed since your workspace accepted them, adding the address accepts the new version
- Copy the signing secret when it is shown: it is shown once and never again. Keep it with your system, like a password
- Choose Deliveries, then Send test. It sends one signed test message with no data from your workspace, and shows what your system answered
Every admin of the workspace gets an email when an address is added. If you did not expect one, delete the address.
- The address must start with
https://, use the standard port and have a public name. Addresses inside a private network are refused - A workspace can have 3 addresses, each with its own secret and its own events
- An address gets what happens after it was added. To fill your system with what came before, read the API once (your first sync)
Webhooks without an API key
You do not need an API key to receive webhooks: switching on and adding an address is enough. Automation tools such as Zapier, Make or n8n give you an address to paste. A key is still useful to catch up after your system was down for more than 3 days, and to read changes. Make one when you need it.
The message
POST /cx-signals HTTP/1.1
Content-Type: application/json
User-Agent: CX-Signals-Webhooks/1.0 (+https://cx-signals.com/help/api)
webhook-id: 0b6f3c1e-9d2a-4c7b-8e5f-1a2b3c4d5e6f
webhook-timestamp: 1794981911
webhook-signature: v1,UE3qupjwjInjMtbMeKOi3pWp51tkK+bVeLoYO50MGgA=The body, shown here over several lines (the real one is on one line):
{
"type": "talking_point.created",
"timestamp": "2026-11-18T06:05:11.204417+00:00",
"data": {
"id": "5c4b3a29-1807-4f6e-9d5c-4b3a29180700",
"account_id": "8b2f6c1e-3d4a-4e5f-9a1b-2c3d4e5f6a7b",
"text": "Northwind is cutting staff. Check whether the dispatch team using your product is affected before renewal talks start.",
"context": "Layoffs at a customer often shrink the team that uses the product, which shows up as fewer seats at renewal.",
"guidance": {
"objective": "Learn which teams are affected and protect the renewal",
"questions_to_confirm": [
"Is the dispatch team part of the restructuring?",
"Who now owns route planning?"
],
"watch_for": [
"A new head of operations",
"Depot closures"
]
},
"attention": {
"key": "act_now",
"name": "Act now"
},
"label": "churn_risk",
"strength": 71,
"confidence": "high",
"signals": [
{
"id": "1e9d8c7b-6a5f-4e3d-8c2b-1a0f9e8d7c6b",
"title": "Northwind Freight cuts 8% of staff in restructuring",
"type": {
"key": "layoffs",
"name": "Layoffs"
},
"scope": "company",
"label": "churn_risk"
}
],
"archived": false,
"archived_at": null,
"created_at": "2026-11-18T06:05:11.204417+00:00",
"updated_at": "2026-11-18T06:05:11.204417+00:00"
}
}type: the eventtimestamp: when it happeneddata: the item exactly as the API returns it, so the same code can save bothwebhook-id: the message id, the same on every trywebhook-timestamp: when this try was signed, in seconds since 1970webhook-signature: the signature, described below
Check the signature
Check every message before you trust it. CX-Signals signs messages the Standard Webhooks way, so the ready-made libraries listed there can check them for you. To check it yourself:
- Take
webhook-id,webhook-timestampand the body exactly as received, before you parse it - Join them with full stops:
id.timestamp.body - Compute the HMAC-SHA256 of that, keyed with your secret: the part after
whsec_, decoded from base64 - Put
v1,before the base64 of the result, and compare it with each space-separated value ofwebhook-signature, in constant time - Refuse the message if none match, or if
webhook-timestampis more than five minutes from your clock
In Node:
// Node 18 or later, with Express. Keep the secret in a secret store or an environment variable.
const crypto = require('node:crypto');
function verifyCxSignals(secret, headers, rawBody) {
const id = headers['webhook-id'];
const timestamp = String(headers['webhook-timestamp'] || '');
const signatures = String(headers['webhook-signature'] || '').split(' ');
if (!id || !/^\d+$/.test(timestamp)) return false;
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false; // more than 5 minutes old: refuse
const key = Buffer.from(secret.slice('whsec_'.length), 'base64');
const signed = `${id}.${timestamp}.${rawBody}`;
const want = Buffer.from('v1,' + crypto.createHmac('sha256', key).update(signed).digest('base64'));
return signatures.some((s) => {
const got = Buffer.from(s);
return got.length === want.length && crypto.timingSafeEqual(got, want);
});
}
const express = require('express');
const app = express();
// express.raw keeps the body exactly as sent: the signature is over those bytes, not over parsed JSON
app.post('/cx-signals', express.raw({ type: 'application/json' }), (req, res) => {
const body = req.body.toString('utf8');
if (!verifyCxSignals(process.env.CX_SIGNALS_WEBHOOK_SECRET, req.headers, body)) return res.sendStatus(401);
res.sendStatus(204); // answer at once, then do the work
handle(JSON.parse(body)); // skip a webhook-id you have already handled
});In Python:
# Python 3.9 or later. raw_body is the body as bytes, exactly as received.
import base64, hashlib, hmac, time
def verify_cx_signals(secret: str, headers, raw_body: bytes) -> bool:
msg_id = headers.get("webhook-id")
timestamp = headers.get("webhook-timestamp", "")
signatures = headers.get("webhook-signature", "").split(" ")
if not msg_id or not timestamp.isdigit():
return False
if abs(time.time() - int(timestamp)) > 300: # more than 5 minutes old: refuse
return False
key = base64.b64decode(secret.removeprefix("whsec_"))
signed = f"{msg_id}.{timestamp}.".encode() + raw_body
want = ("v1," + base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()).encode()
return any(hmac.compare_digest(s.encode(), want) for s in signatures)Answer quickly
- Answer with any
2xxstatus within 10 seconds. We do not read what you send back - Save the message and answer first, then do the slow work
- A redirect counts as a failure: we do not follow it, so give the final address
- Any other answer, or none in time, counts as a failure, and we try again
Retries
When a delivery fails, we try again after about 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, and then every 12 hours, with a last try 3 days after the event. After that the message is given up: catch up with the API.
While a message to an address is failing, the next ones to that address wait for its next try, so a system that is down is not flooded.
If deliveries to an address fail for 3 days in a row, we switch the address off and email every admin of the workspace. Once your system works again, use Send test, then switch the address back on in Settings.
Duplicates
A message can come more than once, for example when your system saved it but its answer reached us too late. webhook-id is the same on every try: keep the ids you have handled for at least 3 days, and skip one you have seen. Saving items by their id, as with the API, also keeps one copy.
Order
Messages to an address usually come in the order things happened, a run's talking points before its run.finished. A message that is tried again can arrive after later ones, so do not rely on the order. When the same item comes twice, its updated_at says which copy is newer.
Removed items
item.deleted carries the same entry as the deleted list. Remove the item, and any copy made from it, within 30 days: the API Terms require it. A removed account comes once and stands for everything under it. If your system missed one, the deleted list keeps it for 90 days.
When nothing is sent
- While an address is switched off, or the API and webhooks are switched off for the workspace, nothing is sent to it, and what happens meanwhile is not sent later
- If CX-Signals stops sending for a while, for example when it has switched off the API for the workspace, messages wait. They are sent once it starts again, if they are less than 3 days old
- An item the API no longer shows when its message is due, such as one removed in the meantime, is not sent. The delivery log shows it as not sent
- CX-Signals can switch off an address, for example one that is not your organization's (API Terms). Settings then shows it as switched off by CX-Signals. It cannot be switched back on, deleted or added again on the same host: write to us
The delivery log
In Settings, Integrations, each address has Deliveries: the recent messages to it, when they were sent, the result (such as HTTP 200 or timeout) and how many tries it took. It never shows the message itself. Entries are kept 30 days.
| Status | What it means |
|---|---|
| Delivered | Your system answered with a 2xx status |
| Waiting | Not sent yet, or the last try failed and another is coming. The result shows why it failed |
| Failed (gave up) | Every try failed for 3 days. Catch up with the API |
| Not sent (no longer shown) | By the time it was due, the API no longer showed the item, for example because it was removed |
| Not sent within 3 days | Sending was stopped for more than 3 days, so the message was given up. Catch up with the API |
Keeping the secret safe
- Keep the secret on your server, in a secret store or an environment variable, never in your code
- We keep it encrypted and never show it again
- If it may have leaked, add the same address again to get a new secret, move your system to it, then delete the old one. For a while both get the same messages, with the same
webhook-id. If your workspace already has 3 addresses, delete one you do not need first, or switch the old one off and delete it once the new one works - We send from addresses that can change, so check the signature instead of allowing a list of IP addresses
If you think you have found a security problem, write to support@cx-signals.com.
Last updated 2026-11-21. Questions? Contact us