Alerts and webhooks
An alert follows a statistic for a place, or a saved chart or table, and tells you when a new period is published or a published value is revised. Invokely checks sources every 15 minutes and sends alerts right after it stores the new figures.
What raises an alert
new_period: a period that was not stored before for the series. revision: a stored value whose number or status (provisional, estimated) changed; the message gives the previous and the new value. Everything one ingestion run adds or revises for a series is one change, with up to 24 periods listed and period_count giving the total. Re-publishing the same figures raises nothing, and projections never raise alerts.
Create an alert
From an agent, call subscribe_alert with an indicator and a place (or workspace_item), the events you want and a channel. Over REST, POST the same JSON to /api/v1/alerts. In the browser, use Alert me on any statistic page or the alerts dashboard. Leave source out to hear about every source of the series, or pass a source id to follow one publisher.
{"indicator": "cpi_annual_change", "place": "Spain", "channel": "webhook", "webhook_url": "https://example.com/hooks/invokely"}curl -X POST "https://invokely.ai/api/v1/alerts" \
-H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"indicator": "unemployment_rate", "place": "Texas", "events": ["new_period"]}'
Channels
- To the address of your account, never to another one. One message per ingestion run lists every change, or one daily digest with email_mode daily. Each message has a one-click unsubscribe link and List-Unsubscribe headers.
- Webhook
- A signed POST to a public HTTPS URL (Builder and Pro). The URL is checked when you create the alert and before every delivery: private, loopback and internal addresses are refused, redirects are not followed and the endpoint has 5 seconds to answer.
- Feed only
- Nothing is sent. Changes wait in list_changes and the MCP resource invokely://changes for an agent to poll.
Webhook payload
The body is JSON. type is series.new_period, series.revision or alert.test (from the test button). data has the same fields as a list_changes entry: the indicator, place, frequency, periods with their values, the source with a citable URL, and links to the page and the API.
{
"type": "series.new_period",
"timestamp": "2026-10-14T07:15:02.000Z",
"alert": {
"id": "alr_3f9a0c1d2e4b5a6978c0d1e2",
"label": "Consumer prices, annual change, Spain"
},
"data": {
"id": "evt_1842",
"type": "new_period",
"created_at": "2026-10-14T07:14:55.000Z",
"indicator": {
"id": "cpi_annual_change",
"name": "Consumer prices, annual change",
"unit": "percent"
},
"place": {
"id": "es",
"name": "Spain"
},
"frequency": "month",
"period_count": 1,
"first_period": "2026-09",
"last_period": "2026-09",
"changes": [
{
"period": "2026-09",
"value": 2.9,
"status": "provisional"
}
],
"source": {
"id": "ine",
"name": "INE",
"publisher": "Instituto Nacional de EstadÃstica",
"url": "https://www.ine.es/jaxiT3/Tabla.htm?t=76125"
},
"links": {
"page": "https://invokely.ai/en/consumer-prices-annual-change/spain",
"api": "https://invokely.ai/api/v1/series?indicator=cpi_annual_change&place=es"
}
}
}
Verify signatures
Messages follow the Standard Webhooks specification, so any Standard Webhooks library can verify them. The signing secret (whsec_ followed by base64) is shown once, when the alert is created or its secret is renewed. Each message has three headers:
webhook-id: the message id, msg_ followed by a number: one per change and alert. It is the same on every retry, so use it to ignore a message you have already handled. data.id (evt_ and a number) names the change itself and is shared by every alert it matched.webhook-timestamp: when the message was signed, in Unix seconds.webhook-signature: v1, a comma and the base64 HMAC-SHA256 of id.timestamp.body under the decoded secret. Several space-separated signatures may appear; accept the message if any v1 signature matches.
Compute the signature over the raw body, compare in constant time, and refuse timestamps more than five minutes from your clock. Together with the message id this stops replayed messages.
Node.js
import crypto from 'node:crypto';
// secret is the whsec_... value shown once when the alert was created.
// rawBody is the request body exactly as received, before any JSON parsing.
export function verifyInvokelyWebhook(secret, headers, rawBody) {
const id = headers['webhook-id'];
const timestamp = headers['webhook-timestamp'];
const signatures = headers['webhook-signature'];
if (!id || !timestamp || !signatures || !/^\d+$/.test(timestamp)) return false;
// Refuse messages more than five minutes from your clock, so a captured message cannot be replayed later.
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
const expected = crypto.createHmac('sha256', key).update(`${id}.${timestamp}.${rawBody}`).digest();
return signatures.split(' ').some((entry) => {
const [version, value] = entry.split(',');
const given = Buffer.from(value ?? '', 'base64');
return version === 'v1' && given.length === expected.length && crypto.timingSafeEqual(given, expected);
});
}Python
import base64, hashlib, hmac, time
# secret is the whsec_... value shown once when the alert was created.
# raw_body is the request body exactly as received (bytes), before any JSON parsing.
def verify_invokely_webhook(secret: str, headers: dict, raw_body: bytes) -> bool:
msg_id = headers.get("webhook-id")
timestamp = headers.get("webhook-timestamp")
signatures = headers.get("webhook-signature")
if not msg_id or not timestamp or not signatures or not (timestamp.isascii() and timestamp.isdigit()):
return False
# Refuse messages more than five minutes from your clock, so a captured message cannot be replayed later.
if abs(time.time() - int(timestamp)) > 300:
return False
key = base64.b64decode(secret.removeprefix("whsec_"))
signed = f"{msg_id}.{timestamp}.".encode() + raw_body
expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest())
return any(
version == "v1" and hmac.compare_digest(value.encode(), expected)
for version, _, value in (entry.partition(",") for entry in signatures.split(" "))
)
Retries and pausing
A delivery succeeds on any 2xx answer. Anything else, a timeout or a redirect is retried after about 5 minutes, 15 minutes, 1 hour, 3 hours and 8 hours (the job runs every 15 minutes), six attempts in all. After 10 failed attempts in a row the alert is paused and you get an email; a 410 Gone answer pauses it at once. Resume it from the dashboard or with update_alert. Every attempt is logged with its status code on the alert page. Delivery is at least once, so deduplicate on webhook-id.
Polling without webhooks
list_changes (MCP) and GET /api/v1/changes return the changes matched to your alerts, oldest first. The first call covers the last 7 days, or pass since. Keep next_cursor and send it as cursor next time to get only what is new. Changes are kept for 35 days.
curl -H "Authorization: Bearer YOUR_API_KEY" "https://invokely.ai/api/v1/changes?cursor=1842"MCP clients that read resources also see invokely://changes and one invokely://series/{indicator}/{place} resource per followed series. The server is stateless and does not push resource updates; agents poll the feed or rely on email and webhooks.
Limits
| Plan | Alerts | Webhooks |
|---|---|---|
| Free | 5 | No |
| Builder | 50 | Yes |
| Pro | 500 | Yes |
Alert calls (subscribe, list, update, delete, list_changes) do not use the monthly allowance. Each account may make 60 of them a minute and send 10 test webhooks an hour. The anonymous trial endpoint cannot create alerts. Alerts on saved charts and tables need Pro, like the workspace. When a plan change leaves alerts the new plan does not cover, the daily job pauses them (past the limit, the newest ones) and sends one email that lists them. Resume them from the dashboard or with update_alert once the plan covers them.