Delete Webhook

Delete Webhook

To remove a webhook from a file or folder in Box you will need to provide our API with the ID of the webhook to remove.

cURL
curl -i -X DELETE "https://api.box.com/2.0/webhooks/3321123" \
     -H "Authorization: Bearer <ACCESS_TOKEN>"
.NET
await client.WebhooksManager.DeleteWebhookAsync("11111");
Python
client.webhook(webhook_id='12345').delete()
print('The webhook was successfully deleted!')
Node
client.webhooks.delete('1234')
	.then(() => {
		// deletion succeeded — no value returned
	});
iOS
client.webhooks.delete(webhookId: "22222") { result: Result<Void, BoxSDKError>} in
    guard case .success = result else {
        print("Error deleting webhook")
        return
    }

    print("Webhook successfully deleted")
}

Webhook ID

To find the ID of the webhook, use the List all webhooks endpoint.

Additional reasons for deletion

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

The following reasons can cause webhooks to be deleted.

  1. Deleting a Box application deletes all webhooks associated with the application.
  2. Deleting all access tokens associated with a webhook.
  3. If webhooks could not be delivered for a system-determined amount of time then Box automatically removes the webhook.

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

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