API Documentation - Add a Prospect

Table of Contents

Through the API

Prospect data must be nested under the client key in the json body.

PUT /api/v2/clients/<client_id>

Edit a limited number of fields on a specified company prospect.

Accepted PUT Parameters

Example request body for status change:

{
    "status": "toured"
}

Example request body for status change to applicant:

{
    "status": "applicant"
    "application": {
    	"unit_id": 123,
        "lease_start_date": "2020-06-01",
        "lease_end_date": "2020-05-31",
        "application_submitted_date": "2020-05-20",
        "application_price": "1200.00"
    }
}

Example response body: 200 success

{
  "data": {
    "client": {
      "id": 111,
      "group": 20,
      "broker_email": "",
      "broker_phone": "",
      "broker_name": " ",
      "people": [
        {
          "first_name": "Lara",
          "last_name": "Smith",
          "preferred_name": "",
          "email": "lara.smith@outlook.com",
          "phone_1": "555-777-5555",
          "phone_2": "",
          "id": 27,
          "is_primary": true,
          "email_updates_opt_in": 10,
          "sms_opted_in": 10,
          "move_out_date": null
        }
      ],
      "move_in_date": null,
      "client_referral": "None",
      "campaign_info": "None",
      "layout": "",
      "price_floor": null,
      "price_ceiling": null,
      "discovery_source": null,
      "status": "Applicant",
      "active_live_chat_id": null,
      "sms_opted_in": 10
    }
  }
}

Example response body: 400 error

If the provided data in the application fields is not valid, a 400 error response will be returned.

{
   "errors": {
      "application": {
         "unit_id": "missing or invalid data",
         "lease_start_date": "missing or invalid data",
         "application_submitted_date": "missing or invalid data"
      }
   }
}

If the provided status choice is not valid, a 400 error response will be returned. This error will be in an array of strings.

{
   "errors": {
      "status": ["missing or invalid data"]
   }
}

POST /api/v2/clients

Create a prospect record in Funnel. Note that in order for Funnel to properly ingest prospects and associate them with teams and properties, the following fields are required: first_name, last_name, email, group.

Accepted POST Parameters

NOTE: You should only pass one of three community/building/unit, otherwise you will get a validation error.

Example request body:

{
  "client": {
    "people": [
      {
        "first_name": "John",
        "last_name": "Doe",
        "email": "johndoe@example.com",
        "phone_1": "5101234567",
        "phone_2": "",
        "is_primary": true
      },
      {
        "first_name": "Jane",
        "last_name": "Doe",
        "email": "janedoe@example.com",
        "phone_1": "",
        "phone_2": "",
        "is_primary": false
      }
    ],
    "move_in_date": "1970-01-01",
    "layout": [
      "studio",
      "1br"
    ],
    "price_floor": 1500,
    "price_ceiling": 2500,
    "notes": "looking for affordable neighborhood with bars and restaurants",
    "group": 12,
    "broker_company": "Jerry Company",
    "broker_email": "jerry@seinfeld.com",
    "broker_first_name": "Jerry",
    "broker_last_name": "Seinfeld",
    "broker_phone": "4101230987",
    "client_referral": "Company Website",
    "campaign_id": "Test-Campaign",
    "campaign_info": "GooglePPC",
    "unit": 5309,
    "device": "phone",
    "source_type": "organic"
  }
}

Example response body: 200 success

{
  "data": {
    "client": {
      "id": 123,
      "group": 30,
      "broker_email": "",
      "broker_phone": "",
      "broker_name": "",
      "people": [
        {
          "first_name": "Lara",
          "last_name": "Smith",
          "preferred_name": "",
          "email": "lara.smith@outlook.com",
          "phone_1": "",
          "phone_2": "",
          "id": 111,
          "is_primary": true,
          "email_updates_opt_in": 10,
          "sms_opted_in": 10,
          "move_out_date": null
        }
      ],
      "move_in_date": null,
      "client_referral": "None",
      "campaign_info": "None",
      "layout": "",
      "price_floor": null,
      "price_ceiling": null,
      "discovery_source": null,
      "status": "Prospect",
      "active_live_chat_id": null,
      "sms_opted_in": 10
    }
  }
}

Example response body: 400 error

If the provided data is not valid, a 400 error response will be returned. These errors will be in an array of strings.

{
  "errors": {
    "client": {
      "group": [
        "Invalid choice."
      ]
    }
  }
}

If the required data is missing, a 400 error response will be returned. These errors will be in an array of strings.

{
   "errors": {
      "client": {
         "people": ["Missing data for required field."]
      }
   }
}

Through the lead capture widget

To embed the widget into your website, simply paste the provided code, which should look like this:

<script src="https://integrations.nestio.com/contact-widget/v1/integration.js" id="nestio-lead-capture-frame"></script>
<script type="text/javascript"> NestioLeadCapture({
  "type": "lead_capture",
  "key": "FUNNEL_API_KEY_HERE",
  "group": 9,
  "color": "74FFE7"
});
</script>

The parameters you can set are:

Via Email parsing

Supported formats

Prospect details can be embedded inside an email using one of the following formats:

Hidden div

Insert a hidden <div> HTML element into the email body. This div must have the id prospect-details. To hide this element add the below CSS as an inline style using the style attribute: display: none;. The element text content must be the lead as a single JSON object.

HTML comment

Insert an HTML comment into the email body. This HTML comment must start with the string PROSPECT = followed by the lead as a single JSON object.

Examples

Hidden div
<div style="display: none;" id="prospect-details">
{
    "name": "Johnny Example",
    "email": "johnny@example.com",
    "phone": "567-567-5678",
    "minPrice": "$1000",
    "maxPrice": "$2000",
    "moveInDate": "2025-06-07",
    "layouts": ["1BED", "STUDIO"],
    "notes": "Do you allow pets?",
    "unit": "82021",
    "sms_opt_in": "true"
}
</div>
HTML comment
<!-- PROSPECT = {
    "name": "Johnny Example",
    "email": "johnny@example.com",
    "phone": "567-567-5678",
    "minPrice": "$1000",
    "maxPrice": "$2000",
    "moveInDate": "2025-06-07",
    "layouts": ["1BED", "STUDIO"],
    "notes": "Do you allow pets?",
    "unit": "82021",
    "sms_opt_in": "true"
} -->

Technical details for developers

This section covers technical details meant to help developers integrate with prospect email forwarding.

Use inline CSS for hidden div

Important CSS style must be inlined, as <style> tags are stripped by most email service providers. So the following <div> will be displayed by most email service providers.

Warning! Do NOT use a CSS class to hide the div. Do NOT do the following:

<style>
.hidden {
    display: none;
}
</style>
<div class="hidden" id="prospect-details">
{
    ...
}
</div>

JSON prospect schema

Key Value type Is required
name string Yes
email string Yes
phone string No
minPrice string No
maxPrice string No
moveInDate ISO 8601 date string No
layouts array of strings No
notes string No
unit string No
[sms_opt_in] bool No
Name

The full name of the prospect.

Email

The email address of the prospect.

Phone

The phone number of the prospect.

Min price

The minimum price the prospect is willing to pay.

Max price

The maximum price the prospect is willing to pay.

Move-in date

The date the prospect wants to move in. Move-in date must be a date in ISO 8601 format: YYYY-MM-DD

Layouts

The property layouts of interest to the prospect. Layouts is a JSON array of strings. Supported layouts:

Notes

A string that will be used as the lead’s ‘message’

Unit

A string representing the unit number the prospect is referencing.

SMS Opt-in

A bool representing the prospect’s sms opt-in response.