Webhooks

Webhooks Overview

Webhooks let trumpet notify your own endpoint in near real-time when engagement happens inside a Pod — a viewer opens it, asks a question, plays a video, downloads a file, and so on. Instead of polling, you register an HTTPS endpoint and trumpet POSTs a signed JSON payload to it as events occur.


How webhooks work

1

Create an endpoint

In Settings → Webhooks in the trumpet dashboard, click Add Endpoint, enter a publicly reachable HTTPS URL, optionally name it, and select which events it should receive. Webhooks are managed in the dashboard, not via the API.

2

Save your signing secret

When you create an endpoint, trumpet generates a signing secret prefixed with whsec_.

🔒

Copy your signing secret now

Your signing secret is shown only once at creation (and again only if you regenerate it). It cannot be retrieved later. Store it in a secrets manager or environment variable immediately.
3

Receive events

trumpet sends an HTTP POST to your URL with a JSON body and a Trumpet-Signature header. Respond promptly with a 2xx status to acknowledge receipt.

4

Verify every request

Before trusting a payload, verify the Trumpet-Signature header using your signing secret. See Verifying Signatures for the full process and code samples.


Requirements & behaviour

Endpoint URLs must use https://. Plain http:// is rejected.

Endpoints must resolve to a public address. URLs pointing to localhost, .local hosts, or private, internal, or link-local IP ranges are rejected both when saving and at delivery time. Do not point webhooks at internal services.

Delivery is fire-and-forget with no automatic retries in this version. If your endpoint is down or returns a non-2xx status, that delivery is recorded as failed and is not retried.

💡

Design for best-effort delivery

Return 2xx quickly and do any heavy processing asynchronously on your side. Treat webhooks as best-effort and reconcile critical state by other means (e.g. periodic API polling) if needed. Slow endpoints will be recorded as failed even if they would eventually have responded — trumpet enforces a short delivery timeout of a few seconds.

Delivery logs: the dashboard shows recent delivery attempts per endpoint — event type, response status, response time, and any error — so you can debug failures yourself.

Endpoint statuses

StatusMeaning
ActiveDeliveries are being sent normally.
PausedYou paused the endpoint. No deliveries are sent until you resume it.
Disabledtrumpet has disabled the endpoint (e.g. due to repeated failures). Contact support to re-enable.

The payload

Every event delivery shares the same envelope structure:

Example payload
{
  "id": "69f0bafc4cc54b506b0355d8",
  "event": "event.pod_is_viewed",
  "created": 1717160000,
  "api_version": "1",
  "data": {
    "type": "event.pod_is_viewed",
    "pod": "69f0bafc4cc54b506b0355d8",
    "crm": {
      "id": "123",
      "type": "salesforce",
      "object": "Opportunity",
    },
    "content": "Human-readable description of what happened",
    "context": { "...": "event-specific context" },
    "viewer": "viewer@example.com"
  }
}
FieldTypeDescription
idstringUnique identifier for this event. Use it as an idempotency key: the same event may in principle be delivered more than once, so dedupe on id and ignore repeats.
eventstringThe event type, e.g. event.pod_is_viewed. See the Event Reference.
creatednumberUnix timestamp (seconds) when the event was generated.
api_versionstringPayload schema version. Currently "1".
dataobjectEvent details (see below).
data.typestringSame as the top-level event.
data.podstringThe ID of the Pod the event relates to.
data.crmobjectCRM details if the Pod is linked to a CRM record (shape varies by CRM).
data.crm.idstringCRM record ID, where applicable.
data.crm.typestringCRM type, e.g. salesforce, hubspot, etc., where applicable.
data.crm.objectstringCRM object type, e.g. Opportunity, Contact, deals, companies, etc., where applicable.
data.contentstringA human-readable summary of the event.
data.contextobjectEvent-specific context (shape varies by event type).
data.viewerstringEmail of the viewer associated with the event, where available.
⚠️

Personal data in payloads

Payloads can contain personal data such as a viewer's email address. Endpoints receive data about engagement with the customer's own Pods. You are responsible for handling this data in line with your own data-protection obligations.

Headers sent with each delivery

HeaderValue
Content-Typeapplication/json
Trumpet-SignatureSignature used to verify authenticity (see Verifying Signatures).
User-AgentTrumpet-Webhooks/1.0