Create Webhook
curl --request POST \
--url https://api.loyalty.dog/v2/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>'})
};
fetch('https://api.loyalty.dog/v2/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.loyalty.dog/v2/webhooks"
payload = { "url": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Webhooks
Create Webhook
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.
POST
/
v2
/
webhooks
Create Webhook
curl --request POST \
--url https://api.loyalty.dog/v2/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>'})
};
fetch('https://api.loyalty.dog/v2/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.loyalty.dog/v2/webhooks"
payload = { "url": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
JWT access token obtained from POST /v2/token.
Body
application/json
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
Required string length:
1 - 2083Minimum string length:
8Required string length:
24Pattern:
^[0-9a-f]{24}$Available options:
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 Response
Successful Response
