Reference

Webhooks API Reference

Vercel Integrations allow you to subscribe to certain trigger-based events through webhooks. Learn about the supported webhook events and how to use them.
Table of Contents

Vercel Integrations allow you to subscribe to certain trigger-based events through webhooks. An example use-cases for webhooks might be cleaning up resources after someone removes your Integration.

The webhook payload is a JSON object with the following keys.

KeyTypeDescription
typeStringThe event type.
idIDThe ID of the webhook delivery.
createdAtDateThe webhook delivery timestamp.
regionStringThe region the event occurred in (possibly null).
payloadObjectThe payload of the webhook. See Supported Event Types for more information.

Occurs whenever a deployment is canceled.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
payload.deployment.idIDThe ID of the deployment.
payload.deployment.metaMapA Map of deployment metadata.
payload.deployment.urlStringThe URL of the deployment.
payload.deployment.nameStringThe project name used in the deployment URL.
payload.links.deploymentStringThe URL on the Vercel Dashboard to inspect the deployment.
payload.links.projectStringThe URL on the Vercel Dashboard to the project.
payload.targetStringA String that indicates the target. Possible values are production, staging or null.
payload.project.idIDThe ID of the project.
payload.planStringThe plan type of the deployment.
payload.regionsListAn array of the supported regions for the deployment.

Occurs when a user has requested for a check to be rerun after it failed.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
payload.deployment.idIDThe ID of the deployment.
payload.check.idIDThe ID of the check.

Occurs whenever a deployment is created.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
payload.aliasListAn array of aliases that will get assigned when the deployment is ready.
payload.deployment.idIDThe ID of the deployment.
payload.deployment.metaMapA Map of deployment metadata.
payload.deployment.urlStringThe URL of the deployment.
payload.deployment.nameStringThe project name used in the deployment URL.
payload.links.deploymentStringThe URL on the Vercel Dashboard to inspect the deployment.
payload.links.projectStringThe URL on the Vercel Dashboard to the project.
payload.targetStringA String that indicates the target. Possible values are production, staging or null.
payload.project.idIDThe ID of the project.
payload.planStringThe plan type of the deployment.
payload.regionsListAn array of the supported regions for the deployment.

Occurs whenever a deployment has failed.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
payload.deployment.idIDThe ID of the deployment.
payload.deployment.metaMapA Map of deployment metadata.
payload.deployment.urlStringThe URL of the deployment.
payload.deployment.nameStringThe project name used in the deployment URL.
payload.links.deploymentStringThe URL on the Vercel Dashboard to inspect the deployment.
payload.links.projectStringThe URL on the Vercel Dashboard to the project.
payload.targetStringA String that indicates the target. Possible values are production, staging or null.
payload.project.idIDThe ID of the project.
payload.planStringThe plan type of the deployment.
payload.regionsListAn array of the supported regions for the deployment.

Occurs whenever a deployment is promoted.

This event gets fired after a production deployment is promoted to start serving production traffic. This can happen automatically after a successful build, or after running the promote command.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
payload.deployment.idIDThe ID of the deployment.
payload.deployment.metaMapA Map of deployment metadata.
payload.deployment.urlStringThe URL of the deployment.
payload.deployment.nameStringThe project name used in the deployment URL.
payload.links.deploymentStringThe URL on the Vercel Dashboard to inspect the deployment.
payload.links.projectStringThe URL on the Vercel Dashboard to the project.
payload.project.idIDThe ID of the project.
payload.planStringThe plan type of the deployment.
payload.regionsListAn array of the supported regions for the deployment.

Occurs whenever a deployment is successfully built and your integration has registered at least one check.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
payload.deployment.idIDThe ID of the deployment.
payload.deployment.metaMapA Map of deployment metadata.
payload.deployment.urlStringThe URL of the deployment.
payload.deployment.nameStringThe project name used in the deployment URL.
payload.links.deploymentStringThe URL on the Vercel Dashboard to inspect the deployment.
payload.links.projectStringThe URL on the Vercel Dashboard to the project.
payload.targetStringA String that indicates the target. Possible values are production, staging or null.
payload.project.idIDThe ID of the project.
payload.planStringThe plan type of the deployment.
payload.regionsListAn array of the supported regions for the deployment.

Occurs whenever a deployment is ready.

