Skip to main content

Delete Webhook Subscription

Deletes an existing webhook subscription from Calendly, stopping all event notifications to the associated webhook URL.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Client Id - (Optional) The unique client identifier returned by the Connect node. If not provided, you must supply Credentials directly.

  • Webhook Id - (Required) The unique identifier of the webhook subscription to delete. This is the ID portion extracted from the webhook subscription URI (e.g., if URI is https://api.calendly.com/webhook_subscriptions/XXXXXXXXXX, the ID is XXXXXXXXXX).

Options

  • Credentials - (Optional) Calendly API Token credential for direct authentication. Use this if you're not using the Connect/Disconnect pattern.

How It Works

The Delete Webhook Subscription node permanently removes a webhook subscription from your Calendly account. After deletion, Calendly will no longer send event notifications to the associated webhook URL.

When executed, the node:

  1. Uses either the Client ID from Connect or direct credentials
  2. Validates that a Webhook ID is provided
  3. Makes a DELETE request to /webhook_subscriptions/{webhook_id}
  4. Removes the subscription from Calendly
  5. Returns successfully if deletion completes (HTTP 200-299)

Requirements

  • A valid webhook subscription ID from a previously created webhook
  • The webhook must belong to your organization
  • Appropriate permissions to delete webhook subscriptions

Extracting Webhook ID

The Webhook ID can be obtained from:

From Add Webhook Subscription Result:

Full URI: {{result.resource.uri}}
Example: https://api.calendly.com/webhook_subscriptions/ABCD1234EFGH5678

Extract ID: ABCD1234EFGH5678

You can extract the ID using string manipulation:

// In a JavaScript node
const webhookUri = context.message.result.resource.uri;
const webhookId = webhookUri.split('/').pop();
context.message.webhook_id = webhookId;

From List Webhook Subscriptions:

Parse the list of subscriptions and extract the URI, then get the ID portion.

Error Handling

The node will return specific errors in the following cases:

ErrInvalidArg

  • Webhook ID is empty or missing
  • Solution: Ensure you're providing a valid webhook subscription ID

ErrInternal

  • Network error connecting to Calendly API
  • Webhook subscription not found (404)
  • Webhook belongs to different organization (403 Forbidden)
  • API authentication failed (401 Unauthorized)
  • Solution: Verify the webhook ID is correct and accessible

Usage Examples

Example 1: Create and Delete Webhook

[Start]
-> [Calendly Connect] (outputs: client_id)
-> [Get Me] (outputs: result)

-> [Add Webhook Subscription]
- Webhook Url: "https://myapp.com/webhooks/calendly"
- Organization Url: {{result.resource.current_organization}}
- Events: "All"
(outputs: subscription_result)

-> [Extract Webhook ID]
- JavaScript: webhook_id = subscription_result.resource.uri.split('/').pop()

-> [Delete Webhook Subscription]
- Webhook Id: {{webhook_id}}

-> [Disconnect]
-> [End]

Example 2: Clean Up All Webhooks

[Start]
-> [Calendly Connect]
-> [Get Me] (outputs: result)

-> [List Webhook Subscriptions]
- Organization Url: {{result.resource.current_organization}}
(outputs: subscriptions)

-> [For Each] (iterate over: {{subscriptions.collection}})
-> [Extract ID]
- webhook_id = item.uri.split('/').pop()
-> [Delete Webhook Subscription]
- Webhook Id: {{webhook_id}}
-> [Log] (message: "Deleted webhook: {{webhook_id}}")

-> [Disconnect]
-> [End]

Example 3: Delete Specific Webhook by URL

[Start]
-> [Calendly Connect]
-> [Get Me] (outputs: result)

-> [List Webhook Subscriptions]
- Organization Url: {{result.resource.current_organization}}
(outputs: subscriptions)

-> [For Each] (iterate over: {{subscriptions.collection}})
-> [If] (condition: {{item.callback_url}} == "https://old-app.com/webhook")
-> [Extract ID]
- webhook_id = item.uri.split('/').pop()
-> [Delete Webhook Subscription]
- Webhook Id: {{webhook_id}}
-> [Log] (message: "Deleted old webhook")

-> [Disconnect]
-> [End]

Example 4: Conditional Deletion with Error Handling

[Start]
-> [Try]
-> [Calendly Connect]
-> [Delete Webhook Subscription]
- Webhook Id: "ABCD1234EFGH5678"
-> [Log] (message: "Webhook deleted successfully")
-> [Disconnect]

-> [Catch]
-> [If] (error contains "404")
-> [Log] (message: "Webhook already deleted or doesn't exist")
-> [Else]
-> [Log Error] (error: {{error}})
-> [Send Alert] (message: "Failed to delete webhook")

-> [End]

Example 5: Cleanup on Flow Error

[Start]
-> [Calendly Connect]
-> [Get Me] (outputs: result)

-> [Add Webhook Subscription] (outputs: subscription)
-> [Extract ID] (webhook_id = subscription.resource.uri.split('/').pop())

-> [Try]
-> [Process Events] (long-running operations)

-> [Finally] (cleanup, runs even on error)
-> [Delete Webhook Subscription]
- Webhook Id: {{webhook_id}}
-> [Disconnect]

-> [End]

Usage Notes

  • Deletion is permanent and cannot be undone
  • Once deleted, Calendly immediately stops sending events to the webhook URL
  • Deleting a non-existent webhook returns a 404 error
  • You cannot delete webhooks from other organizations
  • The node doesn't return any output on success (just completes)
  • No events are sent to the webhook about its own deletion

Best Practices

  • ID Management

    • Store webhook IDs when creating subscriptions
    • Use persistent storage (database/data table) for production webhooks
    • Document which webhooks are active and their purposes
  • Cleanup

    • Delete webhooks when no longer needed to avoid hitting subscription limits
    • Clean up test webhooks after development
    • Periodically audit and remove unused subscriptions
  • Error Handling

    • Handle 404 errors gracefully (webhook might already be deleted)
    • Log deletion events for audit trails
    • Verify webhook exists before attempting deletion
  • Automation

    • Automate webhook lifecycle management
    • Delete temporary webhooks after one-time operations
    • Create cleanup flows that run periodically
  • Testing

    • Test deletion in development before production
    • Verify webhook stops receiving events after deletion
    • Use List Webhook Subscriptions to confirm deletion

Common Use Cases

  1. Webhook Rotation

    • Delete old webhooks when rotating endpoints
    • Update webhook URLs by deleting and recreating
  2. Environment Management

    • Clean up development/staging webhooks
    • Remove test subscriptions after QA
  3. Security

    • Delete compromised webhook endpoints
    • Rotate webhooks as security measure
  4. Resource Management

    • Stay under the 100 webhook limit per organization
    • Remove duplicate or redundant subscriptions
  5. Temporary Monitoring

    • Delete webhooks after specific campaigns
    • Clean up event-driven automations after completion
  6. Error Recovery

    • Delete malfunctioning webhooks
    • Remove webhooks pointing to inactive endpoints

Verification

To verify deletion was successful:

[Delete Webhook Subscription]
-> [List Webhook Subscriptions]
-> [For Each] (check if deleted ID exists)
-> [If] (webhook_id found)
-> [Error] "Deletion failed"
-> [Else]
-> [Log] "Deletion confirmed"

Webhook Lifecycle Management

Complete Lifecycle Pattern:

1. CREATE: Add Webhook Subscription
-> Store webhook_id in database

2. MONITOR: List Webhook Subscriptions
-> Verify webhook is active

3. UPDATE: Delete old + Create new
-> Atomic replacement pattern

4. DELETE: Delete Webhook Subscription
-> Remove from database
-> Verify with List operation

Rate Limits

Deleting webhook subscriptions counts toward API rate limits:

  • Each deletion = 1 API request
  • Standard accounts: 100 requests/minute
  • No limit on number of deletions, only rate of requests

Troubleshooting

Webhook ID Not Found (404)

  • The webhook was already deleted
  • The ID is incorrect or malformed
  • The webhook belongs to a different organization

Forbidden (403)

  • You don't have permission to delete this webhook
  • The webhook belongs to another organization
  • API token doesn't have sufficient scope

Internal Server Error (500)

  • Temporary Calendly API issue
  • Retry the request after a delay

Invalid Webhook ID Format

  • Ensure you're extracting just the ID portion, not the full URI
  • ID should be alphanumeric without slashes or protocol