Ylopo API API Reference

Setup

When a Ylopo client wants to integrate with a new CRM, a client-specific apiKey is generated as part of the setup process and shared with the target CRM. The target CRM will use this apiKey to validate payloads received as well as authenticate payloads sent. The target CRM will also provide a delivery URL which Ylopo will use deliver all payloads to.

New Lead Delivery From Ylopo

When a new lead is created in Ylopo, a REGISTRATION event is sent containing the lead data, assignment information, recent engagement statistics, and links to management pages. Example payload:

{
    "source": "Ylopo",
    "sourceDetail": "YLOPO_ADWORDS",
    "eventType": "REGISTRATION",
    "message": "Registration:<br>\nYlopo ID: 196282<br>\nLead Type: SELLER<br>\nStars: https://stars.ylopo.com/lead-detail/abc123",
    "lead": {
        "firstName": "John",
        "lastName": "Smith",
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "createdAt": "2017-05-22T21:23:49.729Z",
        "referrerDomain": "http://some.referrerdomain.com",
        "starsLink": "https://stars.ylopo.com/lead-detail/abc123",
        "tags": [
            "MANUAL",
            "FOO"
        ],
        "leadType": "SELLER",
        "assignments": [
            {
                "type": "realtor",
                "name": "Bob Realtor",
                "crmId": "1234",
                "email": "bobrealtor@ylopo.com"
            },
            {
                "type": "lender",
                "name": "Jake Lender",
                "crmId": "1235",
                "email": "jakelender@ylopo.com"
            }
        ],
        "assignedWebsite": "http://portal.ylopo.com",
        "lastSessionAvgPrice": 761750,
        "lastSessionListingsViewed": 4,
        "lastSessionSearches": 2,
        "lastSessionListingsSaved": 0,
        "lastSessionShowingInfoRequests": 2,
        "lastSessionTotalVisits": 1,
        "lastSessionLastVisitDate": "2018-08-21T19:41:22.743Z",
        "editPushNotificationsLink": "https://stars.ylopo.com/abcde",
        "editListingAlertLink": "https://stars.ylopo.com/fghij",
        "viewBrowsingHistoryLink": "https://stars.ylopo.com/klmno"
    },
    "listing": {
        "mlsNumber": "ABC123",
        "url": "http://portal.ylopo.com/listing-detail/12345",
        "address": "123 Easy St.",
        "city": "Encino",
        "state": "CA",
        "zip": "91316",
        "bedrooms": 4,
        "bathrooms": 2,
        "type": "Single Family Residence",
        "sqFt": 1303,
        "price": 799000,
        "yearBuilt": 1949,
        "images": [
            // listing image urls
        ]
    },
}

Continuous Lead Updates (Webhooks)

Following a REGISTRATION, ongoing updates are continually sent as the lead engages and advances through their home search experience and interacts with our systems. These webhooks are detailed below.

Initial Landing

The lead began a new session on the home search site.

{
    "eventType": "INITIAL_LANDING",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "lead": {
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "crmId": "1"
    },
    "message": "Lead logged into home search site",
    "url": "https://portal.ylopo.com"
}

Showing Request

The lead requested a showing for a given listing on the home search site. This is triggerred by an explicit button click and form submission.

{
    "eventType": "SHOWING_REQUEST",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "lead": {
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "crmId": "1"
    },
    "listing": {
        "mlsNumber": "ABC123",
        "url": "http://portal.ylopo.com/listing-detail/12345",
        "address": "123 Easy St.",
        "city": "Encino",
        "state": "CA",
        "zip": "91316",
        "bedrooms": 4,
        "bathrooms": 2,
        "type": "Single Family Residence",
        "sqFt": 1303,
        "price": 799000,
        "yearBuilt": 1949,
        "images": [
            // listing image urls
        ]
    },
    "message": "Lead requested info or a showing of a property:<br>\nhttp://portal.ylopo.com/listing-detail/12345<br>\n123 Easy St.<br>\nEncino, CA 91316<br>\nPrice: $799,000<br>\n<br>\nMessage: I am interested in scheduling a showing for 123 Easy St Encino CA 91316.  Please call me to coordinate.<br>\nFull Name: John Smith<br>\nPhone Number: 5555555555<br>\nEmail Address: johnsmith@ylopo.com"
}

Request Information

The lead requested information on the home search site. This is triggered by an explicit button click and form submission. This can also include a listing object, if appropriate and known.