This event gets fired after all blocking Checks have passed. See deployment-prepared if you registered Checks.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
payload.deployment.idIDThe ID of the deployment.
payload.deployment.metaMapA Map of deployment metadata.
payload.deployment.urlStringThe URL of the deployment.
payload.deployment.nameStringThe project name used in the deployment URL.
payload.links.deploymentStringThe URL on the Vercel Dashboard to inspect the deployment.
payload.links.projectStringThe URL on the Vercel Dashboard to the project.
payload.targetStringA String that indicates the target. Possible values are production, staging or null.
payload.project.idIDThe ID of the project.
payload.planStringThe plan type of the deployment.
payload.regionsListAn array of the supported regions for the deployment.

Occurs whenever a domain has been created.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
domain.nameStringThe Domain name created.
domain.delegatedStringWhether or not the domain was delegated/shared.

Occurs whenever the user changes the project permission for an integration.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
payload.configuration.idIDThe ID of the configuration.
payload.configuration.projectSelectionStringA String representing the permission for projects. Possible values are all or selected.
payload.configuration.projectsListAn array of project IDs.
payload.projects.addedListAn array of added project IDs.
payload.projects.removedListAn array of removed project IDs.

Occurs whenever an integration has been removed.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
payload.configuration.idIDThe ID of the configuration.
payload.configuration.projectSelectionStringA String representing the permission for projects. Possible values are all or selected.
payload.configuration.projectsListAn array of project IDs.

Occurs whenever the user confirms pending scope changes.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
payload.configuration.idIDThe ID of the configuration.
payload.configuration.scopesListList of all scopes (after confirmation).

Occurs when an invoice was created and sent to the customer.

KeyTypeDescription
payload.configuration.idIDThe ID of the integration installation.
payload.installationIdIDThe ID of the integration installation (same as configuration.id).
payload.invoiceIdIDThe ID of the Marketplace invoice.
payload.externalInvoiceIdIDThe ID of the Marketplace invoice, provided by integrator. Possibly null.
payload.period.startIsoDateThe invoice's period start date.
payload.period.endIsoDateThe invoice's period end date.
payload.invoiceDateIsoDateThe invoice's date.
payload.invoiceTotalStringThe invoice's total as a decimal number.

Occurs when an invoice was not paid after a grace period.

KeyTypeDescription
payload.configuration.idIDThe ID of the integration installation.
payload.installationIdIDThe ID of the integration installation (same as configuration.id).
payload.invoiceIdIDThe ID of the Marketplace invoice.
payload.externalInvoiceIdIDThe ID of the Marketplace invoice, provided by integrator. Possibly null.
payload.period.startIsoDateThe invoice's period start date.
payload.period.endIsoDateThe invoice's period end date.
payload.invoiceDateIsoDateThe invoice's date.
payload.invoiceTotalStringThe invoice's total as a decimal number.

Occurs when an invoice was paid.

KeyTypeDescription
payload.configuration.idIDThe ID of the integration installation.
payload.installationIdIDThe ID of the integration installation (same as configuration.id).
payload.invoiceIdIDThe ID of the Marketplace invoice.
payload.externalInvoiceIdIDThe ID of the Marketplace invoice, provided by integrator. Possibly null.
payload.period.startIsoDateThe invoice's period start date.
payload.period.endIsoDateThe invoice's period end date.
payload.invoiceDateIsoDateThe invoice's date.
payload.invoiceTotalStringThe invoice's total as a decimal number.

Occurs when an invoice is refunded.

KeyTypeDescription
payload.configuration.idIDThe ID of the integration installation.
payload.installationIdIDThe ID of the integration installation (same as configuration.id).
payload.invoiceIdIDThe ID of the Marketplace invoice.
payload.externalInvoiceIdIDThe ID of the Marketplace invoice, provided by integrator. Possibly null.
payload.period.startIsoDateThe invoice's period start date.
payload.period.endIsoDateThe invoice's period end date.
payload.amountStringThe amount being refunded as a decimal number.
payload.reasonStringThe reason for why the refund has been issued.

Occurs whenever a project has been created.

This event is sent only when the Integration has access to all projects in a Vercel scope.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
payload.project.idIDThe ID of the project.
payload.project.nameStringName of the project.

Occurs whenever a project has been removed.

This event is sent only when the integration has access to all projects in a Vercel scope.

KeyTypeDescription
payload.team.idIDThe ID of the event's team (possibly null).
payload.user.idIDThe ID of the event's user.
payload.project.idIDThe ID of the project.
payload.project.nameStringName of the project.

The legacy webhook payload is a JSON object with the following keys.

