Developers · Standard Webhooks
Signed, reliable event delivery.
Every webhook is signed with HMAC-SHA256 following the Standard Webhooks specification (Webhook-Id, Webhook-Timestamp, Webhook-Signature), delivered asynchronously with exponential backoff, zero-downtime secret rotation, and 1-click replay in the Developer Console.
Event catalog.
Subscribe to individual events per Sandbox or Production endpoint.
| Event | Description |
|---|---|
grant.created | An adviser authorized your application via OAuth 2.1. |
grant.revoked | An adviser disconnected your app, changed credentials, or Trellia revoked access. Immediately purge cached tokens. |
portfolio.holdings.updated | New holdings snapshot published for an entitled managed account portfolio. |
portfolio.performance.updated | Updated monthly/daily performance aggregations published. |
portfolio.fees.updated | Updated RG97 portfolio fee schedule published. |
portfolio.update.published | New adviser-facing portfolio commentary/update published. |
watchlist.item.added | Investment added to an adviser's personal watchlist. |
watchlist.item.removed | Investment removed from an adviser's personal watchlist. |
TypeScript / Node.js verification.
Verify signatures over the raw UTF-8 request body before parsing JSON.
import { createHmac, timingSafeEqual } from "node:crypto";
export function verifyTrelliaWebhook(
rawBody: string,
headers: { id: string; timestamp: string; signature: string },
secret: string, // "whsec_..."
): boolean {
// conventions-ignore raw-duration: standalone partner documentation snippet
const ageSec = Math.abs(Math.floor(Date.now() / 1000) - Number(headers.timestamp));
if (!Number.isFinite(ageSec) || ageSec > 300) return false; // 5-min replay guard
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
const expected = createHmac("sha256", key)
.update(headers.id + "." + headers.timestamp + "." + rawBody, "utf8")
.digest("base64");
return headers.signature.split(" ").some((part) => {
const [version, sig] = part.split(",");
if (version !== "v1" || !sig) return false;
const a = Buffer.from(sig, "utf8");
const b = Buffer.from(expected, "utf8");
return a.length === b.length && timingSafeEqual(a, b);
});
}C# / .NET verification.
Drop-in constant-time verifier for Australian advice software stacks on .NET.
using System.Security.Cryptography;
using System.Text;
public static bool VerifyTrelliaWebhook(
string rawBody, string msgId, string timestamp, string signatureHeader, string secret)
{
if (!long.TryParse(timestamp, out var ts)) return false;
if (Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - ts) > 300) return false;
var key = Convert.FromBase64String(secret.StartsWith("whsec_") ? secret[6..] : secret);
using var hmac = new HMACSHA256(key);
var expected = Convert.ToBase64String(
hmac.ComputeHash(Encoding.UTF8.GetBytes($"{msgId}.{timestamp}.{rawBody}")));
foreach (var part in signatureHeader.Split(' ', StringSplitOptions.RemoveEmptyEntries))
{
var kv = part.Split(',', 2);
if (kv.Length == 2 && kv[0] == "v1" &&
CryptographicOperations.FixedTimeEquals(
Encoding.UTF8.GetBytes(kv[1]), Encoding.UTF8.GetBytes(expected)))
return true;
}
return false;
}Python verification.
Standard library only, zero third-party dependencies.
import base64, hashlib, hmac, time
def verify_trellia_webhook(raw_body: str, msg_id: str, timestamp: str, sig_header: str, secret: str) -> bool:
if abs(int(time.time()) - int(timestamp)) > 300:
return False
key = base64.b64decode(secret.removeprefix("whsec_"))
expected = base64.b64encode(
hmac.new(key, f"{msg_id}.{timestamp}.{raw_body}".encode(), hashlib.sha256).digest()
).decode()
for part in sig_header.split():
if part.startswith("v1,") and hmac.compare_digest(part[3:], expected):
return True
return FalsePartner with TrelliaTest signed webhooks
Test signed webhooks
in Sandbox today.
Contact us to connect your platform to Trellia.