{
    "eventType": "REQUEST_INFORMATION",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "lead": {
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "crmId": "1"
    },
    "listing": {
        "mlsNumber": "ABC123",
        "url": "http://portal.ylopo.com/listing-detail/12345",
        "address": "123 Easy St.",
        "city": "Encino",
        "state": "CA",
        "zip": "91316",
        "bedrooms": 4,
        "bathrooms": 2,
        "type": "Single Family Residence",
        "sqFt": 1303,
        "price": 799000,
        "yearBuilt": 1949,
        "images": [
            // listing image urls
        ]
    },
    "message": "Lead requested info for seller offer PRIVATE_SHOWING:<br>\nMessage: Hi, I'm interested in talking to you about setting up a private showing for your buyers who are looking for a property similar to mine!<br>\nFull Name: John Smith<br>\nHome Address: 123 Easy St<br>\nPhone Number: 5555555555<br>\nEmail Address: johnsmith@ylopo.com"
}

Favorite Listing

The lead favorited a given listing. This is triggered by an explicit button click.

{
    "eventType": "FAVORITE_LISTING",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "lead": {
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "crmId": "1"
    },
    "message": "Lead favorited a listing<br>\nhttp://portal.ylopo.com/listing-detail/12345<br>\n123 Easy St.<br>\nEncino, CA 91316<br>\nPrice: $799,000<br>\n<br>\n",
    "listing": {
        "mlsNumber": "ABC123",
        "url": "http://portal.ylopo.com/listing-detail/12345",
        "address": "123 Easy St.",
        "city": "Encino",
        "state": "CA",
        "zip": "91316",
        "bedrooms": 4,
        "bathrooms": 2,
        "type": "Single Family Residence",
        "sqFt": 1303,
        "price": 799000,
        "yearBuilt": 1949,
        "images": [
            // listing image urls
        ]
    },
}

View Listing Detail

The lead viewed a given listing. This is triggered by visiting a listing detail page from either an email alert click or by clicking the listing from the results on the search site.

{
    "eventType": "VIEW_LISTING_DETAIL",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "lead": {
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "crmId": "1"
    },
    "message": "Lead viewed a listing<br>\nhttp://portal.ylopo.com/listing-detail/12345<br>\n123 Easy St.<br>\nEncino, CA 91316<br>\nPrice: $799,000<br>\n<br>\n",
    "listing": {
        "mlsNumber": "ABC123",
        "url": "http://portal.ylopo.com/listing-detail/12345",
        "address": "123 Easy St.",
        "city": "Encino",
        "state": "CA",
        "zip": "91316",
        "bedrooms": 4,
        "bathrooms": 2,
        "type": "Single Family Residence",
        "sqFt": 1303,
        "price": 799000,
        "yearBuilt": 1949,
        "images": [
            // listing image urls
        ]
    },
}

The lead searched for listings on the search site with the given search parameters.

{
    "eventType": "SEARCH",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "lead": {
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "crmId": "1"
    },
    "message": "Lead searched for homes",
    "search": {
        "minPrice": 402500,
        "sqFtMin": 2000,
        "bathrooms": 2,
        "locations": [
            {
                "city": "Encino",
                "state": "CA",
                "postalCode": "91416"
            },
        ]
    }
}

The lead saved a search for future use. This search is often also used in automatic listing alert emails based on these search parameters.

{
    "eventType": "SAVED_SEARCH",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "lead": {
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "crmId": "1"
    },
    "message": "Lead saved a search in Encino, CA (+3 locations)",
    "search": {
        "bedrooms": 3,
        "bathrooms": 2,
        "sqFtMin": 2000,
        "sqFtMax": 3000,
        "priceMin": 800000,
        "priceMax": 2000000,
        "locations": [
            {
                "city": "Encino",
                "state": "CA"
            },
            {
                "city": "Encino",
                "state": "CA",
                "neighborhood": "Encino Hills"
            },
            {
                "city": "Encino",
                "state": "CA",
                "subdivision": "Encino Park"
            },
            {
                "zip": "91316"
            }
        ]
    }
}

Questionnaire Submission

The lead submitted a response to a questionnaire popup form during their home search process.

{
    "eventType": "QUESTIONNAIRE_SUBMISSION",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "lead": {
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "crmId": "1"
    },
    "message": "Lead submitted a response to a questionnaire form:<br>\nTime Frame: I'm casually browsing right now<br>\n"
}

Stats Update

