Skip to main content
This function and all other functions in this graphql sdk are deprecated. Please migrate to the new rest api.
This operation is only available on the server.

Required Permissions

  • developer:manage_webhook

Usage

import { whopSdk } from "@/lib/whop-sdk";

const result = await whopSdk.webhooks.getWebhook({
	webhookId: "xxxxxxxxxxx" /* Required! */,

	// ID of the company, either the tag (biz_xxx) or the page route (whop-dev)
	companyId: "biz_XXXXXXXX" /* Required! */,
});

Example output

const result = {
	// The webhook that has been set by a company
	webhook: {
		// The ID of the webhook
		id: "xxxxxxxxxxx",

		// The URL the webhook events will be sent to
		url: "some string",

		// The API version for this webhook
		apiVersion: "v1" /* Valid values: v1 | v2 | v5 */,

		// The timestamp of when the webhook was created
		createdAt: 1716931200,

		// Whether or not this webhook is turned on or not
		enabled: true,

		// The number of events this webhooks is configured to receive
		events: [
			"app_membership_cancel_at_period_end_changed" /* Valid values: app_membership_cancel_at_period_end_changed | app_membership_went_invalid | app_membership_went_valid | app_payment_failed | app_payment_pending | app_payment_succeeded | course_lesson_interaction_completed | dispute_alert_created | dispute_created | dispute_updated | entry_approved | entry_created | entry_deleted | entry_denied | invoice_created | invoice_paid | invoice_past_due | invoice_voided | membership_activated | membership_cancel_at_period_end_changed | membership_deactivated | membership_experience_claimed | membership_metadata_updated | membership_went_invalid | membership_went_valid | payment_affiliate_reward_created | payment_failed | payment_pending | payment_succeeded | refund_created | refund_updated | resolution_created | resolution_decided | resolution_updated | setup_intent_canceled | setup_intent_requires_action | setup_intent_succeeded | withdrawal_created | withdrawal_updated */,
		],

		// The resource ID
		resourceId: "xxxxxxxxxxx",

		// A unique secret key that will be sent with each webhook event
		webhookSecret: "some string",
	},
};