PgBeam Docs
Webhooks

createWebhookEndpoint

Create a webhook endpoint

Creates a webhook endpoint that receives project event deliveries.

Usage

const result = await api.webhooks.createWebhookEndpoint({
  pathParams: { project_id: "prj_xxx" },
  body: {
    url: "https://example.com/hooks/pgbeam",
  },
});

Parameters

ParameterTypeRequiredDescription
pathParams.project_idstringYesUnique project identifier (prefixed, e.g. prj_xxx).
body.urlstringYesHTTPS endpoint that receives event deliveries.
body.secretstringNoShared secret used to sign delivery payloads. Write-only.
body.format"json" | "splunk_hec" | "datadog" | "elastic"NoPayload format for delivered events.
body.event_typesstring[]NoEvent types to deliver. Empty means all events.
body.enabledbooleanNoWhether deliveries are active for this endpoint.
body.descriptionstringNoHuman-readable label for the endpoint.

Response

Promise<WebhookEndpoint> — webhook endpoint created.

Example

import { PgBeamClient } from "pgbeam";

const client = new PgBeamClient({
  token: "pbk_...",
  baseUrl: "https://api.pgbeam.com",
});

const result = await client.api.webhooks.createWebhookEndpoint({
  pathParams: { project_id: "prj_xxx" },
  body: {
    url: "https://example.com/hooks/pgbeam",
  },
});

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Operation not allowed by current plan limits.
404Resource not found.
429Rate limited. Try again later.

On this page