Delete Webhooks

Delete Webhooks

You can delete a webhook using the Developer Console or API.

Developer Console

To delete a webhook follow the steps below.

  1. Navigate to the Webhooks tab in the Developer Console.
  2. Select the webhook you want to delete by clicking on its ID.
  3. Click the Delete button.
  4. Confirm the action by clicking Delete under the warning message.

API

To remove a webhook from a file or folder, you need to use the remove webhook endpoint with the ID of the webhook. You can get this value using the list all webhooks endpoint.

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")
}
TypeScript (Beta)
await client.webhooks.deleteWebhookById(webhook.id);
Python (Beta)
client.webhooks.delete_webhook_by_id(webhook_id=webhook.id)

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 it.
  2. Deleting all active Access Tokens associated with a webhook automatically deletes the webhook. This includes Developer Tokens and password.
  3. A webhook is automatically deleted if the last successful delivery was 30 days ago and the period between the last successful delivery and the last trigger date is more than 14 days.

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

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