Webhook
Webhook protocol schemas
Source: packages/spec/src/automation/webhook.zod.ts
TypeScript Usage
import { WebhookSchema, WebhookTriggerType } from '@objectstack/spec/automation';
import type { Webhook, WebhookTriggerType } from '@objectstack/spec/automation';
// Validate data
const result = WebhookSchema.parse(data);Webhook
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Webhook name, unique per organization (lowercase snake_case) |
| label | string | optional | Human-readable webhook label |
| object | string | optional | Object whose record events (create/update/delete, bulk_update/bulk_delete) trigger this webhook |
| triggers | Enum<'create' | 'update' | 'delete' | 'bulk_update' | 'bulk_delete'>[] | optional | Events that trigger execution |
| url | string | ✅ | External webhook endpoint URL |
| method | Enum<'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'> | optional (default: "POST") | HTTP method |
| headers | Record<string, string> | optional | Custom HTTP headers |
| timeoutMs | integer | optional (default: 30000) | Request timeout in milliseconds |
| secret | string | optional | Signing secret for HMAC signature verification |
| isActive | boolean | optional (default: true) | Whether webhook is active |
| description | string | optional | Webhook description |
| protection | { lock: Enum<'none' | 'no-overlay' | 'no-delete' | 'full'>; reason: string; docsUrl?: string } | optional | Package author protection block — lock policy for this webhook. |
| _lock | Enum<'none' | 'no-overlay' | 'no-delete' | 'full'> | optional | Item-level lock — controls overlay & delete (ADR-0010). |
| _lockReason | string | optional | Human-readable reason shown when a write is refused by _lock. |
| _lockSource | Enum<'artifact' | 'package' | 'env-forced'> | optional | Layer that set _lock (artifact | package | env-forced). |
| _provenance | Enum<'package' | 'org' | 'env-forced'> | optional | Origin of the item (package | org | env-forced). |
| _packageId | string | optional | Owning package machine id. |
| _packageVersion | string | optional | Owning package version. |
| _lockDocsUrl | string | optional | Optional documentation link surfaced next to _lockReason. |
Nested Shape: Webhook.protection
| Property | Type | Required | Description |
|---|---|---|---|
| lock | Enum<'none' | 'no-overlay' | 'no-delete' | 'full'> | ✅ | Lock policy — none | no-overlay | no-delete | full. |
| reason | string | ✅ | User-visible reason shown when the lock blocks an action. |
| docsUrl | string | optional | Optional URL the Studio banner links to for more context. |
WebhookTriggerType
Allowed Values
createupdatedeletebulk_updatebulk_delete