
Jsonnet Webhook Designer
Setting Up Your Webhook Destination
Courier needs a destination URL to deliver webhook requests. You have two options:- Static destination: Go to Settings, scroll to Outbound Webhooks, and add a webhook with the URL and auth type.
- Dynamic destination: Pass the URL per recipient via the
webhookprofile property. See the Webhook integration docs for details.
Default Payload
If you don’t define a custom Jsonnet template, Courier sends this default payload:Available Functions and Variables
The Jsonnet editor provides these built-in functions for accessing your notification context:t() resolves a translation from the data object at render time. For Elemental templates, localize content on the elements themselves instead, using the localization API or Design Studio.
All standard Jsonnet
std library functions are also available (e.g., std.length(), std.join(), std.format()).
Writing a Custom Payload
Your Jsonnet template must evaluate to a JSON object. Usedata() and profile() to pull values from the send request.
Here’s an example that builds a custom payload for an order confirmation webhook:
Conditional Logic
Jsonnet supports conditionals, which let you vary the payload based on your data:Nested Path Access
Thedata() and profile() functions support dot-separated paths to access nested values:
null by default. You can provide a fallback as the second argument:
Webhook Integration
Set up static or dynamic webhook destinations and authentication.
Jsonnet Blocks
Use Jsonnet for Slack Block Kit and Teams Adaptive Cards.