Skip to main content

Webhooks

Webhooks let Loyal Guru push event data to an external system when something important happens, such as a Customer update, voucher redemption, reward redemption, challenge enrollment, or cart creation.

Use webhooks when an external CRM, ESP, data platform, fulfillment system, or middleware needs to react to Loyal Guru events without polling the API.

How webhooks work​

When a subscribed event occurs, Loyal Guru sends an HTTPS POST request with a JSON body to the configured webhook URL.

Destination requirements​

Before configuring a webhook in Loyal Guru, the external system must provide an endpoint that can receive requests from Loyal Guru.

RequirementGuidance
HTTPS endpointUse a stable public HTTPS URL for production.
MethodsThe destination should accept POST; support GET if your setup uses connectivity checks.
JSON bodyParse JSON payloads and tolerate optional or missing fields.
IdempotencyTreat repeated deliveries of the same event as safe; retries can happen after failures.
ResponseReturn a success status only after the event is accepted for processing.
LoggingLog request time, event headers, payload identifier, and processing result.

Create a webhook connector​

In the Owner App, go to Webhooks & Connectors and create a new connector of type Webhook.

FieldDescription
NameConnector name shown in the Owner App.
StatusWhether the connector is active. Inactive connectors do not send events.
URLDestination URL that receives webhook requests.
AuthenticationNo Auth or JWT. Use JWT for production integrations.
SecretGenerated by Loyal Guru when JWT authentication is selected and the connector is saved.
HeadersOptional custom headers sent with the webhook request.

After creating the connector, create one or more actions. Each action subscribes the connector to a specific event type.

JWT authentication​

When JWT authentication is enabled, Loyal Guru signs a token with HS256 and sends it in the webhook request headers.

The external system must verify the token using the secret generated in the connector configuration.

Token header:

{
"alg": "HS256",
"typ": "JWT"
}

Token payload:

{
"connector_id": 123,
"connector_action_id": 456,
"expires_at": 1743494030
}

expires_at is a Unix timestamp. The token expires 5 minutes after it is generated. Reject expired tokens and tokens that cannot be verified with the connector secret.

Available webhook events​

The currently documented webhook events are:

EventLG-EntityLG-EventTypical use
Customer createcustomercreateSync new Customers to CRM, ESP, IAM, or data platform.
Customer updatecustomerupdateKeep external Customer profiles, consent, and attributes current. Also emitted when Inactivity Lifecycle sets status to inactive.
Customer deletecustomerdeleteAnonymize or delete Customer data downstream. Also emitted when Inactivity Lifecycle anonymizes a dormant Customer.
Customer challenge woncustomerchallenge_wonTrigger prize fulfillment, CRM journeys, or notifications.
Challenge enrolledchallengeenrolledUpdate external engagement or challenge tracking.
Score triggertriggerexecutedReact when a points trigger grants points or effects.
Redeem pointssubstractexecutedReact when points are redeemed or subtracted.
Refer a friend score triggercustomerrefer_a_friend_executedTrigger referral follow-up flows.
Create profile score triggercustomerafter_create_profile_executedTrigger welcome or profile-completion flows.
Customer tier woncustomertier_level_wonSync tier upgrade to CRM, app, ESP, or service tools.
Customer tier lostcustomertier_level_lostSync tier downgrade or expiration.
Campaign sentcampaigndeliveredReact when a Targeted Delivery campaign finishes (campaign_sent).
Plan campaign sentcampaignplan_deliveredReact per campaign when an Intelligent Delivery plan finishes (plan_campaign_sent).
Plan deliveredplandeliveredReact once when an Intelligent Delivery plan is delivered (payload: plan_id).
Voucher createdvouchercreatedReact when a voucher is created in a unit delivery flow.
Voucher redeemvoucherredeemedTrigger fulfillment, reconciliation, or downstream coupon tracking.
Reward redeemedrewardredeemedTrigger reward fulfillment or external redemption tracking.
Cart createactivitycreateSend created cart data to external analytics or data platforms.

Payloads vary by event. The destination should use LG-Entity and LG-Event headers to route processing, then validate the JSON body for the fields required by that integration.

note

Companies that enable Inactivity Lifecycle can generate extra customer / update and customer / delete traffic on the weekly evaluation runs (and a larger first-run backlog when the policy is first turned on). Coordinate capacity with Integrations before enabling the rules in production.

note

substract is the current emitted header value documented for points redemption events. Treat it as a protocol value, even though the English word is normally spelled "subtract".

Common payload groups​

GroupExamples of fields
Customer eventsCustomer ID/code, status, profile fields, consent fields, custom attributes, timestamps.
Challenge eventsCustomer ID/code, challenge ID/name, level, threshold, enrolled or won timestamps, awarded points.
Points trigger eventsTrigger slug, comments, total points, scores, effects, Customer balance.
Tier eventsCustomer ID/code, tier ID/name, current tier, previous tier, threshold, expiration.
Voucher eventsVoucher code, discount, discount type, availability window, remaining redemptions, Customer.
Reward eventsRedemption ID/type, reward ID/name/type, Customer, points used, reward code, source.
Cart eventsCart ID/code, total, currency, location, Customer, lines, points, discounts, effects.

Webhook logs​

Webhook Logs are available in Webhooks & Connectors > Logs. Logs currently apply to webhook connectors.

Use logs to inspect:

  • Connector and action.
  • Creation date in the Company's configured timezone.
  • Number of delivery attempts.
  • Final status: OK or ERROR.
  • Method and destination URL.
  • Full JSON body sent to the external endpoint.

Filters:

FilterNotes
ConnectorsRequired. Select one or more webhook connectors.
ActionsRequired. Select one or more actions.
From / ToOptional. If empty, the search covers the last 24 hours.
StatusOptional. Filter by OK or ERROR.

The log detail view includes a Copy JSON action to reproduce or debug a delivery manually.

Implementation checklist​

  • Make the receiver idempotent.
  • Validate JWT when enabled.
  • Reject expired JWT tokens.
  • Return success only after safely accepting the event.
  • Store raw event payloads for debugging and replay.
  • Route events by LG-Entity and LG-Event.
  • Avoid hard failures when optional fields are absent.
  • Monitor ERROR logs after launch.

Troubleshooting​

SymptomWhat to check
No webhook is sentConnector status, action configuration, source event availability, and whether the event actually occurred.
Webhook returns ERROR in logsOpen the log detail, inspect destination response, JSON body, URL, timeout, and provider availability.
JWT validation failsConnector secret, HS256 verification, token header location, and expires_at within the 5-minute validity window.
Duplicate event processingThe destination must be idempotent and detect already-processed events.
Logs show no resultsSelect both required filters: Connector and Action. If no dates are selected, only the last 24 hours are searched.
External system misses Customer dataConfirm that the selected event payload contains the fields the external system expects; add mapping or enrichment in middleware when needed.