Not necessarilly triggered by any specific lead activity, but provides the latest session's engagement stats along with the latest links to the various management pages.

{
    "eventType": "STATS_UPDATE",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "lead": {
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "crmId": "1",
        "leadType": "BUYER",
        "starsLink": "https://stars.ylopo.com/lead-detail/abc123",
        "lastSessionAvgPrice": 761750,
        "lastSessionListingsViewed": 4,
        "lastSessionSearches": 2,
        "lastSessionListingsSaved": 0,
        "lastSessionShowingInfoRequests": 2,
        "lastSessionTotalVisits": 1,
        "lastSessionLastVisitDate": "2018-08-21T19:41:22.743Z",
        "editPushNotificationsLink": "https://stars.ylopo.com/abcde",
        "editListingAlertLink": "https://stars.ylopo.com/fghij",
        "viewBrowsingHistoryLink": "https://stars.ylopo.com/klmno"
    }
}

Note

Something occurred which was deemed worth passing along as a note about the lead. Its contents could contain anything, but the noteType field is a good categorical indicator.

{
    "eventType": "NOTE",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "noteType": "TEXT_AUTOMATION",
    "lead": {
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "crmId": "1"
    },
    "message": "<p>Drip Text Sent to Lead: This is a test. <a href=\"https://stars.ylopo.com/lead-detail/abc123\">Stars Link</a></p>",
    "messagePlainText": "Drip Text Sent to Lead: This is a test. Stars Link: https://stars.ylopo.com/lead-detail/abc123"
}

Priority Lead Event

Ylopo determined sufficient lead engagment to indicate that this lead should be considered a priority. This can be triggered by a variety of factors which are sometimes altered.

{
    "eventType": "PRIORITY_LEAD_EVENT",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "lead": {
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "crmId": "1"
    },
    "message": "<p>Ylopo Urgent Priority Lead: This lead returned after 60 days and viewed 8 listings</p>",
    "messagePlainText": "Ylopo Urgent Priority Lead: This lead returned after 60 days and viewed 8 listings"
}

Tag Added/Removed

Ylopo automatically added and/or removed tag(s) from the lead based on some lead engagement or activity.

{
    "eventType": "TAG",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "lead": {
        "email": "johnsmith@ylopo.com",
        "phone": "5555555555",
        "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
        "crmId": "1"
    },
    "addedTags": [
        "AI_NEEDS_FOLLOW_UP"
    ],
    "removedTags": [
        "AI_RESPONDED",
        "AI_ENGAGED",
        "AI_NOT_INTERESTED",
        "AI_SUGGEST_FALLBACK"
    ]
}

Contact Information Updated

The agent or lead updated the lead's contact information on file

{
    "eventType": "CONTACT_INFO_UPDATED",
    "eventDate": "2017-05-22T21:23:49.729Z",
    "lead": {
        "email": "johndoe@ylopo.com",
        "firstName": "John",
        "lastName": "Doe",
        "phone": "123-456-7890",
        "uuid": "abcd-1234",
        "crmId": "1"
    },
    "previousInfo": {
        "email": "johnsmith@ylopo.com",
        "firstName": "John",
        "lastName": "Smith",
        "phone": "5555555555"
    }
}

Data Delivery To Ylopo

New leads and updates to existing leads can also be sent to Ylopo using the designated client-specific apiKey. For details, see the route and model definitions below.

API Endpoint
https://api.ylopo.com/interchange-staging
Contact: support@ylopo.com
Schemes: https
Version: v1

Authentication

ApiKeyAuth

type
apiKey
in
header
name
X-Api-Key

Paths

Add Lead

POST /lead

Send a new lead to Ylopo. If a duplicate is found, we will attempt to update it instead. Note that this means any fields provided which are not valid in a PUT /lead are ignored in the case of dupes.

New lead and related data to deliver to Ylopo

