Webhooks

Webhooks are used to send events from Maître to your server.

To enable webhooks, go to your widget dashboard > " Advanced Settings" > "Webhooks".
From there, click on the "Add Webhook" button and add the url of your webhook.

Don't forget to save your changes!


How webhooks work

We send a POST http request with a JSON file when specific events occur.

We send three types of events:

  • new_registration
    is called when a new person subscribes to your list
  • subscriber_accepted
    is called when you accept a subscriber
  • subscriber_deleted
    is called when you delete a subscriber

The event "new_registration" is triggered when the user verifies his email. The Json object sent for  new_registration will contain the following parameters:

{
  list_uuid: "MFXXXX", //The UUID of your list
  response: "new_registration",
  name: "John Doe", //Subscriber's name
  email: "john.doe@email.com", //Subscriber's email
  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
}

The Json object sent for  subscriber_accepted will contain the following parameters::

{
  list_uuid: "MFXXXX", //The UUID of your list
  response: "subscriber_accepted",
  name: "John Doe", //Subscriber's name
  email: "john.doe@email.com", //Subscriber's email
  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"
}

The Json object sent for  subscriber_deleted will contain the following parameters::

{
  list_uuid: "MFXXXX", //The UUID of your list
  response: "subscriber_deleted",
  name: "John Doe", //Subscriber's name
  email: "john.doe@email.com" //Subscriber's email
}

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 link "Test" next to the webhook url you want to test.

We will ping your webhook url with a json file containing fake data.

If you don't see the "Test" link it means that you haven't saved your changes or your webhook is disabled. If it's the former, try to save and reload the page.

Still need help? Contact Us Contact Us