Autocomplete Person Metadata
curl --request GET \
--url https://api.example.com/api/v1/operations/autocomplete/person-metadata \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/operations/autocomplete/person-metadata"
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/person-metadata', 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/person-metadata",
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/person-metadata"
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/person-metadata")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/operations/autocomplete/person-metadata")
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[
{
"key": "Software Engineer",
"value": 1542
},
{
"key": "Product Manager",
"value": 987
},
{
"key": "Data Scientist",
"value": 654
},
{
"key": "Engineering Manager",
"value": 432
},
{
"key": "VP of Engineering",
"value": 156
}
]
[]
{
"error": {
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}
Autocomplete
Autocomplete Person Metadata
Retrieve aggregated metadata statistics about persons, including counts by job title, seniority, and other attributes
GET
/
api
/
v1
/
operations
/
autocomplete
/
person-metadata
Autocomplete Person Metadata
curl --request GET \
--url https://api.example.com/api/v1/operations/autocomplete/person-metadata \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/operations/autocomplete/person-metadata"
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/person-metadata', 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/person-metadata",
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/person-metadata"
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/person-metadata")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/operations/autocomplete/person-metadata")
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[
{
"key": "Software Engineer",
"value": 1542
},
{
"key": "Product Manager",
"value": 987
},
{
"key": "Data Scientist",
"value": 654
},
{
"key": "Engineering Manager",
"value": 432
},
{
"key": "VP of Engineering",
"value": 156
}
]
[]
{
"error": {
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}
Provides metadata statistics. This endpoint returns aggregated counts of persons grouped by various attributes such as job titles, seniority levels, and other person-related classifications. Useful for understanding the composition of your lead database and building analytics dashboards.
Authentication
This endpoint requires authentication. The user must be signed in to access metadata.This endpoint proxies requests to the persons search metadata API. Results are
cached for 7 days to improve performance.
Request
integer
default:"25"
Number of metadata items to return per page.
integer
default:"0"
Zero-based page number for pagination.
Response
Returns an array of metadata items, each containing a key-value pair representing an attribute and its count.PersonMetadataItem[]
Response Examples
[
{
"key": "Software Engineer",
"value": 1542
},
{
"key": "Product Manager",
"value": 987
},
{
"key": "Data Scientist",
"value": 654
},
{
"key": "Engineering Manager",
"value": 432
},
{
"key": "VP of Engineering",
"value": 156
}
]
[]
{
"error": {
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}
Usage Examples
Get default metadata
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/person-metadata" \
-H "Authorization: Bearer YOUR_TOKEN"
Get first page with custom size
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/person-metadata?size=50&page=0" \
-H "Authorization: Bearer YOUR_TOKEN"
Paginate through metadata
curl -X GET "https://api.lance.work/api/v1/operations/autocomplete/person-metadata?page=1&size=25" \
-H "Authorization: Bearer YOUR_TOKEN"
Notes
- Results are cached for 7 days to improve performance. The cache is shared across all users in the organization.
- Unlike other autocomplete endpoints that return paginated objects with
content, this endpoint returns a flat array of key-value pairs. - Use this endpoint to build analytics dashboards or to understand the distribution of persons by various attributes in your database.