Request Content-Types: application/json
Request Example
{
  "partnerName": "Leads, INC",
  "lead": {
    "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
    "email": "johnsmith@ylopo.com",
    "phone": "5555555555",
    "crmId": "1",
    "crmUrl": "https://some-crm-url.com/1",
    "crmCreatedAt": "2017-04-14T18:31:19.000Z",
    "deleted": false,
    "source": "Google",
    "leadType": "BUYER",
    "status": "New",
    "firstName": "John",
    "middleName": "Jacob",
    "lastName": "Smith",
    "tags": [
      "HOT"
    ],
    "assignments": [
      {
        "type": "realtor",
        "name": "Bob Realtor",
        "crmId": "1234",
        "email": "bobrealtor@ylopo.com",
        "phone": "555-555-5555"
      }
    ],
    "additionalData": {
      "someString": "TEST",
      "someCount": 5,
      "someArray": [
        "TEST1",
        "TEST2"
      ]
    }
  },
  "searchAlert": {
    "locations": [
      {
        "city": "Venice",
        "state": "CA"
      },
      {
        "county": "Los Angeles",
        "state": "CA"
      },
      {
        "postalCode": "90210"
      }
    ],
    "minPrice": 50000,
    "maxPrice": 500000,
    "bathrooms": 2,
    "bedrooms": 4
  }
}

Lead accepted

400 Bad Request

Bad request (auth, formatting, or validation error)

Response Content-Types: application/json
Response Example (200 OK)
{
  "success": true,
  "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9"
}
Response Example (400 Bad Request)
{
  "success": false,
  "error": true,
  "message": "X-Api-Key header is required"
}

Update Lead

PUT /lead

Update an existing lead in Ylopo

Existing lead with new data to update in Ylopo

Request Content-Types: application/json
Request Example
{
  "lead": {
    "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
    "email": "johnsmith@ylopo.com",
    "phone": "5555555555",
    "crmId": "1",
    "crmUrl": "https://some-crm-url.com/1",
    "crmCreatedAt": "2017-04-14T18:31:19.000Z",
    "deleted": false,
    "source": "Google",
    "leadType": "BUYER",
    "status": "New",
    "firstName": "John",
    "middleName": "Jacob",
    "lastName": "Smith",
    "tags": [
      "HOT"
    ],
    "assignments": [
      {
        "type": "realtor",
        "name": "Bob Realtor",
        "crmId": "1234",
        "email": "bobrealtor@ylopo.com",
        "phone": "555-555-5555"
      }
    ],
    "additionalData": {
      "someString": "TEST",
      "someCount": 5,
      "someArray": [
        "TEST1",
        "TEST2"
      ]
    }
  }
}

Lead accepted

400 Bad Request

Bad request (auth, formatting, or validation error)

404 Not Found

Lead not found

Response Content-Types: application/json
Response Example (200 OK)
{
  "success": true,
  "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9"
}
Response Example (400 Bad Request)
{
  "success": false,
  "error": true,
  "message": "X-Api-Key header is required"
}
Response Example (404 Not Found)
{
  "success": false,
  "error": true,
  "message": "Not Found"
}

Schema Definitions

AddLead: object

The payload structure for a new lead submission. New leads can be sent in a POST request and must have a unique email address and leadType.

partnerName: string

The partner or CRM name sending this lead

lead: Lead
searchAlert: SearchAlert
Example
{
  "partnerName": "Leads, INC",
  "lead": {
    "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
    "email": "johnsmith@ylopo.com",
    "phone": "5555555555",
    "crmId": "1",
    "crmUrl": "https://some-crm-url.com/1",
    "crmCreatedAt": "2017-04-14T18:31:19.000Z",
    "deleted": false,
    "source": "Google",
    "leadType": "BUYER",
    "status": "New",
    "firstName": "John",
    "middleName": "Jacob",
    "lastName": "Smith",
    "tags": [
      "HOT"
    ],
    "assignments": [
      {
        "type": "realtor",
        "name": "Bob Realtor",
        "crmId": "1234",
        "email": "bobrealtor@ylopo.com",
        "phone": "555-555-5555"
      }
    ],
    "additionalData": {
      "someString": "TEST",
      "someCount": 5,
      "someArray": [
        "TEST1",
        "TEST2"
      ]
    }
  },
  "searchAlert": {
    "locations": [
      {
        "city": "Venice",
        "state": "CA"
      },
      {
        "county": "Los Angeles",
        "state": "CA"
      },
      {
        "postalCode": "90210"
      }
    ],
    "minPrice": 50000,
    "maxPrice": 500000,
    "bathrooms": 2,
    "bedrooms": 4
  }
}

UpdateLead: object

The payload structure for an update lead submission. Existing leads can be updated in a PUT request and are identified by either their email or uuid (as returned from any previously successful POST or PUT request).

