API referenceWebhook events

Moment detected

Sent for every moment a conversation's gate lets go, the same event the conversation's stream (GET /conversations/{id}/stream) sends, with the same id. data is the moment as GET /conversations/{id}/moments lists it.

Header Parameters

Sparkle-Event*string

The event delivered.

Sparkle-Signature*string

t= the Unix time the attempt was signed, then v1= the hex HMAC-SHA256 of <t>.<body>, the body exactly as received, keyed with the whole signing secret, whsec_ prefix included, as UTF-8 bytes. Compare in constant time and reject a t more than 5 minutes from your clock. Each attempt, a retry or a replay, is signed anew. While a rotated-out secret still overlaps, the header carries one v1 per secret, the new one first: accept the delivery when any matches.

Sparkle-Delivery?string

The delivery, the same on every attempt: use it to drop repeats. A replay (POST /webhooks/{id}/deliveries/{deliveryId}/replay) is a new delivery with its own ID. It is also the delivery's id in GET /webhooks/{id}/deliveries. Absent on the test (POST /webhooks/{id}/test).

User-Agent?string

Sparkle-Webhooks/1.0. Absent on the test (POST /webhooks/{id}/test).

Request Body

application/json

created_at*string

When the event happened, to the second

Formatdate-time
data*

The moment

id*string

The event, the same on every retry and replay: use it to drop repeats

livemode*boolean

Whether the event belongs to the live environment: true when the conversation it is about is live, or the ping's subscription is

object*"event"

Always event

Value in

  • "event"
type*"moment.detected"

The event type, which the Sparkle-Event header repeats

Value in

  • "moment.detected"

Response Body

Example Requests

POST/moment.detected