Webhooks

Webhooks are used to send events from ReferralHero to your server. You can decide which events to send to your server.

To enable webhooks:

  • go to your campaign dashboard > Edit Campaign > Integrations > Webhooks

  • Click on the + New Webhook button

  • In the popup, add your endpoint URL and toggle the events you want to receive

  • Click on Create Webhook

Events

ReferralHero sends a POST HTTP request with a JSON payload when specific events occur.

There are 6 types of events:

new_registration

Description
Response
Description

Sent when a new person subscribes to your list. If you the confirmation email is disabled, the event is sent as soon as the person is subscribed to the list.

Response
{
list_uuid: "MFXXXX", //The UUID of your list
subscriber_id: "sub_123ABC", // Subscriber's ID
response: "new_registration",
name: "John Doe", //Subscriber's name
first_name: "John",
last_name: "Doe",
email: "john.doe@email.com", //Subscriber's email
extra_field: "+1 2348891123", // Subscriber's extra field's value
extra_field_2: "USA", // Subscriber's second extra field's value
code: "2hg36dvs", //Subscriber's unique referral code
source: "facebook", //Subscriber's source. If the subscriber doesn't have a source the value will be "direct_visit"
referred: true,
referral: {
name: "Mark",
email: "mark@yahoo.com",
code: "hxgs6csgy",
people_referred: 26,
points: 27
}, //This property can have 3 possible values: an empty string (if the subscriber has not been referred), an object containing data of the referral (if the subscriber has been referred) or "subscriber_deleted" (if the subscriber has been referred but the user has been deleted.)
referral_link: "http://mywebsite.com/LINK_PLAIN",
people_ahead: 2873, //number of people in the list in front of the current subscriber (Only for Waiting lists)
created_at: 1234567889 // Timestamp of the subscriber's sign up
}

subscriber_promoted

Description
Response
Description

Sent when a subscriber is promoted.

Response
{
list_uuid: "MFXXXX", //The UUID of your list
subscriber_id: "sub_123ABC", // Subscriber's ID
response: "subscriber_promoted",
name: "John Doe", //Subscriber's name
first_name: "John",
last_name: "Doe",
email: "john.doe@email.com", //Subscriber's email
extra_field: "+1 2348891123", // Subscriber's extra field's value
extra_field_2: "USA", // Subscriber's second extra field's value
code: "2hg36dvs", //Subscriber's unique referral code
source: "facebook", //Subscriber's source. If the subscriber doesn't have a source the value will be "direct_visit"
referred: true,
referral: {
name: "Mark",
email: "mark@yahoo.com",
code: "hxgs6csgy",
people_referred: 26,
points: 27
}, //This property can have 3 possible values: an empty string (if the subscriber has not been referred), an object containing data of the referral (if the subscriber has been referred) or "subscriber_deleted" (if the subscriber has been referred but the user has been deleted.)
referral_link: "http://mywebsite.com/LINK_PLAIN",
created_at: 1234567889 // Timestamp of the subscriber's promotion
}

subscriber_deleted

Description
Response
Description

Sent when a subscriber is deleted.

Response
{
list_uuid: "MFXXXX", //The UUID of your list
subscriber_id: "sub_123ABC", // Subscriber's ID
response: "subscriber_deleted",
name: "John Doe", //Subscriber's name
first_name: "John",
last_name: "Doe",
email: "john.doe@email.com", //Subscriber's email
extra_field: "+1 2348891123" // Subscriber's extra field's value
extra_field_2: "USA", // Subscriber's second extra field's value
}

bonus_unlocked

Description
Response
Description

Sent when a subscriber unlocks a reward.

Response
{
list_uuid: "MFXXXX", //The UUID of your list
subscriber_id: "sub_123ABC", // Subscriber's ID
response: "bonus_unlocked",
name: "John Doe", //Subscriber's name
first_name: "John",
last_name: "Doe",
email: "john.doe@email.com" //Subscriber's email
extra_field: "+1 2348891123", // Subscriber's extra field's value
extra_field_2: "USA", // Subscriber's second extra field's value
code: "2hg36dvs", //Subscriber's unique referral code
people_referred: 3, //Number of people referred
referral_link: "http://mywebsite.com/LINK_PLAIN"
}

Errors

Please send back a blank response with a status code of 200. All not-200 responses will be considered errors. After 10 consecutive bad responses, the webhook will be disabled.

If a webhook fails, we will try to deliver it 3 times over a period of 5 minutes.

How to test a webhook

To test a webhook just click on the Test button next to the webhook URL you want to test. We will ping your webhook URL with a JSON file containing fake data.