NewWacht Bench is live — AI-assisted development for Wacht

createWebhookApp()

Creates a webhook app container used by endpoints, deliveries, and analytics routes. You can provide an explicit app_slug, or let the backend generate one.

Usage

The following example shows a basic usage of the backend client from @wacht/nextjs/server.

import { wachtClient } from '@wacht/nextjs/server';export async function createWebhookApp() {  const client = await wachtClient();  return client.webhooks.createWebhookApp({    name: 'Billing Webhooks',    app_slug: 'billing-webhooks',    description: 'Webhook app for billing events',    failure_notification_emails: ['ops@example.com'],  });}

Signature

function createWebhookApp(  request: CreateWebhookAppRequest,): Promise<WebhookApp>

CreateWebhookAppRequest

name?: string | undefined;
Display name for the webhook app.
app_slug?: string | undefined;
Optional app slug. If omitted, the backend generates one.
description?: string | undefined;
Optional description for the webhook app.
failure_notification_emails?: string[] | undefined;
Optional email list used for failure notifications.
event_catalog_slug?: string | undefined;
Optional event catalog slug to attach at creation time.

Return value

deployment_id?: string | undefined;
Deployment that owns the webhook app.
app_slug?: string | undefined;
Resolved app slug (provided by request or generated by backend).
name?: string | undefined;
Webhook app display name.
description?: string | null | undefined;
Webhook app description when configured.
signing_secret?: string | undefined;
Current signing secret for webhook signatures.
failure_notification_emails?: string[] | undefined;
Configured notification emails for failed deliveries.
event_catalog_slug?: string | null | undefined;
Assigned event catalog slug when one is set.
is_active?: boolean | undefined;
Whether the webhook app is active.
created_at?: string | undefined;
Creation timestamp.
updated_at?: string | undefined;
Last update timestamp.

Backend behavior

If you do not send app_slug, the backend generates a slug before storing the app.
Create the app first, then configure endpoints and event subscriptions as separate operations.

Examples

Create with an explicit slug

import { wachtClient } from '@wacht/nextjs/server';export async function createBillingWebhookApp() {  const client = await wachtClient();  return client.webhooks.createWebhookApp({    name: 'Billing Webhooks',    app_slug: 'billing-webhooks',    description: 'Webhook app for billing events',  });}

Create and let backend generate slug

import { wachtClient } from '@wacht/nextjs/server';export async function createGeneratedSlugApp() {  const client = await wachtClient();  return client.webhooks.createWebhookApp({    name: 'General Events',    failure_notification_emails: ['ops@example.com'],  });}

On this page