Guide

Vercel webhooks: receive deployment events and verify x-vercel-signature

Vercel webhooks notify a URL when a deployment is created, succeeds, fails or is promoted, and when projects or domains change. They are useful for chat notifications, post-deploy checks and letting an AI agent react to a failed build. Here is how to create one, verify its signature and test it.

All docs

Get a public URL for Vercel webhooks#

Vercel can't deliver to localhost. An OtterKit webhook endpoint gives you a public HTTPS URL that answers Vercel around the clock and keeps every request, so nothing is lost while your laptop is closed or your handler is half written:

Terminal
npx otterkit login
npx otterkit webhook --daemon --subdomain vercel-dev
#   https://vercel-dev.otterkit.app

The name is reserved to your account, so the URL stays the same every time you start it. An endpoint costs $0.01 per hour while it is live and never more than $3 in any 30 days, and new accounts get 10 free credits. To look at a payload before you sign up, the try page gives you a live URL in the browser with no account.

Register the URL in Vercel#

  1. In the Vercel dashboard, open your team's Settings, then Webhooks. Account-level webhooks need a paid plan.
  2. Choose the events, such as deployment.created, deployment.succeeded and deployment.error, and limit it to certain projects if you like.
  3. Paste the endpoint URL and create the webhook. Vercel shows the secret once: copy it then.

Use https://vercel-dev.otterkit.app as the URL. Add a path if your handler expects one, such as https://vercel-dev.otterkit.app/webhooks/vercel: the endpoint accepts any path and records it.

Verify x-vercel-signature#

Vercel sends x-vercel-signature: the hex HMAC-SHA1 of the raw body, keyed with the webhook's secret. Compute it over the raw bytes and compare in constant time.

The body has a type naming the event, an id you can use to drop duplicates, and a payload with the deployment, project and team.

There is no Vercel preset. Open the endpoint in the console and use the generic HMAC mode: header x-vercel-signature, SHA-1, hex, no prefix, with the webhook's secret.

Send a test event#

Push a commit to a project the webhook covers, or redeploy an existing deployment from the dashboard. A deployment.created event arrives as the build starts.

Then watch it land, or wait for it in a script:

Terminal
# Follow requests as they arrive, with headers and bodies
npx otterkit inspect vercel-dev --follow

# Or block until the next POST, then print it as JSON
npx otterkit await vercel-dev --method POST --count 1 --timeout 120s --json

Replay Vercel events into your local handler#

Once an event is captured you can send it to your handler as often as you like, with the original headers and body, without asking Vercel to fire it again:

Terminal
# Send the latest captured event to a server on port 3000
npx otterkit replay vercel-dev --target 127.0.0.1:3000

# Or a specific one (1 is the oldest, -1 the latest)
npx otterkit replay vercel-dev --index 3 --target 127.0.0.1:3000

Replays cost nothing and are added to the capture log with your handler's response next to them. If you would rather have events delivered live while you work, expose the handler with a tunnel instead and register the tunnel URL.

Retries, timeouts and duplicates#

  • Vercel expects a 2xx quickly and retries failed deliveries for a while with growing gaps. Acknowledge first and do the work afterwards.
  • Integrations get webhooks too, signed with the integration's client secret instead of a per-webhook secret.

To see how your code copes when a delivery fails, the HTTP status codes guide has URLs that return any status on demand.

Questions about Vercel webhooks#

Is x-vercel-signature SHA-1 or SHA-256?#

SHA-1, hex-encoded, over the raw request body.

Is this the same as a Vercel deploy hook?#

No. A deploy hook is a URL you call to start a deployment. A webhook is Vercel calling your URL when something happens.

Can an AI agent wait for a deployment to finish?#

Yes. Point the webhook at an endpoint and have the agent block until a deployment.succeeded or deployment.error event arrives.

Other providers#