Skip to main content
PATCH
/
webhooks
/
{id}
JavaScript
import Whop from '@whop/sdk';

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

const webhook = await client.webhooks.update('hook_xxxxxxxxxxxxx');

console.log(webhook.id);
{
  "id": "hook_xxxxxxxxxxxxx",
  "url": "https://example.com/path",
  "enabled": true,
  "events": [
    "invoice.created"
  ],
  "api_version": "v1",
  "created_at": "2023-12-01T05:00:00.401Z",
  "child_resource_events": true,
  "testable_events": [
    "invoice.created"
  ],
  "resource_id": "<string>"
}

Authorizations

Authorization
string
header
required

The app API key from an app from the /dashboard/developer page

Path Parameters

id
string
required

The ID of the Webhook to update

Example:

"hook_xxxxxxxxxxxxx"

Body

application/json

Parameters for UpdateWebhook

api_version
enum<string> | null

The API version for this webhook

Available options:
v1,
v2,
v5
child_resource_events
boolean | null

Whether or not to send events for child resources.

enabled
boolean | null

Whether or not the webhook is enabled.

events
enum<string>[] | null

The events to send the webhook for.

The different event types available

Available options:
invoice.created,
invoice.paid,
invoice.past_due,
invoice.voided,
membership.activated,
membership.deactivated,
entry.created,
entry.approved,
entry.denied,
entry.deleted,
setup_intent.requires_action,
setup_intent.succeeded,
setup_intent.canceled,
withdrawal.created,
withdrawal.updated,
course_lesson_interaction.completed,
payout_method.created,
verification.succeeded,
payment.created,
payment.succeeded,
payment.failed,
payment.pending,
dispute.created,
dispute.updated,
refund.created,
refund.updated,
membership.cancel_at_period_end_changed
url
string | null

The URL to send the webhook to.

Example:

"https://example.com/path"

Response

A successful response

A webhook object, which can be configured to be sent updates about a company

id
string
required

The ID of the webhook

Example:

"hook_xxxxxxxxxxxxx"

url
string
required

The URL the webhook events will be sent to

Example:

"https://example.com/path"

enabled
boolean
required

Whether or not this webhook is turned on or not

events
enum<string>[]
required

The number of events this webhooks is configured to receive

The different event types available

Available options:
invoice.created,
invoice.paid,
invoice.past_due,
invoice.voided,
membership.activated,
membership.deactivated,
entry.created,
entry.approved,
entry.denied,
entry.deleted,
setup_intent.requires_action,
setup_intent.succeeded,
setup_intent.canceled,
withdrawal.created,
withdrawal.updated,
course_lesson_interaction.completed,
payout_method.created,
verification.succeeded,
payment.created,
payment.succeeded,
payment.failed,
payment.pending,
dispute.created,
dispute.updated,
refund.created,
refund.updated,
membership.cancel_at_period_end_changed
api_version
enum<string>
required

The API version for this webhook

Available options:
v1,
v2,
v5
created_at
string<date-time>
required

The timestamp of when the webhook was created

Example:

"2023-12-01T05:00:00.401Z"

child_resource_events
boolean
required

Whether or not to send events for child resources. For example, if the webhook is created for a Company, enabling this will only send events from the Company's sub-merchants (child companies).

testable_events
enum<string>[]
required

The list of events that can be tested with this webhook

The different event types available

Available options:
invoice.created,
invoice.paid,
invoice.past_due,
invoice.voided,
membership.activated,
membership.deactivated,
entry.created,
entry.approved,
entry.denied,
entry.deleted,
setup_intent.requires_action,
setup_intent.succeeded,
setup_intent.canceled,
withdrawal.created,
withdrawal.updated,
course_lesson_interaction.completed,
payout_method.created,
verification.succeeded,
payment.created,
payment.succeeded,
payment.failed,
payment.pending,
dispute.created,
dispute.updated,
refund.created,
refund.updated,
membership.cancel_at_period_end_changed
resource_id
string
required

The resource ID