API

Last updated 23/09/2024

Authorisation

Each request must have your OpenFi API key in the authorization header. The API key will be passed onto you by an OpenFi team member.

x-api-key : e3****YOUR-API-KEY****2o5x

You may also issue multiple API keys for your account if needed.

POST - Lead

Sending lead information through to this endpoint will create a lead and if specific criteria is met in the account, initiate a Whatsapp conversation with the lead using the provided phone number.

POST - https://api.openfi.tech/v1/leads

The list of fields sent through the API requests may vary depending on the list of attributes specified on your account level. However, prior to introducing new attributes within the API requests, these will need to be added to the Openfi Account.

Example Request

{
  "source": "homepage",
  "contact": {
    "attributes": {
      "lastName": "Doe",
      "firstName": "Jane"
    },
    "communicationChannels": [
      {
        "id": "447700000000",
        "type": "whatsapp"
      }
    ]
  },
  "attributes": {
    "inquiryType": "Appointment Booking",
     "callAvailability": "Monday 2-3 pm"
  }
}

Fields

Detailed Field Explanation

  • source

This field indicates the source of the request. It is used to distinguish between leads created from different sources. This can be “homepage”, “api”, etc. Bear in mind that “whatsapp” as a source is reserved for the leads created through direct Whatsapp conversation and therefore isn’t suggested that is used within the api calls.

  • contact

The contact object contains all the information related to the individual requesting the demo. It includes a list of contact attributes (like the first and last name) and the info about the communication channel by which they can be contacted. The method currently supported is “whatsapp”.

Contact.attributes

Contact.communicationChannel

  • attributes

This object contains additional lead-level attributes related to the specific business opportunity/lead record. The list of fields and values you can send within this field depends on the list of attributes defined in your account (which is the info you’d like to collect from the leads during the chat) and can be provided by your account manager after you’ve defined the structure.

Fields

Field

Type

Description

Validation

source

string

The source of the lead that is being create through the API

You can submit a specific source such as “homepage”, “website”, “api”

contact

object

The object contains info on the contact level.

Contains an array of contact attributes and an array of communicationChannels

contact.attributes

object

The array contains the list of attributes on the contact level. The attributes can be customised on the account.

Contact attributes such as firstName, lastName

contact.communicationChannels

object

List of communication channels you’d like to use to contact the lead, a pair of the channel and the identifier tied to this channel. For example, a “whatsapp” channel needs the id to be a WA phone number, and an “email” channel requires the email address.

For now, we can only accept the “type”: “whatsapp”.

attributes

Object

Contains additional attributes on the lead level

The list of attributes you can send through the API is the one defined on the lead level.