> ## Documentation Index
> Fetch the complete documentation index at: https://trigger.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.**

```ts /trigger/vapi.ts theme={"theme":"css-variables"}
import { webhook, webhooks } from "@trigger.dev/sdk";

export const vapi = webhooks.endpoint.define({
  id: "vapi",
  source: webhooks.vapi(),
});

export const vapiEvents = webhook({
  id: "vapi-events",
  endpoint: vapi,
  onEvent: async ({ event }) => {
    console.log(event);
  },
});
```

To run a subscriber only for some events, add a [filter](https://trigger.dev/docs/webhooks/filters.md) on `event.message.type`.

| Setting | Value |
| - | - |
| Source | `webhooks.vapi()` |
| Verification | HMAC-SHA256 in `x-vapi-signature` |
| Credential | Secret you generate on Trigger.dev and add to a Vapi HMAC credential |
| Event type | `event.message.type` |
| Vapi docs | [Vapi webhook docs](https://docs.vapi.ai/server-url/server-authentication) |

## 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](https://trigger.dev/docs/webhooks/connect.md#verify-the-connection) if nothing arrives.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.