import {createWebhookHandler} from "attio/server"

Creates a webhook handler.

API

TypeScript
async function createWebhookHandler({fileName}: {fileName: string}): WebhookHandler

Arguments

An object containing:

fileName : string

The name of your webhook file WITHOUT the .webhook.ts (or .webhook.js) suffix.

Returns

A WebhookHandler object containing:

id : string

The unique identifier for the webhook handler.

You may need this for calls to updateWebhookHandler() or deleteWebhookHandler().

url : string

The URL to trigger the webhook handler.

fileName: string

The name of the webhook file that will be invoked when the webhook is triggered.

createdBy: { type: "user", id: string }

An object containing the user id that created this connection.