---
title: "Create Webhook"
method: POST
path: "/v2/webhooks"
tags: ["Webhooks"]
---

# Create Webhook

`POST /v2/webhooks`

Create a new webhook for the current user.

- **data**: `CreateWebhookPayload` - The data for creating the webhook.
- **user**: `User` - The current authenticated user.

**Returns**: `dict` - The created webhook data.

## Headers

- `user-agent` string, nullable
- `authorization` string, nullable

## Request body

- CreateWebhookPayload — The webhook creation payload Attributes: url (str): The webhook URL sharedSecret (str | None, optional): A random string to handshake to verify the URL and hmac the event payload data. Defaults to None allowedTemplates (List[PydanticObjectId] | None, optional): A list ID of the allowed templates. Defaults to None allowedEvents (List[WebhookEventType] | None, optional): A list of allowed webhook types. Defaults to None
  - `url` string, uri, required
  - `sharedSecret` string, nullable
  - `allPassTemplates` boolean, nullable
  - `allowedTemplates` PydanticObjectId[], nullable
  - `allEventTypes` boolean, nullable
  - `allowedEvents` union[], nullable
    - union
      - 'pass.created' | 'pass.updated' | 'pass.downloaded' | 'pass.installed' | 'pass.deleted' | 'registration.created' | 'registration.deleted' | 'scan.performed' | 'webhook.verify' | 'transaction.completed' | 'loyalty.activity.performed' | 'loyalty.activity.reward.redeemed' | 'loyalty.activity.points.redeemed' | 'loyalty.activity.offer.received' | 'loyalty.activity.offer.redeemed' | 'loyalty.activity.offer.expired' | 'loyalty.activity.voucher.received' | 'loyalty.activity.voucher.redeemed' | 'loyalty.activity.voucher.expired' | 'loyalty.activity.points.changed' | 'loyalty.activity.email.added' | 'loyalty.activity.phone.added' | 'loyalty.activity.customer.referred' | 'loyalty.activity.custom.field.added' | 'loyalty.activity.card.installed' | 'loyalty.activity.card.scanned' | 'loyalty.customer.created' | 'loyalty.customer.updated' | 'loyalty.customer.deleted'
      - string

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/loyalty/apis/loyaltydog.md) · [All operations](https://skmtc.net/loyalty/apis/loyaltydog/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/loyalty/loyaltydog/versions/42b7b22af2b6/schema)
