Trouble testing webhooks in preview deployment

I have the default vercel deployment protection enabled for my preview deployments, but I’d love to open up access to my webhooks so that I can test critical workflows before pushing to prod. E.g. I have a staging version of my Neon database and I want to test user creation/deletion/etc, which rely on webhooks coming in from Clerk.

Right now the protection blocks my webhooks and I don’t see a way to allow them through. Is there any way to whitelist certain api paths? I know I can diable protection entirely but I’d rather just whitelist specific paths.

Current: Webhooks are protected by vercel deployment protection, so all automated webhooks (e.g. those coming in from Clerk) are blocked (they return a big HTML page).

Expected: Provide a workaround so that I can allow specific API paths without protection)

Hi, @eraoul! Welcome to the Vercel Community :wave:

For your use case, you can use Deployment Protection Exceptions to allow specific API paths without disabling protection entirely. This feature allows you to specify preview domains that should be exempt from deployment protection.

To implement this:

  1. Add your webhook endpoint as a Deployment Protection Exception. For example: api-webhooks.your-preview-domain.vercel.app
  2. This specific domain will become publicly accessible, bypassing the project’s deployment protection settings.

Note that Deployment Protection Exceptions are available on Enterprise plans or with the Advanced Deployment Protection add-on for Pro plans.

For more details and implementation steps, refer to the Deployment Protection Exceptions documentation.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.