Create Lead
Creates a new lead.
Lead Assignment & Routing
Assignment priority:
- If
assignedUserIdis provided, the lead is directly assigned to the given agent. No routing rules are applied. - If
pondIdis provided, the lead is put into that lead pond (no agent assignee). No routing rules are applied. Use a pond ID returned byGET /v1.0/team-features/lead-ponds;pondIdcannot be combined withassignedUserIdorassignGroupId. If the lead is created but the pond move fails, the response still carriesleadIdplus amessage. - If neither is provided, the lead goes through automatic lead routing based on the configured routing rules.
Routing rule scope (when routing is triggered):
assignGroupId = -1→ Apply company-level routing rules.assignGroupId = <officeId>→ Apply routing rules for the specified office.assignGroupIdnot set → Default routing rules will be applied according to the lead’s ownership scope.
Routing location matching:
- For Seller (1) type leads, routing is determined by the
propertyfield (property address/location). - For all other lead types (Buyer, Renter, etc.), routing is determined by
inquiry.locations[](interested areas).
Lead Ownership
Controls the visibility scope of the lead:
ownershipScope = TEAM→ Account-wide: visible to all users in the Lofty client account.ownershipScope = OFFICE→ Visible to a specific office. Must provideownershipIdwith the office ID.ownershipScope = PERSONAL→ Visible only to the assigned agent. Must provideownershipIdwith the agent’s user ID.- If not specified, defaults to PERSONAL scope owned by the API caller.
Important:
ownershipScope = TEAMrefers to the entire client account (the organization), not the Lofty “Team add-on” product.
Eventual consistency
Persistence is asynchronous. The lead ID is returned immediately, but subsequent GET /v1.0/leads/{leadId} and similar read endpoints may briefly return 404 right after create. Subsequent writes (PUT, POST inquiry, POST property, POST transaction) are unaffected.
Property block
The optional property block is persisted together with the lead:
- Omit it entirely if you don’t need to attach an address — the lead is still created.
- If provided, at least one of
city,state,zipCode,streetAddressmust be non-blank; otherwise the request is rejected with 200057 PROPERTY_ADDRESS_EMPTY and no lead is created.
curl --request POST \
--url https://api.lofty.com/v1.0/leads \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"firstName": "Bob",
"cannotText": true,
"cannotCall": true,
"cannotEmail": true,
"lastName": "Li",
"emails": [
"jane.doe@example.com",
"jdoe-work@company.com"
],
"phones": [
"+14155551234",
"+12125559876"
],
"leadTypes": [
2,
5
],
"assignedUserId": 10000000514,
"streetAddress": "The White House,1600 Pennsylvania Avenue NW",
"city": "Washington DC",
"state": "Washington DC",
"zipCode": "20500",
"referredBy": "Jeremy Kelly",
"stage": "Pending",
"groups": [
"VIP Clients",
"Open House Feb"
],
"segments": [
"First-Time Buyers",
"Downtown Area"
],
"tags": [
"Hot Lead",
"Zillow"
],
"tagsAdd": [
"Referral",
"Pre-Approved"
],
"source": "Open House",
"inquiry": {
"priceMin": 1,
"priceMax": 10000000,
"propertyType": [
"Single Family Home",
"Condo"
],
"bedroomsMin": 1,
"bathroomsMin": "1",
"locations": [
{
"city": "Austin",
"stateCode": "TX"
}
],
"id": 123,
"leadUserId": 123,
"bedroomsMax": 123,
"bathroomsMax": "<string>",
"modifyByAgent": true,
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"defaultValue": true
},
"property": {
"price": 100000,
"state": "California",
"city": "New York",
"streetAddress": "22348 Regnart RD",
"zipCode": "25401",
"county": "<string>",
"propertyType": "Single Family Home",
"bedrooms": 3,
"bathrooms": 2,
"squareFeet": 100,
"lotSize": 26.33,
"parkingSpace": 1,
"floors": 1,
"mailAddress": true,
"id": 123,
"leadUserId": 123,
"listingId": "<string>",
"autoListingId": 123,
"label": "<string>",
"note": "<string>",
"listingStatus": "<string>",
"labelList": "<string>",
"pictureUrl": "<string>",
"siteListingUrl": "<string>",
"labelType": "<string>",
"priceMax": 10000000,
"priceMin": 100000
},
"unsubscription": true,
"welcomeEmail": true,
"leadAlert": true,
"customAttributeList": [
{
"attributeName": "<string>",
"attributeType": "number, text, date, anniversary_date, single_select, multi_select, percentage, currency",
"value": "<string>",
"params": "<string>"
}
],
"birthday": "Jun 5, 2001",
"leadRouting": true,
"assignGroupId": 123,
"buyingTimeFrame": "6-12",
"preQual": "Yes",
"houseToSell": "Yes",
"fthb": "Yes",
"withBuyerAgent": "Yes",
"sellingTimeFrame": "1-3",
"mortgage": "Yes",
"buyHouse": "Yes",
"withListingAgent": "Yes",
"leadFamilyMemberList": [
{
"firstName": "<string>",
"relationship": "<string>",
"lastName": "<string>",
"phones": [
"+14155551234"
],
"emails": [
"spouse@example.com"
],
"birthday": "<string>"
}
],
"language": "en",
"content": "example_note",
"isPin": false,
"ownershipId": 123,
"ownershipScope": "<string>",
"defaultInquiryParam": true,
"specifiedAssignGroupId": true,
"pondId": 12345
}
'import requests
url = "https://api.lofty.com/v1.0/leads"
payload = {
"firstName": "Bob",
"cannotText": True,
"cannotCall": True,
"cannotEmail": True,
"lastName": "Li",
"emails": ["jane.doe@example.com", "jdoe-work@company.com"],
"phones": ["+14155551234", "+12125559876"],
"leadTypes": [2, 5],
"assignedUserId": 10000000514,
"streetAddress": "The White House,1600 Pennsylvania Avenue NW",
"city": "Washington DC",
"state": "Washington DC",
"zipCode": "20500",
"referredBy": "Jeremy Kelly",
"stage": "Pending",
"groups": ["VIP Clients", "Open House Feb"],
"segments": ["First-Time Buyers", "Downtown Area"],
"tags": ["Hot Lead", "Zillow"],
"tagsAdd": ["Referral", "Pre-Approved"],
"source": "Open House",
"inquiry": {
"priceMin": 1,
"priceMax": 10000000,
"propertyType": ["Single Family Home", "Condo"],
"bedroomsMin": 1,
"bathroomsMin": "1",
"locations": [
{
"city": "Austin",
"stateCode": "TX"
}
],
"id": 123,
"leadUserId": 123,
"bedroomsMax": 123,
"bathroomsMax": "<string>",
"modifyByAgent": True,
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"defaultValue": True
},
"property": {
"price": 100000,
"state": "California",
"city": "New York",
"streetAddress": "22348 Regnart RD",
"zipCode": "25401",
"county": "<string>",
"propertyType": "Single Family Home",
"bedrooms": 3,
"bathrooms": 2,
"squareFeet": 100,
"lotSize": 26.33,
"parkingSpace": 1,
"floors": 1,
"mailAddress": True,
"id": 123,
"leadUserId": 123,
"listingId": "<string>",
"autoListingId": 123,
"label": "<string>",
"note": "<string>",
"listingStatus": "<string>",
"labelList": "<string>",
"pictureUrl": "<string>",
"siteListingUrl": "<string>",
"labelType": "<string>",
"priceMax": 10000000,
"priceMin": 100000
},
"unsubscription": True,
"welcomeEmail": True,
"leadAlert": True,
"customAttributeList": [
{
"attributeName": "<string>",
"attributeType": "number, text, date, anniversary_date, single_select, multi_select, percentage, currency",
"value": "<string>",
"params": "<string>"
}
],
"birthday": "Jun 5, 2001",
"leadRouting": True,
"assignGroupId": 123,
"buyingTimeFrame": "6-12",
"preQual": "Yes",
"houseToSell": "Yes",
"fthb": "Yes",
"withBuyerAgent": "Yes",
"sellingTimeFrame": "1-3",
"mortgage": "Yes",
"buyHouse": "Yes",
"withListingAgent": "Yes",
"leadFamilyMemberList": [
{
"firstName": "<string>",
"relationship": "<string>",
"lastName": "<string>",
"phones": ["+14155551234"],
"emails": ["spouse@example.com"],
"birthday": "<string>"
}
],
"language": "en",
"content": "example_note",
"isPin": False,
"ownershipId": 123,
"ownershipScope": "<string>",
"defaultInquiryParam": True,
"specifiedAssignGroupId": True,
"pondId": 12345
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
firstName: 'Bob',
cannotText: true,
cannotCall: true,
cannotEmail: true,
lastName: 'Li',
emails: ['jane.doe@example.com', 'jdoe-work@company.com'],
phones: ['+14155551234', '+12125559876'],
leadTypes: [2, 5],
assignedUserId: 10000000514,
streetAddress: 'The White House,1600 Pennsylvania Avenue NW',
city: 'Washington DC',
state: 'Washington DC',
zipCode: '20500',
referredBy: 'Jeremy Kelly',
stage: 'Pending',
groups: ['VIP Clients', 'Open House Feb'],
segments: ['First-Time Buyers', 'Downtown Area'],
tags: ['Hot Lead', 'Zillow'],
tagsAdd: ['Referral', 'Pre-Approved'],
source: 'Open House',
inquiry: {
priceMin: 1,
priceMax: 10000000,
propertyType: ['Single Family Home', 'Condo'],
bedroomsMin: 1,
bathroomsMin: '1',
locations: [{city: 'Austin', stateCode: 'TX'}],
id: 123,
leadUserId: 123,
bedroomsMax: 123,
bathroomsMax: '<string>',
modifyByAgent: true,
createTime: '2023-11-07T05:31:56Z',
updateTime: '2023-11-07T05:31:56Z',
defaultValue: true
},
property: {
price: 100000,
state: 'California',
city: 'New York',
streetAddress: '22348 Regnart RD',
zipCode: '25401',
county: '<string>',
propertyType: 'Single Family Home',
bedrooms: 3,
bathrooms: 2,
squareFeet: 100,
lotSize: 26.33,
parkingSpace: 1,
floors: 1,
mailAddress: true,
id: 123,
leadUserId: 123,
listingId: '<string>',
autoListingId: 123,
label: '<string>',
note: '<string>',
listingStatus: '<string>',
labelList: '<string>',
pictureUrl: '<string>',
siteListingUrl: '<string>',
labelType: '<string>',
priceMax: 10000000,
priceMin: 100000
},
unsubscription: true,
welcomeEmail: true,
leadAlert: true,
customAttributeList: [
{
attributeName: '<string>',
attributeType: 'number, text, date, anniversary_date, single_select, multi_select, percentage, currency',
value: '<string>',
params: '<string>'
}
],
birthday: 'Jun 5, 2001',
leadRouting: true,
assignGroupId: 123,
buyingTimeFrame: '6-12',
preQual: 'Yes',
houseToSell: 'Yes',
fthb: 'Yes',
withBuyerAgent: 'Yes',
sellingTimeFrame: '1-3',
mortgage: 'Yes',
buyHouse: 'Yes',
withListingAgent: 'Yes',
leadFamilyMemberList: [
{
firstName: '<string>',
relationship: '<string>',
lastName: '<string>',
phones: ['+14155551234'],
emails: ['spouse@example.com'],
birthday: '<string>'
}
],
language: 'en',
content: 'example_note',
isPin: false,
ownershipId: 123,
ownershipScope: '<string>',
defaultInquiryParam: true,
specifiedAssignGroupId: true,
pondId: 12345
})
};
fetch('https://api.lofty.com/v1.0/leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lofty.com/v1.0/leads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => 'Bob',
'cannotText' => true,
'cannotCall' => true,
'cannotEmail' => true,
'lastName' => 'Li',
'emails' => [
'jane.doe@example.com',
'jdoe-work@company.com'
],
'phones' => [
'+14155551234',
'+12125559876'
],
'leadTypes' => [
2,
5
],
'assignedUserId' => 10000000514,
'streetAddress' => 'The White House,1600 Pennsylvania Avenue NW',
'city' => 'Washington DC',
'state' => 'Washington DC',
'zipCode' => '20500',
'referredBy' => 'Jeremy Kelly',
'stage' => 'Pending',
'groups' => [
'VIP Clients',
'Open House Feb'
],
'segments' => [
'First-Time Buyers',
'Downtown Area'
],
'tags' => [
'Hot Lead',
'Zillow'
],
'tagsAdd' => [
'Referral',
'Pre-Approved'
],
'source' => 'Open House',
'inquiry' => [
'priceMin' => 1,
'priceMax' => 10000000,
'propertyType' => [
'Single Family Home',
'Condo'
],
'bedroomsMin' => 1,
'bathroomsMin' => '1',
'locations' => [
[
'city' => 'Austin',
'stateCode' => 'TX'
]
],
'id' => 123,
'leadUserId' => 123,
'bedroomsMax' => 123,
'bathroomsMax' => '<string>',
'modifyByAgent' => true,
'createTime' => '2023-11-07T05:31:56Z',
'updateTime' => '2023-11-07T05:31:56Z',
'defaultValue' => true
],
'property' => [
'price' => 100000,
'state' => 'California',
'city' => 'New York',
'streetAddress' => '22348 Regnart RD',
'zipCode' => '25401',
'county' => '<string>',
'propertyType' => 'Single Family Home',
'bedrooms' => 3,
'bathrooms' => 2,
'squareFeet' => 100,
'lotSize' => 26.33,
'parkingSpace' => 1,
'floors' => 1,
'mailAddress' => true,
'id' => 123,
'leadUserId' => 123,
'listingId' => '<string>',
'autoListingId' => 123,
'label' => '<string>',
'note' => '<string>',
'listingStatus' => '<string>',
'labelList' => '<string>',
'pictureUrl' => '<string>',
'siteListingUrl' => '<string>',
'labelType' => '<string>',
'priceMax' => 10000000,
'priceMin' => 100000
],
'unsubscription' => true,
'welcomeEmail' => true,
'leadAlert' => true,
'customAttributeList' => [
[
'attributeName' => '<string>',
'attributeType' => 'number, text, date, anniversary_date, single_select, multi_select, percentage, currency',
'value' => '<string>',
'params' => '<string>'
]
],
'birthday' => 'Jun 5, 2001',
'leadRouting' => true,
'assignGroupId' => 123,
'buyingTimeFrame' => '6-12',
'preQual' => 'Yes',
'houseToSell' => 'Yes',
'fthb' => 'Yes',
'withBuyerAgent' => 'Yes',
'sellingTimeFrame' => '1-3',
'mortgage' => 'Yes',
'buyHouse' => 'Yes',
'withListingAgent' => 'Yes',
'leadFamilyMemberList' => [
[
'firstName' => '<string>',
'relationship' => '<string>',
'lastName' => '<string>',
'phones' => [
'+14155551234'
],
'emails' => [
'spouse@example.com'
],
'birthday' => '<string>'
]
],
'language' => 'en',
'content' => 'example_note',
'isPin' => false,
'ownershipId' => 123,
'ownershipScope' => '<string>',
'defaultInquiryParam' => true,
'specifiedAssignGroupId' => true,
'pondId' => 12345
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lofty.com/v1.0/leads"
payload := strings.NewReader("{\n \"firstName\": \"Bob\",\n \"cannotText\": true,\n \"cannotCall\": true,\n \"cannotEmail\": true,\n \"lastName\": \"Li\",\n \"emails\": [\n \"jane.doe@example.com\",\n \"jdoe-work@company.com\"\n ],\n \"phones\": [\n \"+14155551234\",\n \"+12125559876\"\n ],\n \"leadTypes\": [\n 2,\n 5\n ],\n \"assignedUserId\": 10000000514,\n \"streetAddress\": \"The White House,1600 Pennsylvania Avenue NW\",\n \"city\": \"Washington DC\",\n \"state\": \"Washington DC\",\n \"zipCode\": \"20500\",\n \"referredBy\": \"Jeremy Kelly\",\n \"stage\": \"Pending\",\n \"groups\": [\n \"VIP Clients\",\n \"Open House Feb\"\n ],\n \"segments\": [\n \"First-Time Buyers\",\n \"Downtown Area\"\n ],\n \"tags\": [\n \"Hot Lead\",\n \"Zillow\"\n ],\n \"tagsAdd\": [\n \"Referral\",\n \"Pre-Approved\"\n ],\n \"source\": \"Open House\",\n \"inquiry\": {\n \"priceMin\": 1,\n \"priceMax\": 10000000,\n \"propertyType\": [\n \"Single Family Home\",\n \"Condo\"\n ],\n \"bedroomsMin\": 1,\n \"bathroomsMin\": \"1\",\n \"locations\": [\n {\n \"city\": \"Austin\",\n \"stateCode\": \"TX\"\n }\n ],\n \"id\": 123,\n \"leadUserId\": 123,\n \"bedroomsMax\": 123,\n \"bathroomsMax\": \"<string>\",\n \"modifyByAgent\": true,\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"defaultValue\": true\n },\n \"property\": {\n \"price\": 100000,\n \"state\": \"California\",\n \"city\": \"New York\",\n \"streetAddress\": \"22348 Regnart RD\",\n \"zipCode\": \"25401\",\n \"county\": \"<string>\",\n \"propertyType\": \"Single Family Home\",\n \"bedrooms\": 3,\n \"bathrooms\": 2,\n \"squareFeet\": 100,\n \"lotSize\": 26.33,\n \"parkingSpace\": 1,\n \"floors\": 1,\n \"mailAddress\": true,\n \"id\": 123,\n \"leadUserId\": 123,\n \"listingId\": \"<string>\",\n \"autoListingId\": 123,\n \"label\": \"<string>\",\n \"note\": \"<string>\",\n \"listingStatus\": \"<string>\",\n \"labelList\": \"<string>\",\n \"pictureUrl\": \"<string>\",\n \"siteListingUrl\": \"<string>\",\n \"labelType\": \"<string>\",\n \"priceMax\": 10000000,\n \"priceMin\": 100000\n },\n \"unsubscription\": true,\n \"welcomeEmail\": true,\n \"leadAlert\": true,\n \"customAttributeList\": [\n {\n \"attributeName\": \"<string>\",\n \"attributeType\": \"number, text, date, anniversary_date, single_select, multi_select, percentage, currency\",\n \"value\": \"<string>\",\n \"params\": \"<string>\"\n }\n ],\n \"birthday\": \"Jun 5, 2001\",\n \"leadRouting\": true,\n \"assignGroupId\": 123,\n \"buyingTimeFrame\": \"6-12\",\n \"preQual\": \"Yes\",\n \"houseToSell\": \"Yes\",\n \"fthb\": \"Yes\",\n \"withBuyerAgent\": \"Yes\",\n \"sellingTimeFrame\": \"1-3\",\n \"mortgage\": \"Yes\",\n \"buyHouse\": \"Yes\",\n \"withListingAgent\": \"Yes\",\n \"leadFamilyMemberList\": [\n {\n \"firstName\": \"<string>\",\n \"relationship\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phones\": [\n \"+14155551234\"\n ],\n \"emails\": [\n \"spouse@example.com\"\n ],\n \"birthday\": \"<string>\"\n }\n ],\n \"language\": \"en\",\n \"content\": \"example_note\",\n \"isPin\": false,\n \"ownershipId\": 123,\n \"ownershipScope\": \"<string>\",\n \"defaultInquiryParam\": true,\n \"specifiedAssignGroupId\": true,\n \"pondId\": 12345\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.lofty.com/v1.0/leads")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"firstName\": \"Bob\",\n \"cannotText\": true,\n \"cannotCall\": true,\n \"cannotEmail\": true,\n \"lastName\": \"Li\",\n \"emails\": [\n \"jane.doe@example.com\",\n \"jdoe-work@company.com\"\n ],\n \"phones\": [\n \"+14155551234\",\n \"+12125559876\"\n ],\n \"leadTypes\": [\n 2,\n 5\n ],\n \"assignedUserId\": 10000000514,\n \"streetAddress\": \"The White House,1600 Pennsylvania Avenue NW\",\n \"city\": \"Washington DC\",\n \"state\": \"Washington DC\",\n \"zipCode\": \"20500\",\n \"referredBy\": \"Jeremy Kelly\",\n \"stage\": \"Pending\",\n \"groups\": [\n \"VIP Clients\",\n \"Open House Feb\"\n ],\n \"segments\": [\n \"First-Time Buyers\",\n \"Downtown Area\"\n ],\n \"tags\": [\n \"Hot Lead\",\n \"Zillow\"\n ],\n \"tagsAdd\": [\n \"Referral\",\n \"Pre-Approved\"\n ],\n \"source\": \"Open House\",\n \"inquiry\": {\n \"priceMin\": 1,\n \"priceMax\": 10000000,\n \"propertyType\": [\n \"Single Family Home\",\n \"Condo\"\n ],\n \"bedroomsMin\": 1,\n \"bathroomsMin\": \"1\",\n \"locations\": [\n {\n \"city\": \"Austin\",\n \"stateCode\": \"TX\"\n }\n ],\n \"id\": 123,\n \"leadUserId\": 123,\n \"bedroomsMax\": 123,\n \"bathroomsMax\": \"<string>\",\n \"modifyByAgent\": true,\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"defaultValue\": true\n },\n \"property\": {\n \"price\": 100000,\n \"state\": \"California\",\n \"city\": \"New York\",\n \"streetAddress\": \"22348 Regnart RD\",\n \"zipCode\": \"25401\",\n \"county\": \"<string>\",\n \"propertyType\": \"Single Family Home\",\n \"bedrooms\": 3,\n \"bathrooms\": 2,\n \"squareFeet\": 100,\n \"lotSize\": 26.33,\n \"parkingSpace\": 1,\n \"floors\": 1,\n \"mailAddress\": true,\n \"id\": 123,\n \"leadUserId\": 123,\n \"listingId\": \"<string>\",\n \"autoListingId\": 123,\n \"label\": \"<string>\",\n \"note\": \"<string>\",\n \"listingStatus\": \"<string>\",\n \"labelList\": \"<string>\",\n \"pictureUrl\": \"<string>\",\n \"siteListingUrl\": \"<string>\",\n \"labelType\": \"<string>\",\n \"priceMax\": 10000000,\n \"priceMin\": 100000\n },\n \"unsubscription\": true,\n \"welcomeEmail\": true,\n \"leadAlert\": true,\n \"customAttributeList\": [\n {\n \"attributeName\": \"<string>\",\n \"attributeType\": \"number, text, date, anniversary_date, single_select, multi_select, percentage, currency\",\n \"value\": \"<string>\",\n \"params\": \"<string>\"\n }\n ],\n \"birthday\": \"Jun 5, 2001\",\n \"leadRouting\": true,\n \"assignGroupId\": 123,\n \"buyingTimeFrame\": \"6-12\",\n \"preQual\": \"Yes\",\n \"houseToSell\": \"Yes\",\n \"fthb\": \"Yes\",\n \"withBuyerAgent\": \"Yes\",\n \"sellingTimeFrame\": \"1-3\",\n \"mortgage\": \"Yes\",\n \"buyHouse\": \"Yes\",\n \"withListingAgent\": \"Yes\",\n \"leadFamilyMemberList\": [\n {\n \"firstName\": \"<string>\",\n \"relationship\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phones\": [\n \"+14155551234\"\n ],\n \"emails\": [\n \"spouse@example.com\"\n ],\n \"birthday\": \"<string>\"\n }\n ],\n \"language\": \"en\",\n \"content\": \"example_note\",\n \"isPin\": false,\n \"ownershipId\": 123,\n \"ownershipScope\": \"<string>\",\n \"defaultInquiryParam\": true,\n \"specifiedAssignGroupId\": true,\n \"pondId\": 12345\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"firstName\": \"Bob\",\n \"cannotText\": true,\n \"cannotCall\": true,\n \"cannotEmail\": true,\n \"lastName\": \"Li\",\n \"emails\": [\n \"jane.doe@example.com\",\n \"jdoe-work@company.com\"\n ],\n \"phones\": [\n \"+14155551234\",\n \"+12125559876\"\n ],\n \"leadTypes\": [\n 2,\n 5\n ],\n \"assignedUserId\": 10000000514,\n \"streetAddress\": \"The White House,1600 Pennsylvania Avenue NW\",\n \"city\": \"Washington DC\",\n \"state\": \"Washington DC\",\n \"zipCode\": \"20500\",\n \"referredBy\": \"Jeremy Kelly\",\n \"stage\": \"Pending\",\n \"groups\": [\n \"VIP Clients\",\n \"Open House Feb\"\n ],\n \"segments\": [\n \"First-Time Buyers\",\n \"Downtown Area\"\n ],\n \"tags\": [\n \"Hot Lead\",\n \"Zillow\"\n ],\n \"tagsAdd\": [\n \"Referral\",\n \"Pre-Approved\"\n ],\n \"source\": \"Open House\",\n \"inquiry\": {\n \"priceMin\": 1,\n \"priceMax\": 10000000,\n \"propertyType\": [\n \"Single Family Home\",\n \"Condo\"\n ],\n \"bedroomsMin\": 1,\n \"bathroomsMin\": \"1\",\n \"locations\": [\n {\n \"city\": \"Austin\",\n \"stateCode\": \"TX\"\n }\n ],\n \"id\": 123,\n \"leadUserId\": 123,\n \"bedroomsMax\": 123,\n \"bathroomsMax\": \"<string>\",\n \"modifyByAgent\": true,\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"defaultValue\": true\n },\n \"property\": {\n \"price\": 100000,\n \"state\": \"California\",\n \"city\": \"New York\",\n \"streetAddress\": \"22348 Regnart RD\",\n \"zipCode\": \"25401\",\n \"county\": \"<string>\",\n \"propertyType\": \"Single Family Home\",\n \"bedrooms\": 3,\n \"bathrooms\": 2,\n \"squareFeet\": 100,\n \"lotSize\": 26.33,\n \"parkingSpace\": 1,\n \"floors\": 1,\n \"mailAddress\": true,\n \"id\": 123,\n \"leadUserId\": 123,\n \"listingId\": \"<string>\",\n \"autoListingId\": 123,\n \"label\": \"<string>\",\n \"note\": \"<string>\",\n \"listingStatus\": \"<string>\",\n \"labelList\": \"<string>\",\n \"pictureUrl\": \"<string>\",\n \"siteListingUrl\": \"<string>\",\n \"labelType\": \"<string>\",\n \"priceMax\": 10000000,\n \"priceMin\": 100000\n },\n \"unsubscription\": true,\n \"welcomeEmail\": true,\n \"leadAlert\": true,\n \"customAttributeList\": [\n {\n \"attributeName\": \"<string>\",\n \"attributeType\": \"number, text, date, anniversary_date, single_select, multi_select, percentage, currency\",\n \"value\": \"<string>\",\n \"params\": \"<string>\"\n }\n ],\n \"birthday\": \"Jun 5, 2001\",\n \"leadRouting\": true,\n \"assignGroupId\": 123,\n \"buyingTimeFrame\": \"6-12\",\n \"preQual\": \"Yes\",\n \"houseToSell\": \"Yes\",\n \"fthb\": \"Yes\",\n \"withBuyerAgent\": \"Yes\",\n \"sellingTimeFrame\": \"1-3\",\n \"mortgage\": \"Yes\",\n \"buyHouse\": \"Yes\",\n \"withListingAgent\": \"Yes\",\n \"leadFamilyMemberList\": [\n {\n \"firstName\": \"<string>\",\n \"relationship\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phones\": [\n \"+14155551234\"\n ],\n \"emails\": [\n \"spouse@example.com\"\n ],\n \"birthday\": \"<string>\"\n }\n ],\n \"language\": \"en\",\n \"content\": \"example_note\",\n \"isPin\": false,\n \"ownershipId\": 123,\n \"ownershipScope\": \"<string>\",\n \"defaultInquiryParam\": true,\n \"specifiedAssignGroupId\": true,\n \"pondId\": 12345\n}"
response = http.request(request)
puts response.read_body{
"leadId": 651095960136641
}"<string>""<string>""<string>"firstName, lastName, groups, segments are truncated to 30 characters; tags / tagsAdd to 64 characters. The API returns success with no error. Validate input length before sending.Body
Lead info that needs to be added in
Specifies which routing rule scope to apply when automatic lead routing is triggered (i.e., assignedUserId is not provided). Set to -1 to use company-level routing rules. Set to a specific office ID to use that office's routing rules. If omitted, default routing rules will be applied according to the lead’s ownership scope.
Controls the visibility scope of the lead. TEAM — Account-wide: visible to all users in this Lofty client account. OFFICE — visible only within the specified office (requires ownershipId). PERSONAL — visible only to the specified agent (requires ownershipId). Defaults to PERSONAL scope owned by the API caller if not specified. Note: ownershipScope = TEAM refers to the entire client account (the organization), not the Lofty "Team add-on" product.
curl --request POST \
--url https://api.lofty.com/v1.0/leads \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"firstName": "Bob",
"cannotText": true,
"cannotCall": true,
"cannotEmail": true,
"lastName": "Li",
"emails": [
"jane.doe@example.com",
"jdoe-work@company.com"
],
"phones": [
"+14155551234",
"+12125559876"
],
"leadTypes": [
2,
5
],
"assignedUserId": 10000000514,
"streetAddress": "The White House,1600 Pennsylvania Avenue NW",
"city": "Washington DC",
"state": "Washington DC",
"zipCode": "20500",
"referredBy": "Jeremy Kelly",
"stage": "Pending",
"groups": [
"VIP Clients",
"Open House Feb"
],
"segments": [
"First-Time Buyers",
"Downtown Area"
],
"tags": [
"Hot Lead",
"Zillow"
],
"tagsAdd": [
"Referral",
"Pre-Approved"
],
"source": "Open House",
"inquiry": {
"priceMin": 1,
"priceMax": 10000000,
"propertyType": [
"Single Family Home",
"Condo"
],
"bedroomsMin": 1,
"bathroomsMin": "1",
"locations": [
{
"city": "Austin",
"stateCode": "TX"
}
],
"id": 123,
"leadUserId": 123,
"bedroomsMax": 123,
"bathroomsMax": "<string>",
"modifyByAgent": true,
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"defaultValue": true
},
"property": {
"price": 100000,
"state": "California",
"city": "New York",
"streetAddress": "22348 Regnart RD",
"zipCode": "25401",
"county": "<string>",
"propertyType": "Single Family Home",
"bedrooms": 3,
"bathrooms": 2,
"squareFeet": 100,
"lotSize": 26.33,
"parkingSpace": 1,
"floors": 1,
"mailAddress": true,
"id": 123,
"leadUserId": 123,
"listingId": "<string>",
"autoListingId": 123,
"label": "<string>",
"note": "<string>",
"listingStatus": "<string>",
"labelList": "<string>",
"pictureUrl": "<string>",
"siteListingUrl": "<string>",
"labelType": "<string>",
"priceMax": 10000000,
"priceMin": 100000
},
"unsubscription": true,
"welcomeEmail": true,
"leadAlert": true,
"customAttributeList": [
{
"attributeName": "<string>",
"attributeType": "number, text, date, anniversary_date, single_select, multi_select, percentage, currency",
"value": "<string>",
"params": "<string>"
}
],
"birthday": "Jun 5, 2001",
"leadRouting": true,
"assignGroupId": 123,
"buyingTimeFrame": "6-12",
"preQual": "Yes",
"houseToSell": "Yes",
"fthb": "Yes",
"withBuyerAgent": "Yes",
"sellingTimeFrame": "1-3",
"mortgage": "Yes",
"buyHouse": "Yes",
"withListingAgent": "Yes",
"leadFamilyMemberList": [
{
"firstName": "<string>",
"relationship": "<string>",
"lastName": "<string>",
"phones": [
"+14155551234"
],
"emails": [
"spouse@example.com"
],
"birthday": "<string>"
}
],
"language": "en",
"content": "example_note",
"isPin": false,
"ownershipId": 123,
"ownershipScope": "<string>",
"defaultInquiryParam": true,
"specifiedAssignGroupId": true,
"pondId": 12345
}
'import requests
url = "https://api.lofty.com/v1.0/leads"
payload = {
"firstName": "Bob",
"cannotText": True,
"cannotCall": True,
"cannotEmail": True,
"lastName": "Li",
"emails": ["jane.doe@example.com", "jdoe-work@company.com"],
"phones": ["+14155551234", "+12125559876"],
"leadTypes": [2, 5],
"assignedUserId": 10000000514,
"streetAddress": "The White House,1600 Pennsylvania Avenue NW",
"city": "Washington DC",
"state": "Washington DC",
"zipCode": "20500",
"referredBy": "Jeremy Kelly",
"stage": "Pending",
"groups": ["VIP Clients", "Open House Feb"],
"segments": ["First-Time Buyers", "Downtown Area"],
"tags": ["Hot Lead", "Zillow"],
"tagsAdd": ["Referral", "Pre-Approved"],
"source": "Open House",
"inquiry": {
"priceMin": 1,
"priceMax": 10000000,
"propertyType": ["Single Family Home", "Condo"],
"bedroomsMin": 1,
"bathroomsMin": "1",
"locations": [
{
"city": "Austin",
"stateCode": "TX"
}
],
"id": 123,
"leadUserId": 123,
"bedroomsMax": 123,
"bathroomsMax": "<string>",
"modifyByAgent": True,
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"defaultValue": True
},
"property": {
"price": 100000,
"state": "California",
"city": "New York",
"streetAddress": "22348 Regnart RD",
"zipCode": "25401",
"county": "<string>",
"propertyType": "Single Family Home",
"bedrooms": 3,
"bathrooms": 2,
"squareFeet": 100,
"lotSize": 26.33,
"parkingSpace": 1,
"floors": 1,
"mailAddress": True,
"id": 123,
"leadUserId": 123,
"listingId": "<string>",
"autoListingId": 123,
"label": "<string>",
"note": "<string>",
"listingStatus": "<string>",
"labelList": "<string>",
"pictureUrl": "<string>",
"siteListingUrl": "<string>",
"labelType": "<string>",
"priceMax": 10000000,
"priceMin": 100000
},
"unsubscription": True,
"welcomeEmail": True,
"leadAlert": True,
"customAttributeList": [
{
"attributeName": "<string>",
"attributeType": "number, text, date, anniversary_date, single_select, multi_select, percentage, currency",
"value": "<string>",
"params": "<string>"
}
],
"birthday": "Jun 5, 2001",
"leadRouting": True,
"assignGroupId": 123,
"buyingTimeFrame": "6-12",
"preQual": "Yes",
"houseToSell": "Yes",
"fthb": "Yes",
"withBuyerAgent": "Yes",
"sellingTimeFrame": "1-3",
"mortgage": "Yes",
"buyHouse": "Yes",
"withListingAgent": "Yes",
"leadFamilyMemberList": [
{
"firstName": "<string>",
"relationship": "<string>",
"lastName": "<string>",
"phones": ["+14155551234"],
"emails": ["spouse@example.com"],
"birthday": "<string>"
}
],
"language": "en",
"content": "example_note",
"isPin": False,
"ownershipId": 123,
"ownershipScope": "<string>",
"defaultInquiryParam": True,
"specifiedAssignGroupId": True,
"pondId": 12345
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
firstName: 'Bob',
cannotText: true,
cannotCall: true,
cannotEmail: true,
lastName: 'Li',
emails: ['jane.doe@example.com', 'jdoe-work@company.com'],
phones: ['+14155551234', '+12125559876'],
leadTypes: [2, 5],
assignedUserId: 10000000514,
streetAddress: 'The White House,1600 Pennsylvania Avenue NW',
city: 'Washington DC',
state: 'Washington DC',
zipCode: '20500',
referredBy: 'Jeremy Kelly',
stage: 'Pending',
groups: ['VIP Clients', 'Open House Feb'],
segments: ['First-Time Buyers', 'Downtown Area'],
tags: ['Hot Lead', 'Zillow'],
tagsAdd: ['Referral', 'Pre-Approved'],
source: 'Open House',
inquiry: {
priceMin: 1,
priceMax: 10000000,
propertyType: ['Single Family Home', 'Condo'],
bedroomsMin: 1,
bathroomsMin: '1',
locations: [{city: 'Austin', stateCode: 'TX'}],
id: 123,
leadUserId: 123,
bedroomsMax: 123,
bathroomsMax: '<string>',
modifyByAgent: true,
createTime: '2023-11-07T05:31:56Z',
updateTime: '2023-11-07T05:31:56Z',
defaultValue: true
},
property: {
price: 100000,
state: 'California',
city: 'New York',
streetAddress: '22348 Regnart RD',
zipCode: '25401',
county: '<string>',
propertyType: 'Single Family Home',
bedrooms: 3,
bathrooms: 2,
squareFeet: 100,
lotSize: 26.33,
parkingSpace: 1,
floors: 1,
mailAddress: true,
id: 123,
leadUserId: 123,
listingId: '<string>',
autoListingId: 123,
label: '<string>',
note: '<string>',
listingStatus: '<string>',
labelList: '<string>',
pictureUrl: '<string>',
siteListingUrl: '<string>',
labelType: '<string>',
priceMax: 10000000,
priceMin: 100000
},
unsubscription: true,
welcomeEmail: true,
leadAlert: true,
customAttributeList: [
{
attributeName: '<string>',
attributeType: 'number, text, date, anniversary_date, single_select, multi_select, percentage, currency',
value: '<string>',
params: '<string>'
}
],
birthday: 'Jun 5, 2001',
leadRouting: true,
assignGroupId: 123,
buyingTimeFrame: '6-12',
preQual: 'Yes',
houseToSell: 'Yes',
fthb: 'Yes',
withBuyerAgent: 'Yes',
sellingTimeFrame: '1-3',
mortgage: 'Yes',
buyHouse: 'Yes',
withListingAgent: 'Yes',
leadFamilyMemberList: [
{
firstName: '<string>',
relationship: '<string>',
lastName: '<string>',
phones: ['+14155551234'],
emails: ['spouse@example.com'],
birthday: '<string>'
}
],
language: 'en',
content: 'example_note',
isPin: false,
ownershipId: 123,
ownershipScope: '<string>',
defaultInquiryParam: true,
specifiedAssignGroupId: true,
pondId: 12345
})
};
fetch('https://api.lofty.com/v1.0/leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lofty.com/v1.0/leads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => 'Bob',
'cannotText' => true,
'cannotCall' => true,
'cannotEmail' => true,
'lastName' => 'Li',
'emails' => [
'jane.doe@example.com',
'jdoe-work@company.com'
],
'phones' => [
'+14155551234',
'+12125559876'
],
'leadTypes' => [
2,
5
],
'assignedUserId' => 10000000514,
'streetAddress' => 'The White House,1600 Pennsylvania Avenue NW',
'city' => 'Washington DC',
'state' => 'Washington DC',
'zipCode' => '20500',
'referredBy' => 'Jeremy Kelly',
'stage' => 'Pending',
'groups' => [
'VIP Clients',
'Open House Feb'
],
'segments' => [
'First-Time Buyers',
'Downtown Area'
],
'tags' => [
'Hot Lead',
'Zillow'
],
'tagsAdd' => [
'Referral',
'Pre-Approved'
],
'source' => 'Open House',
'inquiry' => [
'priceMin' => 1,
'priceMax' => 10000000,
'propertyType' => [
'Single Family Home',
'Condo'
],
'bedroomsMin' => 1,
'bathroomsMin' => '1',
'locations' => [
[
'city' => 'Austin',
'stateCode' => 'TX'
]
],
'id' => 123,
'leadUserId' => 123,
'bedroomsMax' => 123,
'bathroomsMax' => '<string>',
'modifyByAgent' => true,
'createTime' => '2023-11-07T05:31:56Z',
'updateTime' => '2023-11-07T05:31:56Z',
'defaultValue' => true
],
'property' => [
'price' => 100000,
'state' => 'California',
'city' => 'New York',
'streetAddress' => '22348 Regnart RD',
'zipCode' => '25401',
'county' => '<string>',
'propertyType' => 'Single Family Home',
'bedrooms' => 3,
'bathrooms' => 2,
'squareFeet' => 100,
'lotSize' => 26.33,
'parkingSpace' => 1,
'floors' => 1,
'mailAddress' => true,
'id' => 123,
'leadUserId' => 123,
'listingId' => '<string>',
'autoListingId' => 123,
'label' => '<string>',
'note' => '<string>',
'listingStatus' => '<string>',
'labelList' => '<string>',
'pictureUrl' => '<string>',
'siteListingUrl' => '<string>',
'labelType' => '<string>',
'priceMax' => 10000000,
'priceMin' => 100000
],
'unsubscription' => true,
'welcomeEmail' => true,
'leadAlert' => true,
'customAttributeList' => [
[
'attributeName' => '<string>',
'attributeType' => 'number, text, date, anniversary_date, single_select, multi_select, percentage, currency',
'value' => '<string>',
'params' => '<string>'
]
],
'birthday' => 'Jun 5, 2001',
'leadRouting' => true,
'assignGroupId' => 123,
'buyingTimeFrame' => '6-12',
'preQual' => 'Yes',
'houseToSell' => 'Yes',
'fthb' => 'Yes',
'withBuyerAgent' => 'Yes',
'sellingTimeFrame' => '1-3',
'mortgage' => 'Yes',
'buyHouse' => 'Yes',
'withListingAgent' => 'Yes',
'leadFamilyMemberList' => [
[
'firstName' => '<string>',
'relationship' => '<string>',
'lastName' => '<string>',
'phones' => [
'+14155551234'
],
'emails' => [
'spouse@example.com'
],
'birthday' => '<string>'
]
],
'language' => 'en',
'content' => 'example_note',
'isPin' => false,
'ownershipId' => 123,
'ownershipScope' => '<string>',
'defaultInquiryParam' => true,
'specifiedAssignGroupId' => true,
'pondId' => 12345
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lofty.com/v1.0/leads"
payload := strings.NewReader("{\n \"firstName\": \"Bob\",\n \"cannotText\": true,\n \"cannotCall\": true,\n \"cannotEmail\": true,\n \"lastName\": \"Li\",\n \"emails\": [\n \"jane.doe@example.com\",\n \"jdoe-work@company.com\"\n ],\n \"phones\": [\n \"+14155551234\",\n \"+12125559876\"\n ],\n \"leadTypes\": [\n 2,\n 5\n ],\n \"assignedUserId\": 10000000514,\n \"streetAddress\": \"The White House,1600 Pennsylvania Avenue NW\",\n \"city\": \"Washington DC\",\n \"state\": \"Washington DC\",\n \"zipCode\": \"20500\",\n \"referredBy\": \"Jeremy Kelly\",\n \"stage\": \"Pending\",\n \"groups\": [\n \"VIP Clients\",\n \"Open House Feb\"\n ],\n \"segments\": [\n \"First-Time Buyers\",\n \"Downtown Area\"\n ],\n \"tags\": [\n \"Hot Lead\",\n \"Zillow\"\n ],\n \"tagsAdd\": [\n \"Referral\",\n \"Pre-Approved\"\n ],\n \"source\": \"Open House\",\n \"inquiry\": {\n \"priceMin\": 1,\n \"priceMax\": 10000000,\n \"propertyType\": [\n \"Single Family Home\",\n \"Condo\"\n ],\n \"bedroomsMin\": 1,\n \"bathroomsMin\": \"1\",\n \"locations\": [\n {\n \"city\": \"Austin\",\n \"stateCode\": \"TX\"\n }\n ],\n \"id\": 123,\n \"leadUserId\": 123,\n \"bedroomsMax\": 123,\n \"bathroomsMax\": \"<string>\",\n \"modifyByAgent\": true,\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"defaultValue\": true\n },\n \"property\": {\n \"price\": 100000,\n \"state\": \"California\",\n \"city\": \"New York\",\n \"streetAddress\": \"22348 Regnart RD\",\n \"zipCode\": \"25401\",\n \"county\": \"<string>\",\n \"propertyType\": \"Single Family Home\",\n \"bedrooms\": 3,\n \"bathrooms\": 2,\n \"squareFeet\": 100,\n \"lotSize\": 26.33,\n \"parkingSpace\": 1,\n \"floors\": 1,\n \"mailAddress\": true,\n \"id\": 123,\n \"leadUserId\": 123,\n \"listingId\": \"<string>\",\n \"autoListingId\": 123,\n \"label\": \"<string>\",\n \"note\": \"<string>\",\n \"listingStatus\": \"<string>\",\n \"labelList\": \"<string>\",\n \"pictureUrl\": \"<string>\",\n \"siteListingUrl\": \"<string>\",\n \"labelType\": \"<string>\",\n \"priceMax\": 10000000,\n \"priceMin\": 100000\n },\n \"unsubscription\": true,\n \"welcomeEmail\": true,\n \"leadAlert\": true,\n \"customAttributeList\": [\n {\n \"attributeName\": \"<string>\",\n \"attributeType\": \"number, text, date, anniversary_date, single_select, multi_select, percentage, currency\",\n \"value\": \"<string>\",\n \"params\": \"<string>\"\n }\n ],\n \"birthday\": \"Jun 5, 2001\",\n \"leadRouting\": true,\n \"assignGroupId\": 123,\n \"buyingTimeFrame\": \"6-12\",\n \"preQual\": \"Yes\",\n \"houseToSell\": \"Yes\",\n \"fthb\": \"Yes\",\n \"withBuyerAgent\": \"Yes\",\n \"sellingTimeFrame\": \"1-3\",\n \"mortgage\": \"Yes\",\n \"buyHouse\": \"Yes\",\n \"withListingAgent\": \"Yes\",\n \"leadFamilyMemberList\": [\n {\n \"firstName\": \"<string>\",\n \"relationship\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phones\": [\n \"+14155551234\"\n ],\n \"emails\": [\n \"spouse@example.com\"\n ],\n \"birthday\": \"<string>\"\n }\n ],\n \"language\": \"en\",\n \"content\": \"example_note\",\n \"isPin\": false,\n \"ownershipId\": 123,\n \"ownershipScope\": \"<string>\",\n \"defaultInquiryParam\": true,\n \"specifiedAssignGroupId\": true,\n \"pondId\": 12345\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.lofty.com/v1.0/leads")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"firstName\": \"Bob\",\n \"cannotText\": true,\n \"cannotCall\": true,\n \"cannotEmail\": true,\n \"lastName\": \"Li\",\n \"emails\": [\n \"jane.doe@example.com\",\n \"jdoe-work@company.com\"\n ],\n \"phones\": [\n \"+14155551234\",\n \"+12125559876\"\n ],\n \"leadTypes\": [\n 2,\n 5\n ],\n \"assignedUserId\": 10000000514,\n \"streetAddress\": \"The White House,1600 Pennsylvania Avenue NW\",\n \"city\": \"Washington DC\",\n \"state\": \"Washington DC\",\n \"zipCode\": \"20500\",\n \"referredBy\": \"Jeremy Kelly\",\n \"stage\": \"Pending\",\n \"groups\": [\n \"VIP Clients\",\n \"Open House Feb\"\n ],\n \"segments\": [\n \"First-Time Buyers\",\n \"Downtown Area\"\n ],\n \"tags\": [\n \"Hot Lead\",\n \"Zillow\"\n ],\n \"tagsAdd\": [\n \"Referral\",\n \"Pre-Approved\"\n ],\n \"source\": \"Open House\",\n \"inquiry\": {\n \"priceMin\": 1,\n \"priceMax\": 10000000,\n \"propertyType\": [\n \"Single Family Home\",\n \"Condo\"\n ],\n \"bedroomsMin\": 1,\n \"bathroomsMin\": \"1\",\n \"locations\": [\n {\n \"city\": \"Austin\",\n \"stateCode\": \"TX\"\n }\n ],\n \"id\": 123,\n \"leadUserId\": 123,\n \"bedroomsMax\": 123,\n \"bathroomsMax\": \"<string>\",\n \"modifyByAgent\": true,\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"defaultValue\": true\n },\n \"property\": {\n \"price\": 100000,\n \"state\": \"California\",\n \"city\": \"New York\",\n \"streetAddress\": \"22348 Regnart RD\",\n \"zipCode\": \"25401\",\n \"county\": \"<string>\",\n \"propertyType\": \"Single Family Home\",\n \"bedrooms\": 3,\n \"bathrooms\": 2,\n \"squareFeet\": 100,\n \"lotSize\": 26.33,\n \"parkingSpace\": 1,\n \"floors\": 1,\n \"mailAddress\": true,\n \"id\": 123,\n \"leadUserId\": 123,\n \"listingId\": \"<string>\",\n \"autoListingId\": 123,\n \"label\": \"<string>\",\n \"note\": \"<string>\",\n \"listingStatus\": \"<string>\",\n \"labelList\": \"<string>\",\n \"pictureUrl\": \"<string>\",\n \"siteListingUrl\": \"<string>\",\n \"labelType\": \"<string>\",\n \"priceMax\": 10000000,\n \"priceMin\": 100000\n },\n \"unsubscription\": true,\n \"welcomeEmail\": true,\n \"leadAlert\": true,\n \"customAttributeList\": [\n {\n \"attributeName\": \"<string>\",\n \"attributeType\": \"number, text, date, anniversary_date, single_select, multi_select, percentage, currency\",\n \"value\": \"<string>\",\n \"params\": \"<string>\"\n }\n ],\n \"birthday\": \"Jun 5, 2001\",\n \"leadRouting\": true,\n \"assignGroupId\": 123,\n \"buyingTimeFrame\": \"6-12\",\n \"preQual\": \"Yes\",\n \"houseToSell\": \"Yes\",\n \"fthb\": \"Yes\",\n \"withBuyerAgent\": \"Yes\",\n \"sellingTimeFrame\": \"1-3\",\n \"mortgage\": \"Yes\",\n \"buyHouse\": \"Yes\",\n \"withListingAgent\": \"Yes\",\n \"leadFamilyMemberList\": [\n {\n \"firstName\": \"<string>\",\n \"relationship\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phones\": [\n \"+14155551234\"\n ],\n \"emails\": [\n \"spouse@example.com\"\n ],\n \"birthday\": \"<string>\"\n }\n ],\n \"language\": \"en\",\n \"content\": \"example_note\",\n \"isPin\": false,\n \"ownershipId\": 123,\n \"ownershipScope\": \"<string>\",\n \"defaultInquiryParam\": true,\n \"specifiedAssignGroupId\": true,\n \"pondId\": 12345\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"firstName\": \"Bob\",\n \"cannotText\": true,\n \"cannotCall\": true,\n \"cannotEmail\": true,\n \"lastName\": \"Li\",\n \"emails\": [\n \"jane.doe@example.com\",\n \"jdoe-work@company.com\"\n ],\n \"phones\": [\n \"+14155551234\",\n \"+12125559876\"\n ],\n \"leadTypes\": [\n 2,\n 5\n ],\n \"assignedUserId\": 10000000514,\n \"streetAddress\": \"The White House,1600 Pennsylvania Avenue NW\",\n \"city\": \"Washington DC\",\n \"state\": \"Washington DC\",\n \"zipCode\": \"20500\",\n \"referredBy\": \"Jeremy Kelly\",\n \"stage\": \"Pending\",\n \"groups\": [\n \"VIP Clients\",\n \"Open House Feb\"\n ],\n \"segments\": [\n \"First-Time Buyers\",\n \"Downtown Area\"\n ],\n \"tags\": [\n \"Hot Lead\",\n \"Zillow\"\n ],\n \"tagsAdd\": [\n \"Referral\",\n \"Pre-Approved\"\n ],\n \"source\": \"Open House\",\n \"inquiry\": {\n \"priceMin\": 1,\n \"priceMax\": 10000000,\n \"propertyType\": [\n \"Single Family Home\",\n \"Condo\"\n ],\n \"bedroomsMin\": 1,\n \"bathroomsMin\": \"1\",\n \"locations\": [\n {\n \"city\": \"Austin\",\n \"stateCode\": \"TX\"\n }\n ],\n \"id\": 123,\n \"leadUserId\": 123,\n \"bedroomsMax\": 123,\n \"bathroomsMax\": \"<string>\",\n \"modifyByAgent\": true,\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"defaultValue\": true\n },\n \"property\": {\n \"price\": 100000,\n \"state\": \"California\",\n \"city\": \"New York\",\n \"streetAddress\": \"22348 Regnart RD\",\n \"zipCode\": \"25401\",\n \"county\": \"<string>\",\n \"propertyType\": \"Single Family Home\",\n \"bedrooms\": 3,\n \"bathrooms\": 2,\n \"squareFeet\": 100,\n \"lotSize\": 26.33,\n \"parkingSpace\": 1,\n \"floors\": 1,\n \"mailAddress\": true,\n \"id\": 123,\n \"leadUserId\": 123,\n \"listingId\": \"<string>\",\n \"autoListingId\": 123,\n \"label\": \"<string>\",\n \"note\": \"<string>\",\n \"listingStatus\": \"<string>\",\n \"labelList\": \"<string>\",\n \"pictureUrl\": \"<string>\",\n \"siteListingUrl\": \"<string>\",\n \"labelType\": \"<string>\",\n \"priceMax\": 10000000,\n \"priceMin\": 100000\n },\n \"unsubscription\": true,\n \"welcomeEmail\": true,\n \"leadAlert\": true,\n \"customAttributeList\": [\n {\n \"attributeName\": \"<string>\",\n \"attributeType\": \"number, text, date, anniversary_date, single_select, multi_select, percentage, currency\",\n \"value\": \"<string>\",\n \"params\": \"<string>\"\n }\n ],\n \"birthday\": \"Jun 5, 2001\",\n \"leadRouting\": true,\n \"assignGroupId\": 123,\n \"buyingTimeFrame\": \"6-12\",\n \"preQual\": \"Yes\",\n \"houseToSell\": \"Yes\",\n \"fthb\": \"Yes\",\n \"withBuyerAgent\": \"Yes\",\n \"sellingTimeFrame\": \"1-3\",\n \"mortgage\": \"Yes\",\n \"buyHouse\": \"Yes\",\n \"withListingAgent\": \"Yes\",\n \"leadFamilyMemberList\": [\n {\n \"firstName\": \"<string>\",\n \"relationship\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phones\": [\n \"+14155551234\"\n ],\n \"emails\": [\n \"spouse@example.com\"\n ],\n \"birthday\": \"<string>\"\n }\n ],\n \"language\": \"en\",\n \"content\": \"example_note\",\n \"isPin\": false,\n \"ownershipId\": 123,\n \"ownershipScope\": \"<string>\",\n \"defaultInquiryParam\": true,\n \"specifiedAssignGroupId\": true,\n \"pondId\": 12345\n}"
response = http.request(request)
puts response.read_body{
"leadId": 651095960136641
}"<string>""<string>""<string>"