Notifications
Subscriptions
Subscribe to events and get notified when interactions happen.
Subscriptions connect events to notification adapters. When an interaction matches a subscription's resource type + action combination, a notification is automatically queued.
Creating a subscription
POST /api/subscriptions
{
"actionId": "uuid",
"resourceTypeId": "uuid",
"subscriberId": "uuid",
"originId": "uuid",
"config": {
"adapter": "adapter:email",
"personalizations": [{
"to": [{
"email": "{{interaction.email}}",
"name": "{{interaction.name}}"
}],
"dynamic_template_data": {
"userName": "{{interaction.name}}"
}
}],
"from": { "email": "noreply@example.com" },
"template_id": "d-template-id"
}
}Fields
| Field | Required | Description |
|---|---|---|
actionId | Yes | Action UUID to match |
resourceTypeId | Yes | Resource type UUID to match |
subscriberId | Yes | Subscriber to notify |
originId | No | Filter by origin — null matches all origins |
config | No | Adapter-specific configuration with template variables |
How it works
- An interaction is created via
POST /api/interactions - A database trigger finds all matching subscriptions (by resource type + action)
- For each match, a notification is added to the queue
- The queue processor picks it up and calls the configured adapter
- The adapter delivers the notification (email, Slack, webhook, etc.)
- The result is logged in the audit trail
Template variables
Use {{interaction.fieldName}} in your subscription config to inject values from the interaction's metadata:
{
"to": "{{interaction.email}}",
"subject": "Order {{interaction.orderId}} confirmed",
"body": "Hi {{interaction.name}}, your order is ready."
}Beyond interaction fields, you can reference global config, adapter settings, secrets, and built-in functions. See the full Template Engine reference for all available namespaces and functions.
API reference
| Method | Endpoint | Description |
|---|---|---|
GET | /api/subscriptions | List all |
GET | /api/subscriptions/:id | Get by ID |
POST | /api/subscriptions | Create |
PUT | /api/subscriptions/:id | Update |
DELETE | /api/subscriptions/:id | Delete |
POST | /api/subscriptions/:id/pause | Pause |
POST | /api/subscriptions/:id/resume | Resume |