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
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.
1
{
2
list_uuid: "MFXXXX", //The UUID of your list
3
subscriber_id: "sub_123ABC", // Subscriber's ID
4
response: "new_registration",
5
name: "John Doe", //Subscriber's name
6
first_name: "John",
7
last_name: "Doe",
8
email: "[email protected]", //Subscriber's email
9
extra_field: "+1 2348891123", // Subscriber's extra field's value
10
extra_field_2: "USA", // Subscriber's second extra field's value
11
code: "2hg36dvs", //Subscriber's unique referral code
12
source: "facebook", //Subscriber's source. If the subscriber doesn't have a source the value will be "direct_visit"
13
referred: true,
14
referral: {
15
name: "Mark",
16
17
code: "hxgs6csgy",
18
people_referred: 26,
19
points: 27
20
}, //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.)
21
referral_link: "http://mywebsite.com/LINK_PLAIN",
22
people_ahead: 2873, //number of people in the list in front of the current subscriber (Only for Waiting lists)
23
created_at: 1234567889 // Timestamp of the subscriber's sign up
24
}
Copied!

subscriber_promoted

Description
Response
Sent when a subscriber is promoted.
1
{
2
list_uuid: "MFXXXX", //The UUID of your list
3
subscriber_id: "sub_123ABC", // Subscriber's ID
4
response: "subscriber_promoted",
5
name: "John Doe", //Subscriber's name
6
first_name: "John",
7
last_name: "Doe",
8
email: "[email protected]", //Subscriber's email
9
extra_field: "+1 2348891123", // Subscriber's extra field's value
10
extra_field_2: "USA", // Subscriber's second extra field's value
11
code: "2hg36dvs", //Subscriber's unique referral code
12
source: "facebook", //Subscriber's source. If the subscriber doesn't have a source the value will be "direct_visit"
13
referred: true,
14
referral: {
15
name: "Mark",
16
17
code: "hxgs6csgy",
18
people_referred: 26,
19
points: 27
20
}, //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.)
21
referral_link: "http://mywebsite.com/LINK_PLAIN",
22
created_at: 1234567889 // Timestamp of the subscriber's promotion
23
}
Copied!

subscriber_deleted

Description
Response
Sent when a subscriber is deleted.
1
{
2
list_uuid: "MFXXXX", //The UUID of your list
3
subscriber_id: "sub_123ABC", // Subscriber's ID
4
response: "subscriber_deleted",
5
name: "John Doe", //Subscriber's name
6
first_name: "John",
7
last_name: "Doe",
8
email: "[email protected]", //Subscriber's email
9
extra_field: "+1 2348891123" // Subscriber's extra field's value
10
extra_field_2: "USA", // Subscriber's second extra field's value
11
}
Copied!

bonus_unlocked

Description
Response
Sent when a subscriber unlocks a reward.
1
{
2
list_uuid: "MFXXXX", //The UUID of your list
3
subscriber_id: "sub_123ABC", // Subscriber's ID
4
response: "bonus_unlocked",
5
name: "John Doe", //Subscriber's name
6
first_name: "John",
7
last_name: "Doe",
8
email: "[email protected]" //Subscriber's email
9
extra_field: "+1 2348891123", // Subscriber's extra field's value
10
extra_field_2: "USA", // Subscriber's second extra field's value
11
code: "2hg36dvs", //Subscriber's unique referral code
12
people_referred: 3, //Number of people referred
13
referral_link: "http://mywebsite.com/LINK_PLAIN"
14
}
Copied!

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.
Last modified 1yr ago