Webhooks
The API sends events to your webhook endpoints as POST requests with a JSON body.
POST /hooks/tsg HTTP/1.1
Content-Type: application/json
TSG-Event-Id: evt_4Rt7YuI1oP3aS6dF
TSG-Signature: t=1795080687,v1=5d1c0f0b6a7e3c9a…
{
"id": "evt_4Rt7YuI1oP3aS6dF",
"object": "event",
"type": "application.approved",
"livemode": false,
"created_at": "2026-11-19T09:31:27Z",
"data": {
"object": {
"id": "app_3Nf7QwR1tY8uLk5H",
"object": "application",
"status": "approved",
"guarantee": "gua_6Yh2JmK9pL4nB7vC"
}
}
}
Event types
| Type | data.object | Description |
|---|---|---|
application.created | application | Occurs when an application is created. |
application.requirements_updated | application | Occurs when the status of a requirement changes. |
application.in_review | application | Occurs when an application enters review. |
application.approved | application | Occurs when an application is approved. |
application.declined | application | Occurs when an application is declined. |
application.cancelled | application | Occurs when an application is cancelled. |
application.expired | application | Occurs when an application expires. |
fee.paid | application | Occurs when a fee is confirmed or paid. |
fee.refunded | application | Occurs when a fee is refunded in full or in part. |
guarantee.issued | guarantee | Occurs when a guarantee is issued. |
guarantee.updated | guarantee | Occurs when a guarantee's cover is amended. |
guarantee.ended | guarantee | Occurs when a guarantee ends. |
Verify signatures
Each request includes a TSG-Signature header with a timestamp t and a signature v1. The signature is the HMAC-SHA256, keyed with the endpoint's secret, of the timestamp, a . character and the raw request body. Compute it, compare it with v1 using a constant-time comparison, and reject requests with a timestamp older than five minutes.
For 24 hours after you roll an endpoint's secret, the header carries two v1 values, one for the new secret and one for the old. Accept the request if any v1 matches.
const crypto = require("crypto");
function verify(rawBody, header, secret) {
const parts = header.split(",").map((p) => p.split("="));
const t = (parts.find(([k]) => k === "t") || [])[1];
const expected = Buffer.from(crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex"));
const matches = parts.some(([k, v]) => k === "v1" && v.length === expected.length && crypto.timingSafeEqual(Buffer.from(v), expected));
return matches && Math.abs(Date.now() / 1000 - Number(t)) <= 300;
}
Delivery
- Return a
2xxresponse within 10 seconds. Any other response, or a timeout, is treated as a failure. - Failed deliveries are retried with exponential backoff for up to 24 hours.
- Your endpoint can receive the same event more than once. Use
TSG-Event-Idto detect duplicates. - Event order isn't guaranteed. Retrieve the object if you need its current state.