Autocomplete People
curl --request GET \
--url https://api.example.com/api/v1/operations/autocomplete/people \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/operations/autocomplete/people"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/operations/autocomplete/people', 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.example.com/api/v1/operations/autocomplete/people",
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: Bearer <token>"
],
]);
$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.example.com/api/v1/operations/autocomplete/people"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/api/v1/operations/autocomplete/people")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/operations/autocomplete/people")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"content": [
{
"id": "person_001",
"name": "John Smith",
"title": "Senior Software Engineer",
"logo": "https://example.com/profiles/john-smith.jpg",
"url": "https://linkedin.com/in/johnsmith"
},
{
"id": "person_002",
"name": "John Doe",
"title": "Product Manager",
"logo": "https://example.com/profiles/john-doe.jpg",
"url": "https://linkedin.com/in/johndoe"
},
{
"id": "person_003",
"name": "Johnny Wilson",
"title": "CTO",
"logo": null,
"url": "https://linkedin.com/in/johnnywilson"
}
],
"totalElements": 156,
"totalPages": 16,
"size": 10,
"number": 0,
"first": true,
"last": false,
"empty": false,
"numberOfElements": 10
}
{
"content": [
{
"id": "person_042",
"name": "Sarah Johnson",
"title": "VP of Sales",
"logo": "https://example.com/profiles/sarah-johnson.jpg",
"url": "https://linkedin.com/in/sarahjohnson"
}
],
"totalElements": 1,
"totalPages": 1,
"size": 10,
"number": 0,
"first": true,
"last": true,
"empty": false,
"numberOfElements": 1
}
{
"content": [],
"totalElements": 0,
"totalPages": 0,
"size": 10,
"number": 0,
"first": true,
"last": true,
"empty": true,
"numberOfElements": 0
}
{
"error": {
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}
Autocomplete
Autocomplete People
Search and retrieve people suggestions for autocomplete functionality in lead search and filtering
GET
/
api
/
v1
/
operations
/
autocomplete
/
people
Autocomplete People
curl --request GET \
--url https://api.example.com/api/v1/operations/autocomplete/people \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/operations/autocomplete/people"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/operations/autocomplete/people', 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.example.com/api/v1/operations/autocomplete/people",
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: Bearer <token>"
],
]);
$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.example.com/api/v1/operations/autocomplete/people"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/api/v1/operations/autocomplete/people")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/operations/autocomplete/people")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"content": [
{
"id": "person_001",
"name": "John Smith",
"title": "Senior Software Engineer",
"logo": "https://example.com/profiles/john-smith.jpg",
"url": "https://linkedin.com/in/johnsmith"
},
{
"id": "person_002",
"name": "John Doe",
"title": "Product Manager",
"logo": "https://example.com/profiles/john-doe.jpg",
"url": "https://linkedin.com/in/johndoe"
},
{
"id": "person_003",
"name": "Johnny Wilson",
"title": "CTO",
"logo": null,
"url": "https://linkedin.com/in/johnnywilson"
}
],
"totalElements": 156,
"totalPages": 16,
"size": 10,
"number": 0,
"first": true,
"last": false,
"empty": false,
"numberOfElements": 10
}
{
"content": [
{
"id": "person_042",
"name": "Sarah Johnson",
"title": "VP of Sales",
"logo": "https://example.com/profiles/sarah-johnson.jpg",
"url": "https://linkedin.com/in/sarahjohnson"
}
],
"totalElements": 1,
"totalPages": 1,
"size": 10,
"number": 0,
"first": true,
"last": true,
"empty": false,
"numberOfElements": 1
}
{
"content": [],
"totalElements": 0,
"totalPages": 0,
"size": 10,
"number": 0,
"first": true,
"last": true,
"empty": true,
"numberOfElements": 0
}
{
"error": {
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}
Provides autocomplete suggestions for people/contacts. This endpoint powers the autocomplete functionality when searching for specific people, enabling type-ahead search with names, titles, and profile images.
Authentication
This endpoint requires authentication. The user must be signed in to access autocomplete data.This endpoint proxies requests to the people search metadata API. Results are
cached for 7 days to improve performance.
Request
string
Search query to filter people. Returns people whose names match this text.
Leave empty to retrieve all people (paginated).
integer
default:"10"
Number of results to return per page.
integer
default:"0"
Zero-based page number for pagination.
Response
Returns a paginated list of people matching the search criteria.PeopleMetadataItem[]
Array of people items matching the query.
integer
Total number of matching people across all pages.
integer
Total number of pages available.
integer
Number of items per page.
integer
Current page number (zero-based).
boolean
Whether this is the first page.
boolean
Whether this is the last page.
boolean
Whether the result set is empty.
integer
Number of elements in the current page.
Response Examples
{
"content": [
{
"id": "person_001",
"name": "John Smith",
"title": "Senior Software Engineer",
"logo": "https://example.com/profiles/john-smith.jpg",
"url": "https://linkedin.com/in/johnsmith"
},
{
"id": "person_002",
"name": "John Doe",
"title": "Product Manager",
"logo": "https://example.com/profiles/john-doe.jpg",
"url": "https://linkedin.com/in/johndoe"
},
{
"id": "person_003",
"name": "Johnny Wilson",
"title": "CTO",
"logo": null,
"url": "https://linkedin.com/in/johnnywilson"
}
],
"totalElements": 156,
"totalPages": 16,
"size": 10,
"number": 0,
"first": true,
"last": false,
"empty": false,
"numberOfElements": 10
}
{
"content": [
{
"id": "person_042",
"name": "Sarah Johnson",
"title": "VP of Sales",
"logo": "https://example.com/profiles/sarah-johnson.jpg",
"url": "https://linkedin.com/in/sarahjohnson"
}
],
"totalElements": 1,
"totalPages": 1,
"size": 10,
"number": 0,
"first": true,
"last": true,
"empty": false,
"numberOfElements": 1
}
{
"content": [],
"totalElements": 0,
"totalPages": 0,
"size": 10,
"number": 0,
"first": true,
"last": true,
"empty": true,
"numberOfElements": 0
}
{
"error": {
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}
Usage Examples
Search for people by name
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/people?search=john&size=10" \
-H "Authorization: Bearer YOUR_TOKEN"
Get all people (first page)
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/people" \
-H "Authorization: Bearer YOUR_TOKEN"
Paginate through results
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/people?page=2&size=25" \
-H "Authorization: Bearer YOUR_TOKEN"
Search with larger page size
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/people?search=manager&size=50" \
-H "Authorization: Bearer YOUR_TOKEN"
Notes
- Results are cached for 7 days to improve performance. The cache is shared across all users.
- Use the
searchparameter for type-ahead/autocomplete functionality - it filters results by name. - The
logofield may be null if the person doesn’t have a profile image. - The
urlfield typically contains a LinkedIn profile URL but may be null or contain other profile URLs. - For best autocomplete UX, use a small
size(10-20) and debounce requests as users type.