Source: https://solidhooks.com/guides/vercel-deployment-webhooks

# Vercel deployment webhooks: verify deployment.error and hand failed deploys to an AI agent

You can hear about a failed Vercel deploy in two ways. An account webhook for Deployment Error is signed with `x-vercel-signature`. An agent can also subscribe to `deployment.error` through Vercel MCP events, which arrive as signed Standard Webhooks. Either way, verify the request, queue a small job, and let the agent do its work outside the webhook request.

Checked 16 Nov 2026.

## Two routes

|                  | Account webhook                             | Vercel MCP events            |
| ---------------- | ------------------------------------------- | ---------------------------- |
| Who sets it up   | You, in team settings                       | An agent, through Vercel MCP |
| Signature        | `x-vercel-signature`, HMAC-SHA1 of the body | Standard Webhooks            |
| Timestamp signed | No                                          | Yes                          |
| Experimental     | No                                          | Yes                          |

Account webhooks need a Pro or Enterprise plan ([Vercel docs](https://vercel.com/docs/webhooks)). Vercel announced MCP events in its [changelog on 30 Oct 2026](https://vercel.com/changelog/vercel-mcp-now-supports-mcp-events).

## What deployment.error gives you

Every event has an `id`, a `type`, a `createdAt` in milliseconds and a `payload`. For an agent, the useful fields are `payload.deployment.id`, `payload.project.id`, `payload.target` (production, staging or null), `payload.deployment.url` and `payload.links.deployment`, which opens the deployment in the dashboard ([Vercel's webhook reference](https://vercel.com/docs/webhooks/webhooks-api)).

## Verify the account webhook

Vercel sets `x-vercel-signature` to the hex HMAC-SHA1 of the raw body, keyed with the secret it shows once when you create the webhook. Vercel's own sample compares with `!==`, then recommends a constant-time compare. Use the constant-time one.

javascript

```
import { createHmac, timingSafeEqual } from 'node:crypto';
 
const secret = process.env.VERCEL_WEBHOOK_SECRET;
if (!secret) throw new Error('VERCEL_WEBHOOK_SECRET is not set');
 
// rawBody is the request body as a Buffer, before any JSON parsing.
export function toAgentJob(rawBody, signatureHex) {
  const expected = createHmac('sha1', secret).update(rawBody).digest();
  const given = Buffer.from(String(signatureHex ?? ''), 'hex');
  if (given.length !== expected.length || !timingSafeEqual(given, expected)) {
    return { status: 401 };
  }
  const event = JSON.parse(rawBody.toString('utf8'));
  if (event.type !== 'deployment.error') return { status: 204 };
  const { deployment, project, links, target } = event.payload;
  return {
    status: 202,
    job: { deploymentId: deployment.id, projectId: project.id, target, inspectUrl: links.deployment },
  };
}
```

There's no timestamp in the signature, so a captured request stays valid. Deduplicate on `payload.deployment.id` plus `type`. Reply within 30 seconds. Vercel retries a non-2xx for up to 24 hours, then discards the event.

## Verify MCP events

Vercel says these deliveries are signed Standard Webhooks with its usual payload inside `data`. The [AI SDK's helper](https://ai-sdk.dev/cookbook/node/mcp-events) answers the subscription's verification challenge and checks signatures before your handler runs. It returns 204 on success and 503 when your callback or storage fails, so Vercel can retry.

The feature is experimental, so pin your versions. If Vercel Connect manages your subscriptions, it supports production and stable custom environments, not development or preview.

## Hand the failure to an agent

Don't run the agent inside the webhook request. The AI SDK docs say to enqueue the event, wait for the enqueue to finish, then return, and do the model work in a worker.

Give the agent a small job: deployment id, project id, target and inspect link. Let it fetch build logs with its own authorised tools. Treat any text from the payload, such as deployment metadata, as data to read, never as instructions ([why signed payloads aren't safe agent input](https://solidhooks.com/guides/webhook-payload-untrusted-ai-agents)). Have a person approve any rollback or redeploy.

## Where SolidHooks fits

SolidHooks has no Vercel preset. It also can't be the callback for Vercel MCP events, because it doesn't answer the verification challenge. Your own app has to receive those.

For account webhooks, a generic HMAC source can match Vercel's scheme. Use `provider: "generic"` and `verifierType: "hmac"`, with `hash: "sha1"`, `encoding: "hex"`, `header: "x-vercel-signature"` and your secret in `verifierConfig`. Leave out `timestampHeader` and `toleranceSeconds`, because Vercel signs no timestamp. Set `eventTypeField: "body.type"` and filter a connection to `deployment.error`.

SolidHooks then delivers each failed deploy to your agent worker, signed with Standard Webhooks headers and retried on failure, and keeps the history so you can [replay](https://solidhooks.com/docs/replay) it. Before you rely on it, run `POST /v1/sources/{id}/test-signature` with a real Vercel delivery.

## FAQ

### How do I get notified when a Vercel deployment fails?

On Pro or Enterprise, create an account webhook in team settings and select Deployment Error. Vercel then POSTs an event with `type` set to `deployment.error`. An agent using Vercel MCP can subscribe to the same event instead.

### How do I verify x-vercel-signature?

Compute the HMAC-SHA1 of the raw body with your webhook secret, hex-encode it, and compare it to the header in constant time. There's no timestamp, so deduplicate events too.

### Does SolidHooks have a Vercel integration?

Not a preset. A generic HMAC source set to SHA-1, hex and `x-vercel-signature` can verify account webhooks. SolidHooks can't receive Vercel MCP events subscriptions.

## Get started

The Hobby plan is free for 10,000 deliveries a month. This setup uses a generic HMAC source, not a Vercel preset. See [verification](https://solidhooks.com/docs/verification).
