Skip to main content
Webhooks let GainTrace notify your systems the moment something happens in your workspace, instead of you polling for changes. You register an HTTPS endpoint, subscribe to a set of events, and GainTrace delivers a signed POST to that endpoint as each event occurs.

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 signing secret is returned only in this response, so store it now.
The full secret appears only once, at creation. Later responses show a redacted secretPrefix. If you lose it, rotate by deleting and recreating the webhook.

Payload

Every delivery is a JSON POST with this envelope:
These headers accompany it:

Verify the signature

Compute an HMAC-SHA256 of the raw request body with your webhook secret, hex-encode it, prefix sha256=, 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.
Reserved and signing headers (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 2xx within 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 (disabledAt is set and active becomes false). Fix your receiver, then re-enable it.
Re-enabling clears the failure count so delivery resumes cleanly.

Test an endpoint

Send a signed ping to your endpoint at any time and get the result back:
Last modified on July 6, 2026