Skip to main content

Demostack Webhooks

Webhooks allow your systems to react to activity happening inside Demostack in real time.

Updated over 2 weeks ago

Who Is This For?

Teams that want to:

  • Trigger CRM updates when a prospect engages with a demo

  • Log demo and sandbox activity in internal systems

  • Build automation workflows around demo engagement


Getting Started

  1. Go to Organization Settings β†’ Webhook

  2. Click Create Webhook

  3. Enter your endpoint URL and select the events you want to subscribe to

  4. Save - your webhook is now active


Event Types

Event

Description

tour.session.started

A tour session began

tour.session.ended

A tour session ended

demo.session.started

A demo session began

demo.session.ended

A demo session ended

sandbox.session.started

A sandbox session began

sandbox.session.ended

A sandbox session ended

demo.highlight.triggered

A demo highlight was triggered


Payload

Every webhook delivery sends a JSON POST request with the following body:

json

{   
"event_id": "12345",
"event_type": "demo.session.started",
"delivery_id": "67890",
"data": { ... }
}

Field

Type

Description

event_id

string

Unique identifier for the event

event_type

string

One of the event types listed above

delivery_id

string

Unique identifier for this delivery attempt

data

object

Event-specific payload data


HTTP Headers

Every request includes the following headers:

Header

Example

Description

X-Demostack-Webhook-Id

42

The webhook configuration ID

X-Demostack-Event-Type

demo.session.started

The event type

X-Demostack-Delivery-Id

67890

Unique delivery attempt ID

X-Demostack-Timestamp

2025-01-15T12:00:00Z

UTC delivery timestamp (used in signature verification)

X-Demostack-Signature

sha256=a1b2c3...

HMAC-SHA256 signature for request verification


Verifying Webhook Signatures

We recommend verifying every incoming webhook to ensure it was sent by Demostack and not tampered with.

How it works: The signature is computed over the timestamp and raw request body, which prevents replay attacks. To verify:

  1. Concatenate the X-Demostack-Timestamp header value, a dot (.), and the raw request body

  2. Compute an HMAC-SHA256 using your webhook's signing secret

  3. Compare the result to the X-Demostack-Signature header

Example (Python):

import hashlib, hmac  timestamp = request.headers["X-Demostack-Timestamp"]
message = f"{timestamp}.".encode("utf-8") + request.body

expected = "sha256=" + hmac.new(
signing_secret.encode("utf-8"),
message,
hashlib.sha256,
).hexdigest()

assert hmac.compare_digest(expected, request.headers["X-Demostack-Signature"])

Did this answer your question?