Subscription
Subscription protocol schemas
Subscription Event Type
Event types that can be subscribed to for record-level notifications.
Source: packages/spec/src/data/subscription.zod.ts
TypeScript Usage
import { RecordSubscription, SubscriptionEventType } from '@objectstack/spec/data';
import type { RecordSubscription, SubscriptionEventType } from '@objectstack/spec/data';
// Validate data
const result = RecordSubscription.parse(data);RecordSubscription
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| object | string | ✅ | Object name |
| recordId | string | ✅ | Record ID |
| userId | string | ✅ | Subscribing user ID |
| events | Enum<'comment' | 'mention' | 'field_change' | 'task' | 'approval' | 'all'>[] | ✅ | Event types to receive notifications for |
| channels | Enum<'in_app' | 'email' | 'push' | 'slack'>[] | ✅ | Notification delivery channels |
| active | boolean | ✅ | Whether the subscription is active |
| createdAt | string | ✅ | Subscription creation timestamp |
SubscriptionEventType
Allowed Values
commentmentionfield_changetaskapprovalall