Webhooks Guide

Last updated 24/09/2024

You can configure your OpenFi account to send webhook events to a specific endpoint when a lead is either created or updated.

To enable webhooks, follow these steps:

  • Create an endpoint that can receive the data from OpenFi.

  • Provide the OpenFi team with the endpoint URL so they can set up the events to be sent to that endpoint

Once the webhook is enabled, OpenFi will send a POST request to your endpoint.

Event Types

Once the webhook is enabled, OpenFi will send a POST request to your endpoint with event data in JSON format. The payload will include the following key fields:

  • type: This field indicates the event type, which can be "lead.created" or "lead.updated".

  • lead: This field contains detailed information about the lead. 

The lead data includes:

  • id: The unique identifier for the lead.

  • source: The origin of the lead (e.g., WhatsApp).

  • status: The status of the lead (e.g., “In Progress”, "Successful").

  • contact: Information about the lead's contact, including the contact's firstName, lastName, and email. In case you have some custom fields set up on the contact level, those will be passed within the request as well.

  • communicationChannels: The communication channels used by the lead (e.g., WhatsApp).

  • messages: An array of messages exchanged between the lead and the system, each containing id, type (e.g., Incoming or Outgoing), content, and timestamps.

  • attributes: Additional lead attributes such as the deposit amount, mortgage type, mortgage amount, call availability, mortgage timeline, and any borrowing blockers. In case you have some custom lead attributes set up on the contact level, those will be passed within the request as well.

Webhook example payload