KeyTypeDescription
typeStringThe legacy event type.
idIDThe ID of the webhook delivery.
createdAtNumberThe webhook delivery timestamp.
regionStringThe region the event occurred in (possibly null).
clientIdIDThe ID of integration's client.
ownerIdIDThe ID of the event owner (user or team).
teamIdIDThe ID of the event's team (possibly null).
userIdIDThe ID of the event's users.
webhookIdIDThe ID of the webhook.
payloadObjectThe payload of the webhook. See Legacy Event Types for more information.

The following event types have been deprecated and webhooks that listen for them can no longer be created. Vercel will continue to deliver the deprecated events to existing webhooks.

This event is replaced by deployment.created .

Occurs whenever a deployment is created.

KeyTypeDescription
payload.aliasListAn array of aliases that will get assigned when the deployment is ready.
payload.deployment.idIDThe ID of the deployment.
payload.deployment.metaMapA Map of deployment metadata.
payload.deployment.urlStringThe URL of the deployment.
payload.deployment.nameStringThe project name used in the deployment URL.
payload.links.deploymentStringThe URL on the Vercel Dashboard to inspect the deployment.
payload.links.projectStringThe URL on the Vercel Dashboard to the project.
payload.targetStringA String that indicates the target. Possible values are production, staging or null.
payload.projectIdStringThe ID of the project.
payload.planStringThe plan type of the deployment.
payload.regionsListAn array of the supported regions for the deployment.

This event is replaced by deployment.succeeded .

Occurs whenever a deployment is ready.

This event gets fired after all blocking checks have passed. See deployment-prepared if you registered Checks.

KeyTypeDescription
payload.deployment.idIDThe ID of the deployment.
payload.deployment.metaMapA Map of deployment metadata.
payload.deployment.urlStringThe URL of the deployment.
payload.deployment.nameStringThe project name used in the deployment URL.
payload.links.deploymentStringThe URL on the Vercel Dashboard to inspect the deployment.
payload.links.projectStringThe URL on the Vercel Dashboard to the project.
payload.targetStringA String that indicates the target. Possible values are production, staging or null.
payload.projectIdStringThe ID of the project.
payload.planStringThe plan type of the deployment.
payload.regionsListAn array of the supported regions for the deployment.

This event is replaced by deployment.ready .

Occurs whenever a deployment is successfully built and your integration has registered at least one check.

KeyTypeDescription
payload.deployment.idIDThe ID of the deployment.
payload.deployment.metaMapA Map of deployment metadata.
payload.deployment.urlStringThe URL of the deployment.
payload.deployment.nameStringThe project name used in the deployment URL.
payload.links.deploymentStringThe URL on the Vercel Dashboard to inspect the deployment.
payload.links.projectStringThe URL on the Vercel Dashboard to the project.
payload.targetStringA String that indicates the target. Possible values are production, staging or null.
payload.projectIdStringThe ID of the project.
payload.planStringThe plan type of the deployment.
payload.regionsListAn array of the supported regions for the deployment.

This event is replaced by deployment.canceled .

Occurs whenever a deployment is canceled.

KeyTypeDescription
payload.deployment.idIDThe ID of the deployment.
payload.deployment.metaMapA Map of deployment metadata.
payload.deployment.urlStringThe URL of the deployment.
payload.deployment.nameStringThe project name used in the deployment URL.
payload.links.deploymentStringThe URL on the Vercel Dashboard to inspect the deployment.
payload.links.projectStringThe URL on the Vercel Dashboard to the project.
payload.targetStringA String that indicates the target. Possible values are production, staging or null.
payload.projectIdStringThe ID of the project.
payload.planStringThe plan type of the deployment.
payload.regionsListAn array of the supported regions for the deployment.

This event is replaced by deployment.error .

Occurs whenever a deployment has failed.

KeyTypeDescription
payload.deployment.idIDThe ID of the deployment.
payload.deployment.metaMapA Map of deployment metadata.
payload.deployment.urlStringThe URL of the deployment.
payload.deployment.nameStringThe project name used in the deployment URL.
payload.links.deploymentStringThe URL on the Vercel Dashboard to inspect the deployment.
payload.links.projectStringThe URL on the Vercel Dashboard to the project.
payload.targetStringA String that indicates the target. Possible values are production, staging or null.
payload.projectIdStringThe ID of the project.
payload.planStringThe plan type of the deployment.
payload.regionsListAn array of the supported regions for the deployment.

This event is replaced by deployment.check-rerequested .

Occurs when a user has requested for a check to be rerun after it failed.

KeyTypeDescription
payload.deployment.idIDThe ID of the deployment.
payload.check.idIDThe ID of the check.

