delete_webhook
Permanently delete a webhook subscription to stop event notifications for a topic. Use when retiring an integration or switching topics.
Instructions
Permanently unsubscribe from an event topic by deleting the webhook subscription. Stops all future deliveries to that endpoint for that topic — irreversible (you'd have to re-create with create_webhook). Use when retiring an integration or switching topics. Returns the deleted GID, or a no-op message if nothing matched.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Webhook subscription GID to delete. |
Implementation Reference
- src/shopify/client.ts:65-74 (helper)The throwIfUserErrors helper function used in the delete_webhook handler to check and throw if any user errors are returned from the Shopify API.
export function throwIfUserErrors( errors: ShopifyUserError[] | undefined, operation: string, ): void { if (!errors || errors.length === 0) return; const messages = errors .map((e) => (e.field ? `${e.field.join(".")}: ${e.message}` : e.message)) .join("; "); throw new Error(`Shopify ${operation} userErrors: ${messages}`); }