How to use Webhooks
Jerre avatar
Written by Jerre
Updated over a week ago

Webhooks allow your application to receive real-time notifications about specific events. Here’s a step-by-step guide to configure and utilize the webhooks feature effectively.

Defining Webhook Endpoints

  1. Navigate to Integrations → Webhooks

    • Go to the Integrations section in your dashboard.

    • Select the Webhooks option.

  2. Click ‘Create Webhook’

    • Press the ‘Create Webhook’ button to start defining a new webhook.

  3. Enter Details

    • URL: Input the URL where you want to receive the webhook payloads.

    • Name: Assign a meaningful name to your webhook for easy identification.

    • Webhook Secret (optional): Define a secret key for securing your webhook. This secret will be used to sign the payload using the HMAC SHA256 algorithm, and the signature will be included in the Signature header.

Setting Up Notifications

Receiving new_lead Notifications

  1. Navigate to the Automations Page

    • Go to the Automations section of your dashboard.

  2. Click ‘Create Automation’

    • Press the ‘Create Automation’ button to start a new automation process.

  3. Configure the Trigger

    • Event: Select ‘New Lead’ as the trigger event.

    • Segment: Choose the segment you want to track for new leads.

  4. Set the Action

    • Action: Select ‘Webhook’ as the action to be performed.

  5. Select the Webhook Endpoint

    • Choose the webhook endpoint you defined earlier to receive notifications.

Receiving new_session Notifications

  1. Navigate to the Automations Page

    • Go to the Automations section of your dashboard.

  2. Click ‘Create Automation’

    • Press the ‘Create Automation’ button to start a new automation process.

  3. Configure the Trigger

    • Event: Select ‘New Session’ as the trigger event.

    • Segment: Choose the segment you want to track for new sessions.

  4. Set the Action

    • Action: Select ‘Webhook’ as the action to be performed.

  5. Select the Webhook Endpoint

    • Choose the webhook endpoint you defined earlier to receive notifications.

Receiving contact_revealed Notifications

  1. Navigate to the Automations Page

    • Go to the Automations section of your dashboard.

  2. Click ‘Create Automation’

    • Press the ‘Create Automation’ button to start a new automation process.

  3. Configure the Trigger

    • Event: Select the desired trigger event.

    • Segment: Choose the segment you want to track for contact reveals.

  4. Set the Action

    • Action: Select ‘Reveal Contacts’ as the action to be performed.

    • Persona: Select the persona you want to auto reveal.

    • Reveal Limit: Optionally, set a limit for the number of reveals per company.

  5. Select the Webhook Endpoint

    • Choose the webhook endpoint you defined earlier to receive notifications. You can set it as one of the external destinations.

Webhook Requests

Payload

Each webhook request will contain a JSON payload with two properties: event and subjects.

  • event: The event that triggered the webhook. Supported events are:

    1. new_lead

    2. new_session

    3. contact_revealed

  • subjects: A list of subjects relevant to the event.

Sample Payload

{
'event' => EVENT_NAME,
'subjects' => [SUBJECT1, SUBJECT2, ...]
}

Sample Responses

contact_revealed Event

{
"event": "contacts.revealed",
"subjects": [{
"first_name": "John",
"last_name": "Doe",
"headline": "VP, Sales at MDX Technology",
"linkedin_url": "http:\/\/www.linkedin.com\/in\/john-doe",
"email": "[email protected]",
"title": "VP, Sales",
"location": "London, England, United Kingdom"
"company": {
"name": "MDX Technology Limited",
"domain": "mdxtechnology.com",
"website": "https:\/\/mdxtechnology.com",
"industry": "Financial Services",
"founded_year": "2010",
"employee_range": "11-50 employees",
"annual_revenue": 7867000,
"total_funding": null,
"location": "14 Hewett St, London EC2A 3NP, UK",
"description": "MDX Technology serves over 35 of the world's leading financial institutions. Our enterprise ready, codeless workflow platform enables clients to quickly develop applications on-the-fly for trade collaboration, pre\/post-trade workflows, compliance reporting and much more. The MDX platform is powered by extensive connectivity with over 300 pre-built connectors into formats such as Excel, Symphony, Python, web and Java to name a few. Clients include TP ICAP, HSBC, MarketAxess, Marex, ICE and RBC. The company is headquartered in London, with offices in North America and representation in the AsiaPac region.",
"phone": "+44 20 7469 2610",
"geo": {
"country": "United Kingdom of Great Britain and Northern Ireland",
"country_code": "GB",
"state": "England",
"state_code": "England",
"postal_code": "EC2A 3NP",
"city": "London",
"street": "Hewett Street",
"street_number": "14"
},
"profiles": {
"crunchbase": {
"handle": "mdx-technology",
"url": "https:\/\/crunchbase.com\/organization\/mdx-technology"
},
"linkedin": {
"handle": "mdx-technology-limited",
"url": "https:\/\/linkedin.com\/companies\/mdx-technology-limited"
},
"facebook": {
"handle": null,
"url": null
},
"twitter": {
"handle": "MDXTechnology",
"url": "https:\/\/twitter.com\/MDXTechnology"
},
"instagram": {
"handle": null,
"url": null
},
"youtube": {
"handle": null,
"url": null
}
}
}
}]
}

new_lead Event

{
"event": "new_lead",
"subjects": [{
"id": 31519477,
"first_seen": "2024-05-15T10:55:50.000000Z",
"last_seen": "2024-05-15T10:55:50.000000Z",
"company": {
"name": "Netcontrol Group",
"domain": "netcontrol.com",
"website": "https:\/\/netcontrol.com",
"industry": "Machinery",
"founded_year": "1991",
"employee_range": "51-200 employees",
"annual_revenue": null,
"total_funding": null,
"location": "Karvaamokuja 3, 00380 Helsinki, Finland",
"description": "Netcontrol provides products and services for electric utilities, district heating companies, power companies, and energy intensive industry. The product portfolio covers SCADA, energy management, production management & optimization systems, Remote Terminal Units compliant with the latest standards and protocols, as well as data communication equipment.",
"geo": {
"country": "Finland",
"country_code": "FI",
"state": "Uusimaa",
"state_code": "Uusimaa",
"postal_code": "00380",
"city": "Helsinki",
"street": "Karvaamokuja",
"street_number": "3"
},
"profiles": {
"crunchbase": {
"handle": "netcontrol",
"url": "https:\/\/crunchbase.com\/organization\/netcontrol"
},
"linkedin": {
"handle": "netcontrol-oy",
"url": "https:\/\/linkedin.com\/companies\/netcontrol-oy"
},
"facebook": {
"handle": null,
"url": null
},
"twitter": {
"handle": "NetcontrolGroup",
"url": "https:\/\/twitter.com\/NetcontrolGroup"
},
"instagram": {
"handle": null,
"url": null
},
"youtube": {
"handle": null,
"url": null
}
}
},
"recent_sessions": [{
"started_at": "2024-05-15 10:55:50",
"source": "https:\/\/www.google.com\/",
"browser": "Safari",
"device_type": "desktop",
"operating_system": "Mac OS",
"pageviews": [{
"url": "https:\/\/www.snitcher.com\/snitcher-vs-leadforensics?utm_source=google&utm_medium=cpc&utm_campaign=20933837881&utm_content=158349409355&utm_term=leadforensics&utm_term=leadforensics&utm_campaign=global_eng_search_prospecting_comp_web_all_theme_exact_broader&utm_source=adwords&utm_",
"host": "www.snitcher.com",
"path": "\/snitcher-vs-leadforensics?utm_source=google&utm_medium=cpc&utm_campaign=20933837881&utm_content=158349409355&utm_term=leadforensics&utm_term=leadforensics&utm_campaign=global_eng_search_prospecting_comp_web_all_theme_exact_broader&utm_source=adwords&utm_",
"time_spent": 14,
"visited_at": "2024-05-15 10:55:50"
}],
"total_duration": 14,
"location": {
"city": "Lahti",
"country_code": "FI",
"region": "Etela-Pohjanmaa",
"latitude": 63.216671,
"longitude": 22.85
}
}]
},
{ ... }
}]
}
Did this answer your question?