This event has been removed. deployment.succeeded can be used for the same purpose.

Occurs when all checks for a deployment have completed. This does not indicate that they have all passed, only that they are no longer running. It is possible for webhook to occur multiple times for a single deployment if any checks are re-requested.

KeyTypeDescription
payload.deployment.idIDThe ID of the deployment.
payload.checksListInformation about the Checks.

Each item in checks has the following properties:

KeyTypeDescription
payload.idIDThe unique identifier of the check. Always prepended with check_.
payload.nameStringThe name of the check.
payload.statusStringThe status of the check. One of registered, running or completed
payload.conclusionStringThe conclusion of the check. One of cancelled, failed, neutral, succeeded or skipped.
payload.blockingBooleanWhether a deployment should be blocked or not.
payload.integrationIdStringThe unique identifier of the integration.

This event is replaced by project.created .

Occurs whenever a project has been created.

This event is sent only when the Integration has access to all projects in a Vercel scope.


KeyTypeDescription
payload.project.idIDThe ID of the project.
payload.project.nameStringName of the project.

This event is replaced by project.removed .

Occurs whenever a Project has been removed.

This event is sent only when the Integration has access to all Projects in a Vercel scope.


KeyTypeDescription
payload.project.idIDThe ID of the project.
payload.project.nameStringName of the project.

This event is replaced by integration-configuration.removed .

Occurs whenever an integration has been removed.

KeyTypeDescription
payload.configuration.idIDThe ID of the configuration.
payload.configuration.projectsListAn array of project IDs.

Occurs whenever the user changes the project permission for an integration.

KeyTypeDescription
payload.configuration.idIDThe ID of the configuration.
payload.configuration.projectSelectionStringA String representing the permission for projects. Possible values are all or selected.
payload.configuration.projectsListAn array of project IDs.
payload.projects.addedListAn array of added project IDs.
payload.projects.removedListAn array of removed project IDs.

Occurs whenever the user confirms pending scope changes.

KeyTypeDescription
payload.configuration.idIDThe ID of the configuration.
payload.configuration.scopesListList of all scopes (after confirmation).

This event is replaced by domain.created .

Occurs whenever a domain has been created.

KeyTypeDescription
payload.domain.nameStringThe Domain name created.
payload.domain.delegatedStringWhether or not the domain was delegated/shared.

Once your server is configured to receive payloads, it will listen for any payload sent to the endpoint you configured. By knowing the URL of your webhook, anybody can send you requests. Therefore, it is recommended to check whether the requests are coming from Vercel or not.

The recommended method to check is to use the x-vercel-signature security header you receive with each request. The value of this header corresponds to the sha1 of the request body using your client secret.

For example, you can validate a webhook request as follows:

Next.js (/app)
Next.js (/pages)
Other frameworks
app/api/webhook-validator-example/route.ts
import crypto from 'crypto';
 
export async function GET(request: Request) {
  const { INTEGRATION_SECRET } = process.env;
 
  if (typeof INTEGRATION_SECRET != 'string') {
    throw new Error('No integration secret found');
  }
 
  const rawBody = await request.text();
  const rawBodyBuffer = Buffer.from(rawBody, 'utf-8');
  const bodySignature = sha1(rawBodyBuffer, INTEGRATION_SECRET);
 
  if (bodySignature !== request.headers.get('x-vercel-signature')) {
    return Response.json({
      code: 'invalid_signature',
      error: "signature didn't match",
    });
  }
 
  const json = JSON.parse(rawBodyBuffer.toString('utf-8'));
 
  switch (json.type) {
    case 'project.created':
    // ...
  }
 
  return new Response('Webhook request validated', {
    status: 200,
  });
}
 
function sha1(data: Buffer, secret: string): string {
  return crypto.createHmac('sha1', secret).update(data).digest('hex');
}
Example on how to validate a webhook message.

You can compute the signature using an HMAC hexdigest from the secret token of OAuth2 and request body, then compare it with the value of the x-vercel-signature header to validate the payload.

You should consider this HTTP request to be an event. Once you receive the request, you should schedule a task for your action.

This request has a timeout of 30 seconds. That means if a 2XX HTTP response is not received within 30 seconds, the request will be aborted.

If your HTTP endpoint does not respond with a 2XX HTTP status code, we attempt to deliver the webhook event up to 24 hours with an exponential backoff. Events that could not be delivered within 24 hours will not be retried and will be discarded.

Last updated on November 26, 2024