Events
Subscribe to any of these, or to* for all of them.
Create a subscription
Register an endpoint with the events you care about. The signingsecret is returned only in this response, so store it now.
Payload
Every delivery is a JSON POST with this envelope:Verify the signature
Compute an HMAC-SHA256 of the raw request body with your webhook secret, hex-encode it, prefixsha256=, and compare it to X-GainTrace-Signature with a constant-time check. Reject any request that does not match.
Sign the raw bytes, before any JSON parsing or re-serialization. Reparsing
and re-stringifying can reorder keys and break the signature.
Custom headers
For an extra layer of authentication, attach custom headers that your receiver checks (for example a shared secret or bearer token). They are sent with every delivery.Content-Type, X-GainTrace-*, Host, …) cannot be set. Header values may hold secrets, so they are redacted (***) in every API response. Max 20 headers, 4KB total.
Delivery and retries
- Immediate. Delivery is attempted the moment the event fires, not on a schedule.
- Respond fast. Return a
2xxwithin 10 seconds. A non-2xx, a timeout, or a connection error counts as a failure. - Retried with backoff. Failed deliveries retry with exponential backoff over roughly the next few hours.
- Auto-disabled. After a long run of consecutive failures the endpoint is disabled (
disabledAtis set andactivebecomesfalse). Fix your receiver, then re-enable it.
Test an endpoint
Send a signedping to your endpoint at any time and get the result back: