Schema to create a webhook endpoint.
import { WebhookEndpointCreate } from "@polar-sh/sdk/models/components/webhookendpointcreate.js";
let value: WebhookEndpointCreate = {
url: "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0",
format: "slack",
events: [
"subscription.past_due",
],
organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
};| Field | Type | Required | Description | Example |
|---|---|---|---|---|
url |
string | ✔️ | The URL where the webhook events will be sent. | https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0 |
name |
string | ➖ | An optional name for the webhook endpoint to help organize and identify it. | |
format |
components.WebhookFormat | ✔️ | N/A | |
events |
components.WebhookEventType[] | ✔️ | The events that will trigger the webhook. | |
organizationId |
string | ➖ | The organization ID associated with the webhook endpoint. Required unless you use an organization token. | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 |