Webhooks
Audience
This is the point of Lenit webhooks. For idea.status_changed and announcement.published only, the payload carries the people connected to that idea, so your server knows who to notify right away.
The four audience types
| Type | Who it is | Notes |
|---|---|---|
author | The person who posted the idea | A single object, or absent |
commenters | Everyone who left a public comment on the idea | An array; authors of private admin notes are excluded |
voters | Identified end users who voted for the idea | An array; anonymous visitors (fingerprint) are excluded |
reactors | Identified end users who reacted with an emoji on the announcement linked to the idea | An array; fingerprint visitors are excluded |
The audience object
externalId— the sameuserIdyou passed when initializing the widgettraits— the object you passed when initializing the widget
Audience targets — choose who you receive
When you register a webhook you tick the groups you want. Anything left unticked isn't included in the payload at all.
A different audience per endpoint
Each endpoint is configured on its own, so webhook A and webhook B can receive different audiences for the same event.
Who is left out (on purpose)
CautionAlways excluded from the audience
- Votes and reactions from anonymous visitors (fingerprint) — with no
externalIdthere's no way to notify them, so they're left out of the payload. - Authors of private admin comments — a comment with
is_private = trueis an internal note, so its author isn't treated as a commenter. - The author of an admin-posted idea — when
idea.authorisn't an end user,audience.authoris empty.
A 500-person cap
Each audience group carries at most 500 people; anything beyond that is truncated before sending. This:
- Keeps the webhook payload from ballooning
- Keeps your server from timing out and returning a 504
If you need to reach more than 500 people, take the event into a queue and paginate on your side (Recipe 6 — retry queue).
Using it on your server — the core pattern
Merge the audience and dedupe
Using traits — routing by segment
Use traits to decide how each person gets notified.
Different channels for paid and free users