Skip to content
Get started

Update a webhook

client.webhooks.update(stringid, WebhookUpdateParams { enabled, event_types, signing_key, 2 more } body, RequestOptionsoptions?): WebhookUpdateResponse { id, created_at, enabled, 6 more }
PATCH/v1/webhooks/{id}

Updates specific fields of a webhook endpoint

ParametersExpand Collapse
id: string
formatuuid
body: WebhookUpdateParams { enabled, event_types, signing_key, 2 more }
enabled?: boolean

Enable or disable the webhook

event_types?: Array<"feedback_record.created" | "feedback_record.updated" | "feedback_record.deleted" | 3 more>

New list of event types (use empty array to clear). Each value must be one of WebhookEventType.

Accepts one of the following:
"feedback_record.created"
"feedback_record.updated"
"feedback_record.deleted"
"webhook.created"
"webhook.updated"
"webhook.deleted"
signing_key?: string

New signing key. NULL bytes not allowed.

minLength1
maxLength255
tenant_id?: string | null

Omit or send null to leave unchanged. Send empty string to clear (store as null).

maxLength255
url?: string

New webhook URL. Must be an HTTP or HTTPS URL. NULL bytes not allowed.

minLength1
maxLength2048
formaturi
ReturnsExpand Collapse
WebhookUpdateResponse { id, created_at, enabled, 6 more }

Webhook data for GET and LIST responses; signing_key is omitted for security

id: string

Webhook ID (UUID)

formatuuid
created_at: string

When the webhook was created

formatdate-time
enabled: boolean

Whether the webhook is active

updated_at: string

When the webhook was last updated

formatdate-time
url: string

URL that receives webhook POSTs

disabled_at?: string | null

Read-only. When the webhook was disabled. Omitted when null.

formatdate-time
disabled_reason?: string | null

Read-only. Set by the system when the webhook was disabled. Omitted when null.

event_types?: Array<"feedback_record.created" | "feedback_record.updated" | "feedback_record.deleted" | 3 more>

Event types this webhook subscribes to (empty = all)

Accepts one of the following:
"feedback_record.created"
"feedback_record.updated"
"feedback_record.deleted"
"webhook.created"
"webhook.updated"
"webhook.deleted"
tenant_id?: string

Tenant/organization identifier

Update a webhook

import FormbricksHub from '@formbricks/hub';

const client = new FormbricksHub({
  apiKey: process.env['HUB_API_KEY'], // This is the default and can be omitted
});

const webhook = await client.webhooks.update('018e1234-5678-9abc-def0-123456789abc');

console.log(webhook.id);
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "created_at": "2019-12-27T18:11:19.117Z",
  "enabled": true,
  "updated_at": "2019-12-27T18:11:19.117Z",
  "url": "url",
  "disabled_at": "2019-12-27T18:11:19.117Z",
  "disabled_reason": "disabled_reason",
  "event_types": [
    "feedback_record.created"
  ],
  "tenant_id": "tenant_id"
}
Returns Examples
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "created_at": "2019-12-27T18:11:19.117Z",
  "enabled": true,
  "updated_at": "2019-12-27T18:11:19.117Z",
  "url": "url",
  "disabled_at": "2019-12-27T18:11:19.117Z",
  "disabled_reason": "disabled_reason",
  "event_types": [
    "feedback_record.created"
  ],
  "tenant_id": "tenant_id"
}