Delete Webhooks

Delete Webhooks

To remove a webhook from a file or folder, you will need to use the remove webhook endpoint with the ID of the webhook. This value can be obtained using the list all webhooks endpoint.

curl -i -X DELETE "" \
     -H "Authorization: Bearer <ACCESS_TOKEN>"
await client.WebhooksManager.DeleteWebhookAsync("11111");
print('The webhook was successfully deleted!')
	.then(() => {
		// deletion succeeded — no value returned
client.webhooks.delete(webhookId: "22222") { result: Result<Void, BoxSDKError>} in
    guard case .success = result else {
        print("Error deleting webhook")

    print("Webhook successfully deleted")

Additional reasons for deletion

Using this endpoint is not the only way a webhook can be deleted.

The following reasons can cause webhooks to be deleted.

  1. Deleting a Box application automatically deletes all webhooks associated with the application.
  2. Deleting all active Access Tokens associated with a webhook will automatically delete the webhook. This includes Developer Tokens and password
  3. If the last successful delivery was 30 days ago and the period between the last successful delivery date and the last trigger date was more than 14 days, the webhook will be automatically deleted.

In all of these cases Box would send a webhook payload with the WEBHOOK.DELETED event name to the notification URL. The body of the payload will include the following additional information.

"additional_info": {
  "reason": "auto_cleanup"