# React to ticket changes (/docs/guides/webhooks)



Run your own code when a ticket is assigned or checked in.

## 1. Create an endpoint [#1-create-an-endpoint]

In **Dashboard → Webhooks**, add your server’s HTTPS endpoint and choose the
events you need. Save the signing secret as EVENTLAYER\_WEBHOOK\_SECRET.

## 2. Verify the request [#2-verify-the-request]

Inside your request handler, pass the raw body and headers to the SDK.

```ts title="Webhook handler · server"
import { verifyWebhook } from "eventlayer";

const event = await verifyWebhook({
  body: await request.text(),
  headers: request.headers,
  secret: process.env.EVENTLAYER_WEBHOOK_SECRET!,
});

if (event.event_type === "ticket.checked_in") {
  console.log(event.data.id, event.data.checked_in_at);
}
```

Verification throws for invalid requests. Do not process those payloads.

## 3. Handle the event [#3-handle-the-event]

Save the verified event before returning a successful response. Use event.id
to deduplicate retries and replays, then process your email, CRM or analytics work.

For delivery history, signing and retries, see the [webhook reference](/docs/webhooks).

## Next steps [#next-steps]

[Send ticket emails](/docs/guides/email) or [sync attendees to your CRM](/docs/guides/crm).
