Webhooks are a great way to get real-time notifications on events that happen in your CodeQR project. Webhooks on CodeQR follow the following format:
webhook-payload.json
{
  "id": "evt_KleiO4HBwZFbO1vZLWIPZ2AtX", // The event ID
  "event": "link.created", // The event type
  "createdAt": "2024-08-26T16:41:52.346Z", // The timestamp of when the event was created
  "data": {
    // Event payload
  }
}
There are two types of webhook events you can listen to:

Workspace-level events

These events are triggered in the context of your entire project: This event is triggered when a new link is created in your CodeQR project. The event payload contains the created link’s details. Here’s an example payload:
This event is triggered when a link is updated in your CodeQR project. The event payload contains the updated link’s details. Here’s an example payload:
This event is triggered when a link is deleted in your CodeQR project. The event payload contains the deleted link’s details. Here’s an example payload:

lead.created

This event is triggered when a new lead is created via CodeQR Conversions. The event payload contains the following:
  • eventName: The name of the event that was tracked.
  • customer: Details about the customer that signed up.
  • click: Details about the click event that led to the lead event.
  • link: Details about the referral link that the lead event is associated with.
Here’s an example payload:

sale.created

This event is triggered when a new sale is tracked via CodeQR Conversions. The event payload contains the following:
  • eventName: The name of the event that was tracked.
  • customer: Details about the customer that made the purchase.
  • click: Details about the click event that led to the sale event.
  • link: Details about the referral link that the sale event is associated with.
Here’s an example payload:

partner.enrolled

This event is triggered when a new partner is enrolled in your partner program. The event payload contains the following:
  • partner: Details about the partner that was enrolled.
  • links: An array of referral links.
Here’s an example payload:
Due to the high volume nature of these events, these events are scoped to a specific link. This means that you need to specify the link when creating a webhook – though you can select multiple links for the same webhook if you’d like. This event is triggered when a user clicks on a link. The event payload contains all the details about the click event. Here’s an example payload: