Get Sales Agent by lead ID
Retrieves the Sales Agent (AI Assistant) configuration associated with the specified lead.
curl --request GET \
--url https://api.lofty.com/v2.0/sales-agents/by-lead \
--header 'Authorization: <authorization>'import requests
url = "https://api.lofty.com/v2.0/sales-agents/by-lead"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.lofty.com/v2.0/sales-agents/by-lead', 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/v2.0/sales-agents/by-lead",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lofty.com/v2.0/sales-agents/by-lead"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.lofty.com/v2.0/sales-agents/by-lead")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v2.0/sales-agents/by-lead")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"id": 12345,
"userId": 67890,
"agentName": "John Doe",
"agentHeadUrl": "https://example.com/avatar.jpg",
"assistantName": "John's AI Assistant",
"assistantHeadUrl": "https://example.com/ai-avatar.jpg",
"virtualNumber": "+1234567890",
"virtualNumberCountry": "US",
"followUpRole": "buyer_agent",
"agentExperience": "10 years in real estate",
"email": "john.assistant@example.com",
"status": "ACTIVE",
"createdAt": "2026-02-20T10:00:00Z",
"updatedAt": "2026-02-28T10:00:00Z",
"hasQuotaSeat": true,
"borrowLevel": "SELF",
"borrowId": 12345
}{
"code": 0,
"message": "success",
"data": {}
}"<string>""<string>""<string>""<string>"Headers
Bearer [access_token]
Query Parameters
Lead ID
Response
Sales Agent found successfully
Sales Agent information
Sales Agent ID
12345
User ID who owns this Sales Agent
67890
Agent's full name
"John Doe"
Agent's avatar URL
"https://example.com/avatar.jpg"
AI Assistant name
"John's AI Assistant"
AI Assistant avatar URL
"https://example.com/ai-avatar.jpg"
Virtual phone number
"+1234567890"
Virtual number country code
"US"
Follow-up role: buyer_agent, listing_agent, etc.
"buyer_agent"
Agent experience description
"10 years in real estate"
AI Assistant email
"john.assistant@example.com"
Status: ACTIVE, INACTIVE, etc.
"ACTIVE"
Creation time in ISO8601 format
"2026-02-20T10:00:00Z"
Last update time in ISO8601 format
"2026-02-28T10:00:00Z"
Whether AI has valid quota seat
true
Borrow level if using borrowed AI: SELF, GROUP, TEAM
"SELF"
Borrowed from user/office ID
12345
curl --request GET \
--url https://api.lofty.com/v2.0/sales-agents/by-lead \
--header 'Authorization: <authorization>'import requests
url = "https://api.lofty.com/v2.0/sales-agents/by-lead"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.lofty.com/v2.0/sales-agents/by-lead', 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/v2.0/sales-agents/by-lead",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lofty.com/v2.0/sales-agents/by-lead"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.lofty.com/v2.0/sales-agents/by-lead")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v2.0/sales-agents/by-lead")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"id": 12345,
"userId": 67890,
"agentName": "John Doe",
"agentHeadUrl": "https://example.com/avatar.jpg",
"assistantName": "John's AI Assistant",
"assistantHeadUrl": "https://example.com/ai-avatar.jpg",
"virtualNumber": "+1234567890",
"virtualNumberCountry": "US",
"followUpRole": "buyer_agent",
"agentExperience": "10 years in real estate",
"email": "john.assistant@example.com",
"status": "ACTIVE",
"createdAt": "2026-02-20T10:00:00Z",
"updatedAt": "2026-02-28T10:00:00Z",
"hasQuotaSeat": true,
"borrowLevel": "SELF",
"borrowId": 12345
}{
"code": 0,
"message": "success",
"data": {}
}"<string>""<string>""<string>""<string>"