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. The contact.* event names stay as they are even though the product calls these records People. Every company.*, contact.* and signal.created event names where it came from in a source field, so you can ignore changes your own integration made. See Sources. A Company that POST /people creates for an unknown accountExternalId fires company.created but doesn’t start Company-created Flows. Creating or changing a subscription needs the read scope for each event: read:companies for company.*, read:contacts for contact.*, read:signals for signal.created, and read:surveys for survey.* and survey_response.*. member.* events need none, and * needs all four. A key without one gets a 403.

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:
  • timestamp is when the change happened. For a sync it is the time the record changed, which can be minutes before delivery.
  • source says what caused the event. It is on company.*, contact.* and signal.created events. See Sources.
  • changedFields is on company.updated and contact.updated when GainTrace knows which fields changed. It lists the public field names (for API writes, the fields sent in the request), such as ["plan"]. It is absent when the fields aren’t known.
  • data is the record as the matching GET returns it. For signal.created that is GET /signals/{id}, so accountId is the legacy record id and companyId is the Company id.
These headers accompany it:

Sources

The source field on a company.*, contact.* or signal.created event names what caused it: survey.*, survey_response.* and member.* events have no source on the envelope. A survey_response payload has its own source inside data, which names where the answer came from.
For changes from the app, syncs, imports, Flows and GainTrace jobs, an update only fires when a field in the public payload changes. An API PATCH or upsert always fires an update, with changedFields set to the public fields in the request, whether or not their values changed. A change to a value GainTrace computes, such as healthScore, healthStatus, contactCount, dealCount or lastActivityAt on a Company, or lastSeenAt and engagementScore on a Person, doesn’t fire an event.

Syncs, imports and bursts

A connection sync, a CSV import or a batch job can change thousands of records at once. GainTrace keeps the volume manageable:
  • One event per record per run. A record that was created and then updated in the same run arrives once, as *.created, with its final state.
  • Unchanged records send nothing. A record a sync re-reads without any public change fires no event.
  • Batches are paced. Events from syncs, imports and batch jobs such as signal detection are sent after the run finishes, in paced batches. They start within about a minute, and a large first sync arrives over time. One endpoint’s backlog doesn’t delay another endpoint’s events. A run that stops early is flushed after 15 idle minutes.
  • Order isn’t guaranteed. Use timestamp to order events, and GET the record when you need its current state.
  • Dedupe on the delivery id. X-GainTrace-Delivery stays the same across retries. GainTrace queues a sync, import or signal event once per endpoint.

Company, person and member payloads

  • company.created and company.updated send the Company as GET /companies/{id} returns it.
  • contact.created and contact.updated send the Person as GET /people/{id} returns it.
  • contact.deleted sends only the record that was removed. Deleting a Person by externalId or email removes their records at every Company, and sends one event for each. Changing a Person’s email through the API moves the whole Person, so you get a contact.updated with changedFields of ["email"] for each Company they belong to.
  • member.invited and member.joined send the teammate’s email and role.

Survey response payload

survey_response.* events carry the response as your team sees it in the response inbox:
  • band is positive, neutral, negative or unscored (custom surveys and responses without a score): NPS uses promoters (9-10), passives (7-8) and detractors (0-6); CSAT and CES use the top two points and the bottom half of their scale.
  • channel is email, in_app, api or import for new answers. qr, kiosk and link are historical values that appear only on answers collected before public links were removed. Imported and API-ingested NPS has surveyId: null and names its provider in source, for example api:retently.
  • questionAnswers pairs each answer with its question text, in question order. Statements and unanswered questions are left out. The answers keys q0, q1 and so on match its key.
  • subject is the deal, ticket, plan or custom record the response is about, or null.
  • Imported scores (channel of import) carry the provider’s id as externalId, an empty answers and no questionAnswers. They cover NPS, CSAT and CES.
  • Anonymous surveys send personId, respondentEmail, respondentName and subject as null.
  • Internal reviewer notes never leave GainTrace.

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. Events from a sync, an import or a batch job wait for the delivery sweeper instead, which runs every minute. See Syncs, imports and bursts.
  • Respond fast. Return a 2xx within 10 seconds. A non-2xx, a timeout, or a connection error counts as a failure.
  • No redirects. GainTrace does not follow redirects. A 3xx response counts as a failure, so register the final URL.
  • Retried with backoff. A failed delivery is retried after 1, 2, 4, 8 and 16 minutes (6 attempts in total, about 30 minutes), then marked failed.
  • Auto-disabled. After 15 consecutive failed deliveries the endpoint is disabled (disabledAt is set and active becomes false). A successful delivery resets the count. 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 October 20, 2026