Skip to Content
ProvidersBuilt-in providers

Vapi webhooks

Receive and verify Vapi webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-vapi-signature and run a task for each Vapi event, filtered on event.message.type.

webhooks.vapi() verifies the HMAC-SHA256 signature Vapi sends in x-vapi-signature on every request.

/trigger/vapi.ts
import { ,  } from "@trigger.dev/sdk";

export const vapi = ..define({
  : "vapi",
  : .vapi(),
});

export const vapiEvents = ({
  id: "vapi-events",
  : vapi,
  : async ({  }) => {
    .();
  },
});

To run a subscriber only for some events, add a filter on event.message.type.

SettingValue
Sourcewebhooks.vapi()
VerificationHMAC-SHA256 in x-vapi-signature
CredentialSecret you generate on Trigger.dev and add to a Vapi HMAC credential
Event typeevent.message.type
Vapi docsVapi webhook docs

Set up Vapi

  1. Start trigger dev or deploy, then copy the endpoint's Webhook URL from the Webhooks page.
  2. Choose Generate secret on the Trigger.dev endpoint and copy the value.
  3. In the Vapi Dashboard, open Integrations > Server Configuration and choose Add Custom Credential. Choose HMAC and set:
    • Secret Key: the secret you generated
    • Algorithm: SHA256
    • Signature Header: x-vapi-signature
    • Timestamp Header: leave empty
    • Payload Format: the request body only, with no timestamp
  4. Set the webhook URL as the server URL on your assistant, phone number or Server Configuration, and attach the credential by its credentialId. Vapi only sends the credential when the server URL comes from your saved configuration, not from an API request.
  5. Send a test event from Vapi, or use the endpoint's Test tab, and check the endpoint's Deliveries tab. See Verify the connection if nothing arrives.

Was this page helpful?

Last updated

Edit on GitHub

On this page