lead: Lead
Example
{
  "lead": {
    "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
    "email": "johnsmith@ylopo.com",
    "phone": "5555555555",
    "crmId": "1",
    "crmUrl": "https://some-crm-url.com/1",
    "crmCreatedAt": "2017-04-14T18:31:19.000Z",
    "deleted": false,
    "source": "Google",
    "leadType": "BUYER",
    "status": "New",
    "firstName": "John",
    "middleName": "Jacob",
    "lastName": "Smith",
    "tags": [
      "HOT"
    ],
    "assignments": [
      {
        "type": "realtor",
        "name": "Bob Realtor",
        "crmId": "1234",
        "email": "bobrealtor@ylopo.com",
        "phone": "555-555-5555"
      }
    ],
    "additionalData": {
      "someString": "TEST",
      "someCount": 5,
      "someArray": [
        "TEST1",
        "TEST2"
      ]
    }
  }
}

Lead: object

A lead is a potential buyer or seller of real estate.

uuid: string

The Ylopo unique identifier for use in lead PUT requests

email: string

The email address

phone: string

The phone number

crmId: string

The unique identifier in the CRM

crmUrl: string

The URL to access the lead in the CRM

crmCreatedAt: string

The date (ISO 8601 format) the lead was created in the CRM

deleted: boolean

A flag to indicate that the lead has been deleted in the CRM

source: string

The source or name of the service where the lead originated

leadType: string BUYER, SELLER, REFINANCE

The type of lead

status: string

The status in the CRM

firstName: string

The first name

middleName: string

The middle name

lastName: string

The last name

tags: string[]

The tags applied to the lead

string
assignments: object[]

The agents assigned to this lead, type as well as any of name, crmId, email, or phone are required

object
type: string realtor, lender

The type of assignment

name: string

The name of the assigned agent

crmId: string

The crmId of the assigned agent

email: string

The email of the assigned agent

phone: string

The phone number of the assigned agent

additionalData: object

A flexible value store for any additional lead data you want to send. Must be a single-level object with each individual item being either a primitive or an Array of primitives.

foo: string
bar: string[]
string
Example
{
  "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9",
  "email": "johnsmith@ylopo.com",
  "phone": "5555555555",
  "crmId": "1",
  "crmUrl": "https://some-crm-url.com/1",
  "crmCreatedAt": "2017-04-14T18:31:19.000Z",
  "deleted": false,
  "source": "Google",
  "leadType": "BUYER",
  "status": "New",
  "firstName": "John",
  "middleName": "Jacob",
  "lastName": "Smith",
  "tags": [
    "HOT"
  ],
  "assignments": [
    {
      "type": "realtor",
      "name": "Bob Realtor",
      "crmId": "1234",
      "email": "bobrealtor@ylopo.com",
      "phone": "555-555-5555"
    }
  ],
  "additionalData": {
    "someString": "TEST",
    "someCount": 5,
    "someArray": [
      "TEST1",
      "TEST2"
    ]
  }
}

SearchAlert: object

Only applicable for POST requests when creating new leads. If included, an initial search alert will be set up to regularly send the given lead email updates for new and updated listings that match the given criteria. This criteria will automatically be adjusted with more appropriate parameters based on the the lead's engagement.

locations: object[]

The inclusive locations to use for the search alert. There can be multiple, but least one is required.

object
city: string

A city to use for the search alert. If provided, state is also required.

county: string

A county to use for the search alert. If provided, state is also required.

state: string

A state to use for the search alert. If provided, state or county is also required.

postalCode: string

A postal code to use for the search alert, can be provided alongside or instead of city and state.

minPrice: integer

The minimum price to use for the search alert

maxPrice: integer

The maximum price to use for the search alert

bathrooms: integer

The minimum number of bathrooms to use for the search alert

bedrooms: integer

The minimum number of bedrooms to use for the search alert

Example
{
  "locations": [
    {
      "city": "Venice",
      "state": "CA"
    },
    {
      "county": "Los Angeles",
      "state": "CA"
    },
    {
      "postalCode": "90210"
    }
  ],
  "minPrice": 50000,
  "maxPrice": 500000,
  "bathrooms": 2,
  "bedrooms": 4
}

LeadAcceptedResponse: object

success: boolean
uuid: string
Example
{
  "success": true,
  "uuid": "3e0adfb9-ce2d-44d9-ad43-515dea9d22e9"
}

BadRequestResponse: object

success: boolean
error: boolean
message: string
Example
{
  "success": false,
  "error": true,
  "message": "X-Api-Key header is required"
}

NotFoundResponse: object

success: boolean
error: boolean
message: string
Example
{
  "success": false,
  "error": true,
  "message": "Not Found"
}