Create Persona
curl --request POST \
--url https://api.lemlist.com/api/database/personas \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "SaaS founders",
"mode": "leads",
"filters": [
{
"filterId": "currentTitle",
"in": [
"Founder"
],
"out": []
},
{
"filterId": "country",
"in": [
"France"
],
"out": []
}
]
}
'import requests
url = "https://api.lemlist.com/api/database/personas"
payload = {
"name": "SaaS founders",
"mode": "leads",
"filters": [
{
"filterId": "currentTitle",
"in": ["Founder"],
"out": []
},
{
"filterId": "country",
"in": ["France"],
"out": []
}
]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'SaaS founders',
mode: 'leads',
filters: [
{filterId: 'currentTitle', in: ['Founder'], out: []},
{filterId: 'country', in: ['France'], out: []}
]
})
};
fetch('https://api.lemlist.com/api/database/personas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api.lemlist.com/api/database/personas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"SaaS founders\",\n \"mode\": \"leads\",\n \"filters\": [\n {\n \"filterId\": \"currentTitle\",\n \"in\": [\n \"Founder\"\n ],\n \"out\": []\n },\n {\n \"filterId\": \"country\",\n \"in\": [\n \"France\"\n ],\n \"out\": []\n }\n ]\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/database/personas",
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([
'name' => 'SaaS founders',
'mode' => 'leads',
'filters' => [
[
'filterId' => 'currentTitle',
'in' => [
'Founder'
],
'out' => [
]
],
[
'filterId' => 'country',
'in' => [
'France'
],
'out' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"_id": "pdp_ExAmPlE1234567890a"
}
}
People database
Create Persona
Creates a People Database persona for your team.
POST
/
database
/
personas
Create Persona
curl --request POST \
--url https://api.lemlist.com/api/database/personas \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "SaaS founders",
"mode": "leads",
"filters": [
{
"filterId": "currentTitle",
"in": [
"Founder"
],
"out": []
},
{
"filterId": "country",
"in": [
"France"
],
"out": []
}
]
}
'import requests
url = "https://api.lemlist.com/api/database/personas"
payload = {
"name": "SaaS founders",
"mode": "leads",
"filters": [
{
"filterId": "currentTitle",
"in": ["Founder"],
"out": []
},
{
"filterId": "country",
"in": ["France"],
"out": []
}
]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'SaaS founders',
mode: 'leads',
filters: [
{filterId: 'currentTitle', in: ['Founder'], out: []},
{filterId: 'country', in: ['France'], out: []}
]
})
};
fetch('https://api.lemlist.com/api/database/personas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api.lemlist.com/api/database/personas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"SaaS founders\",\n \"mode\": \"leads\",\n \"filters\": [\n {\n \"filterId\": \"currentTitle\",\n \"in\": [\n \"Founder\"\n ],\n \"out\": []\n },\n {\n \"filterId\": \"country\",\n \"in\": [\n \"France\"\n ],\n \"out\": []\n }\n ]\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/database/personas",
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([
'name' => 'SaaS founders',
'mode' => 'leads',
'filters' => [
[
'filterId' => 'currentTitle',
'in' => [
'Founder'
],
'out' => [
]
],
[
'filterId' => 'country',
'in' => [
'France'
],
'out' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"_id": "pdp_ExAmPlE1234567890a"
}
}
name, filters and mode are all required. The name must be unique within your team — a duplicate answers 409. Only the leads mode is accepted today; companies answers 400 with the code PEOPLE_DATABASE_PERSONA_MODE_NOT_SUPPORTED.Filters carry no type property — it is derived from filterId server-side. Use Get Database Filters to discover which filterId values you can use. Filters that require a plan your team does not have are dropped silently.The response contains only the created id. The stored
name and filters are sanitized and plan-gated server-side, so echoing the request payload back would misreport what was persisted — call List personas to read the stored persona.This endpoint is in closed beta. It answers
403 with the code BETA_NOT_ENABLED unless the personas beta is enabled for your team.Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Display name. Non-empty, and unique within your team.
Minimum string length:
1Example:
"SaaS founders"
People Database filters defining the persona
Show child attributes
Show child attributes
Search mode the filters target. Only leads is accepted today.
Available options:
leads, companies Example:
"leads"
Response
Persona created
Show child attributes
Show child attributes
Was this page helpful?