Using Webhooks

Basic

You can configure your LeadPro account to send events to a designated endpoint when a lead is either created or updated. This is known as a 'webhook'.

To use the webhook functionality, you'll need to:

  1. Create an endpoint to receive the data from LeadPro

  2. Add the endpoint URL to the developers section of your dashboard

Once enabled, LeadPro will POST the event data to your endpoint as JSON. The payload contains two fields:

  • "event" – which can be either "lead.created" or “lead.updated”

  • "data" – which contains the lead data, and consists of the following fields:

FieldTypeExampleMandatoryValidation
idNumber1Yesauto-generated
first_nameStringRichardNolength : min 1 max 50
last_nameStringSmithNolength : min 1 max 50
full_nameStringRichard SmithYeslength min 1 max 100
emailStringrichard.smith@gmail.comYesvalid email address
phoneString07123456789Yeslength : max 255 ( only valid UK phone numbers will be called by autocaller)
typeStringvendorYes either : 'sale', 'vendor', 'landlord', 'let', 'mortgage_request'
sourceStringrightmoveNoyou can submit a specific lead source only for /leads. If no source is submitted source will default to 'homepage'.
addressString51 Asimov Place, StarbridgeYes if Vendor/Landlord/ Mortgagelength : max 100
postcodeStringN1 3JYYes if Vendor/Landlord/ Mortgagelength : min 2 max 10
advert_addressString51 Asimov Place, StarbridgeYes if sale/let and no office_id is specifiedlength : max 100
advert_postcodeStringN1 3JYYes if sale/let and no office_id is specifiedlength : min 2 max 10
advert_urlStringhttps://www.site.com/resultNolength : max 255
advert_imageStringhttps://via.placeholder.com/150Nolength : max 255
titleStringMrNolength : min 1 max 10
messageStringWhen can I view this property?Nolength : max 8192 characters
appointment_availabilityJSON{ hours: [ 2021-04-22T10:00:00.000Z, 2021-05-22T10:00:00.000Z, ] }Nomax JSON byte size 2048, array values must be ISO 8601 date string
metaRecord<String, String>{“virtual tour”: “true”}Nomax JSON byte size 1024, object with only string values
questionnaireString[][][[“Do you have property to sell?”, “yes”], [“When would you like to move”, “Before july”]]Nomax JSON byte size 2048, each value in questionnaire should be array of strings with 2 elements
parentIdNumber54NoMust be a valid parent lead
createdAtString(ISO 8601)2000-01-23T01:23:45.678+09:00Nonot writeable
statusStringactiveNomust be UNREAD, IN_PROGRESS, NO_BUSINESS, BUSINESS, DUPLICATE
stageStringcompleteNomust be NEW CONTACTED, KEEP_IN_TOUCH, LOST, NOT_CONTACTABLE, WON VALUATION_BOOKED, INSTRUCTED, VIEWING_BOOKED, REGISTERED, DUPLICATE, SPAM DELETED,
gdpr_checkboxBooleanfalseNoN/A
hostStringhttps://valuation.mydomain.comNoN/A
average_sale_estimationNumber10000Nomax 2 decimal places
average_rent_estimationNumber1000000Nomax 2 decimal places
office_id Number 567NoMust be a valid office_id
property_referenceString 'your unique property reference'If type 'sale' or 'let'length: max 50 char
property_bedroomsNumber 4NoN/A
office_nameStringOxfordNoRead only
minimum_sale_estimationNumber 10000Nomax 2 decimal places
maximum_sale_estimationNumber233333Nomax 2 decimal places
minimum_rent_estimationNumber55444333Nomax 2 decimal places
maximum_rent_estimationNumber343444455Nomax 2 decimal places
comparable_propsObject[]{ "address": "68 Uftwen Road", "beds": 4, "coords": { "x": -0.082544, "y": 51.5422 }, "date": "2021-02-10T00:00:00.000Z", "distance": 166, "months_ago": 7, "original_asking_price": 2150000, "price": 1782500, "time_taken_to_sell": 76 }NoNot writeable
international booleantrue NoN/A
account_idNumber9999NoNot writeable
account_nameStringSkyline EstatesNoNot writeable
office_idNumber9999NoNot writeable
office_nameStringOxfordNoNot writeable
referred_by_office_idNumber222NoNot writeable
referred_by_office_namestring | null'Oxford'No Not writeable
referred_by_account_idnumber | null334No Not writeable
referred_by_account_namestring | null'Lead Pro Ltd'NoNot writeable
property_typestring | nulldetachedNoonly one of detached, semi-detached, terraced, flat-maisonette
{
  event: lead.updated,
  data: {
    id: 1,
    title: "Sir",
    first_name: "Richard",
    last_name: "Branson",
    email: "rbranson@virgin.com",
    type: "vendor",
    source: "homepage",
    phone: 07123456789,
    address: "51 Asimov Place, Starbridge",
    postcode: "N1 3JY",
    advert_address: "51 Asimov Place, Starbridge",
    advert_postcode: "N1 3JY",
    advert_image: "https://www.site.com/result",
    advert_url: "https://via.placeholder.com/150",
    appointment_availability: {
      hours: ["2021-01-01T08:00:00.000Z", "2021-01-01T09:00:00.000Z"],
    },
    full_name: "Sir Ricard Branson", 
    message: "When can we view?",
    meta: {
      virtual tour: true
    }
  }
}

Advanced

For additional security, you may wish to verify that the requests being made to your endpoint are coming from LeadPro. We include a JWT token in the "Authorization".

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

The body of this token contains the full payload, and we recommend using this instead of the actual payload.

The token signature is the base64 encoding of the HS256 encrypted header and body. The key for verifying this signature is generated in the developers section of your dashboard under the webhook signing secret.

webhook developer section.png