Webhooks
Have InfoTrie call your systems when a dataset is published or degraded, or when forecasts and nowcasts are published — signed, retried, and replayable.
A webhook is an address of yours that InfoTrie calls when something happens, so you do not have to poll the API. Webhooks are included from the Professional plan. On a team account, owners, admins and developers can manage them.
This page covers data webhooks. The single webhook URL in Settings is different: it receives your account's notifications (quota warnings, key expiry…).
Create a webhook¶
A webhook belongs to an API key: it receives only what that key may read. Create a key first if you have none.
- Open Webhooks and choose New webhook.
- API key — the key whose permissions the webhook inherits.
- Endpoint URL — your receiver. It must start with
https://and be reachable on the public internet; redirects are not followed. - Events — what to be told about:
dataset.updated— a dataset you can read has a new delivery;dataset.degraded— a dataset is late or incomplete;forecast.published— new forecasts are published;nowcast.published— new macro nowcasts are published.
The number next to each event is what one delivered call costs from your monthly quota. 5. Narrow it down if you wish: Datasets (none selected means all the key may read), Symbols, Markets, and a Description. 6. Choose Create webhook.
The signing secret is shown once: copy it now and store it with your receiver's configuration.
Receive and verify a call¶
Each call is an HTTPS POST with a JSON body:
The body carries identifiers and links, not the data itself: call the API with the link to read it. Two headers come with it: InfoTrie-Event (the event type) and InfoTrie-Signature.
Verify every call before trusting it. InfoTrie-Signature reads t=<unix time>,v1=<signature>, where the signature is the hex HMAC-SHA256 of t + "." + body with your signing secret:
import hashlib, hmac, time
def verify(secret: str, header: str, body: bytes, tolerance: int = 300) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
t, sig = parts["t"], parts["v1"]
expected = hmac.new(secret.encode(), f"{t}.".encode() + body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, sig) and abs(time.time() - int(t)) < tolerance
Use the raw body as received, before any JSON parsing. Answer with a 2xx status quickly, and do the work afterwards: a slow or failing answer counts as a failed attempt. The same event can arrive twice; use its id to ignore repeats.
Retries and deliveries¶
A failed call is retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 8 hours. After the sixth failed attempt it is marked FAILED and a line is added to your recent activity. When your monthly quota is spent, calls wait as PENDING without using an attempt, and go out after the reset.
The Deliveries table lists calls by status — Failed (shown first), Pending, Delivered or All — with the number of attempts, the next attempt and the last result (HTTP 500, a timeout…). Delivered calls are kept 30 days, failed ones 90 days.
Once your receiver is fixed, choose Replay on a failed call to send it again now.
Delete a webhook¶
Choose Delete and confirm. Its delivery history is deleted with it. To change a webhook's address or events, create the new one first, then delete the old one.
An account can have up to 20 webhooks.