Identify
curl --request POST \
--url https://{environment}.userpilot.io/v1/identify \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "user_789456",
"metadata": {
"name": "Sarah Johnson",
"email": "sarah.johnson@techstartup.com",
"job_title": "Product Manager",
"department": "Product",
"location": "New York, NY",
"hire_date": "2022-03-15",
"years_experience": 8,
"skills": "Product Strategy, User Research, Agile",
"subscription_plan": "Pro",
"last_login": "2024-01-15T10:30:00Z",
"preferences_language": "en",
"preferences_timezone": "America/New_York",
"preferences_notifications": "email"
},
"company": {
"company_id": "comp_techstartup_2024",
"name": "TechStartup Inc.",
"industry": "SaaS",
"size": "50-100",
"location": "New York, NY",
"website": "https://techstartup.com",
"subscription_tier": "Enterprise",
"annual_revenue": "$5M-$10M",
"founded_year": "2020",
"primary_product": "Project Management Platform",
"customer_count": 2500,
"team_engineering": 25,
"team_sales": 15,
"team_marketing": 8,
"team_support": 12
}
}
'import requests
url = "https://{environment}.userpilot.io/v1/identify"
payload = {
"user_id": "user_789456",
"metadata": {
"name": "Sarah Johnson",
"email": "sarah.johnson@techstartup.com",
"job_title": "Product Manager",
"department": "Product",
"location": "New York, NY",
"hire_date": "2022-03-15",
"years_experience": 8,
"skills": "Product Strategy, User Research, Agile",
"subscription_plan": "Pro",
"last_login": "2024-01-15T10:30:00Z",
"preferences_language": "en",
"preferences_timezone": "America/New_York",
"preferences_notifications": "email"
},
"company": {
"company_id": "comp_techstartup_2024",
"name": "TechStartup Inc.",
"industry": "SaaS",
"size": "50-100",
"location": "New York, NY",
"website": "https://techstartup.com",
"subscription_tier": "Enterprise",
"annual_revenue": "$5M-$10M",
"founded_year": "2020",
"primary_product": "Project Management Platform",
"customer_count": 2500,
"team_engineering": 25,
"team_sales": 15,
"team_marketing": 8,
"team_support": 12
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: 'user_789456',
metadata: {
name: 'Sarah Johnson',
email: 'sarah.johnson@techstartup.com',
job_title: 'Product Manager',
department: 'Product',
location: 'New York, NY',
hire_date: '2022-03-15',
years_experience: 8,
skills: 'Product Strategy, User Research, Agile',
subscription_plan: 'Pro',
last_login: '2024-01-15T10:30:00Z',
preferences_language: 'en',
preferences_timezone: 'America/New_York',
preferences_notifications: 'email'
},
company: {
company_id: 'comp_techstartup_2024',
name: 'TechStartup Inc.',
industry: 'SaaS',
size: '50-100',
location: 'New York, NY',
website: 'https://techstartup.com',
subscription_tier: 'Enterprise',
annual_revenue: '$5M-$10M',
founded_year: '2020',
primary_product: 'Project Management Platform',
customer_count: 2500,
team_engineering: 25,
team_sales: 15,
team_marketing: 8,
team_support: 12
}
})
};
fetch('https://{environment}.userpilot.io/v1/identify', 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://{environment}.userpilot.io/v1/identify",
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([
'user_id' => 'user_789456',
'metadata' => [
'name' => 'Sarah Johnson',
'email' => 'sarah.johnson@techstartup.com',
'job_title' => 'Product Manager',
'department' => 'Product',
'location' => 'New York, NY',
'hire_date' => '2022-03-15',
'years_experience' => 8,
'skills' => 'Product Strategy, User Research, Agile',
'subscription_plan' => 'Pro',
'last_login' => '2024-01-15T10:30:00Z',
'preferences_language' => 'en',
'preferences_timezone' => 'America/New_York',
'preferences_notifications' => 'email'
],
'company' => [
'company_id' => 'comp_techstartup_2024',
'name' => 'TechStartup Inc.',
'industry' => 'SaaS',
'size' => '50-100',
'location' => 'New York, NY',
'website' => 'https://techstartup.com',
'subscription_tier' => 'Enterprise',
'annual_revenue' => '$5M-$10M',
'founded_year' => '2020',
'primary_product' => 'Project Management Platform',
'customer_count' => 2500,
'team_engineering' => 25,
'team_sales' => 15,
'team_marketing' => 8,
'team_support' => 12
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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://{environment}.userpilot.io/v1/identify"
payload := strings.NewReader("{\n \"user_id\": \"user_789456\",\n \"metadata\": {\n \"name\": \"Sarah Johnson\",\n \"email\": \"sarah.johnson@techstartup.com\",\n \"job_title\": \"Product Manager\",\n \"department\": \"Product\",\n \"location\": \"New York, NY\",\n \"hire_date\": \"2022-03-15\",\n \"years_experience\": 8,\n \"skills\": \"Product Strategy, User Research, Agile\",\n \"subscription_plan\": \"Pro\",\n \"last_login\": \"2024-01-15T10:30:00Z\",\n \"preferences_language\": \"en\",\n \"preferences_timezone\": \"America/New_York\",\n \"preferences_notifications\": \"email\"\n },\n \"company\": {\n \"company_id\": \"comp_techstartup_2024\",\n \"name\": \"TechStartup Inc.\",\n \"industry\": \"SaaS\",\n \"size\": \"50-100\",\n \"location\": \"New York, NY\",\n \"website\": \"https://techstartup.com\",\n \"subscription_tier\": \"Enterprise\",\n \"annual_revenue\": \"$5M-$10M\",\n \"founded_year\": \"2020\",\n \"primary_product\": \"Project Management Platform\",\n \"customer_count\": 2500,\n \"team_engineering\": 25,\n \"team_sales\": 15,\n \"team_marketing\": 8,\n \"team_support\": 12\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{environment}.userpilot.io/v1/identify")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"user_789456\",\n \"metadata\": {\n \"name\": \"Sarah Johnson\",\n \"email\": \"sarah.johnson@techstartup.com\",\n \"job_title\": \"Product Manager\",\n \"department\": \"Product\",\n \"location\": \"New York, NY\",\n \"hire_date\": \"2022-03-15\",\n \"years_experience\": 8,\n \"skills\": \"Product Strategy, User Research, Agile\",\n \"subscription_plan\": \"Pro\",\n \"last_login\": \"2024-01-15T10:30:00Z\",\n \"preferences_language\": \"en\",\n \"preferences_timezone\": \"America/New_York\",\n \"preferences_notifications\": \"email\"\n },\n \"company\": {\n \"company_id\": \"comp_techstartup_2024\",\n \"name\": \"TechStartup Inc.\",\n \"industry\": \"SaaS\",\n \"size\": \"50-100\",\n \"location\": \"New York, NY\",\n \"website\": \"https://techstartup.com\",\n \"subscription_tier\": \"Enterprise\",\n \"annual_revenue\": \"$5M-$10M\",\n \"founded_year\": \"2020\",\n \"primary_product\": \"Project Management Platform\",\n \"customer_count\": 2500,\n \"team_engineering\": 25,\n \"team_sales\": 15,\n \"team_marketing\": 8,\n \"team_support\": 12\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.userpilot.io/v1/identify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"user_789456\",\n \"metadata\": {\n \"name\": \"Sarah Johnson\",\n \"email\": \"sarah.johnson@techstartup.com\",\n \"job_title\": \"Product Manager\",\n \"department\": \"Product\",\n \"location\": \"New York, NY\",\n \"hire_date\": \"2022-03-15\",\n \"years_experience\": 8,\n \"skills\": \"Product Strategy, User Research, Agile\",\n \"subscription_plan\": \"Pro\",\n \"last_login\": \"2024-01-15T10:30:00Z\",\n \"preferences_language\": \"en\",\n \"preferences_timezone\": \"America/New_York\",\n \"preferences_notifications\": \"email\"\n },\n \"company\": {\n \"company_id\": \"comp_techstartup_2024\",\n \"name\": \"TechStartup Inc.\",\n \"industry\": \"SaaS\",\n \"size\": \"50-100\",\n \"location\": \"New York, NY\",\n \"website\": \"https://techstartup.com\",\n \"subscription_tier\": \"Enterprise\",\n \"annual_revenue\": \"$5M-$10M\",\n \"founded_year\": \"2020\",\n \"primary_product\": \"Project Management Platform\",\n \"customer_count\": 2500,\n \"team_engineering\": 25,\n \"team_sales\": 15,\n \"team_marketing\": 8,\n \"team_support\": 12\n }\n}"
response = http.request(request)
puts response.read_body{
"errors": [
{
"details": "<string>",
"error": "<string>",
"error_code": "<string>",
"message": "<string>"
}
]
}Endpoints
Identify User
Create or update a user profile with properties like name, email, and custom attributes via HTTP POST request.
POST
/
v1
/
identify
Identify
curl --request POST \
--url https://{environment}.userpilot.io/v1/identify \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "user_789456",
"metadata": {
"name": "Sarah Johnson",
"email": "sarah.johnson@techstartup.com",
"job_title": "Product Manager",
"department": "Product",
"location": "New York, NY",
"hire_date": "2022-03-15",
"years_experience": 8,
"skills": "Product Strategy, User Research, Agile",
"subscription_plan": "Pro",
"last_login": "2024-01-15T10:30:00Z",
"preferences_language": "en",
"preferences_timezone": "America/New_York",
"preferences_notifications": "email"
},
"company": {
"company_id": "comp_techstartup_2024",
"name": "TechStartup Inc.",
"industry": "SaaS",
"size": "50-100",
"location": "New York, NY",
"website": "https://techstartup.com",
"subscription_tier": "Enterprise",
"annual_revenue": "$5M-$10M",
"founded_year": "2020",
"primary_product": "Project Management Platform",
"customer_count": 2500,
"team_engineering": 25,
"team_sales": 15,
"team_marketing": 8,
"team_support": 12
}
}
'import requests
url = "https://{environment}.userpilot.io/v1/identify"
payload = {
"user_id": "user_789456",
"metadata": {
"name": "Sarah Johnson",
"email": "sarah.johnson@techstartup.com",
"job_title": "Product Manager",
"department": "Product",
"location": "New York, NY",
"hire_date": "2022-03-15",
"years_experience": 8,
"skills": "Product Strategy, User Research, Agile",
"subscription_plan": "Pro",
"last_login": "2024-01-15T10:30:00Z",
"preferences_language": "en",
"preferences_timezone": "America/New_York",
"preferences_notifications": "email"
},
"company": {
"company_id": "comp_techstartup_2024",
"name": "TechStartup Inc.",
"industry": "SaaS",
"size": "50-100",
"location": "New York, NY",
"website": "https://techstartup.com",
"subscription_tier": "Enterprise",
"annual_revenue": "$5M-$10M",
"founded_year": "2020",
"primary_product": "Project Management Platform",
"customer_count": 2500,
"team_engineering": 25,
"team_sales": 15,
"team_marketing": 8,
"team_support": 12
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: 'user_789456',
metadata: {
name: 'Sarah Johnson',
email: 'sarah.johnson@techstartup.com',
job_title: 'Product Manager',
department: 'Product',
location: 'New York, NY',
hire_date: '2022-03-15',
years_experience: 8,
skills: 'Product Strategy, User Research, Agile',
subscription_plan: 'Pro',
last_login: '2024-01-15T10:30:00Z',
preferences_language: 'en',
preferences_timezone: 'America/New_York',
preferences_notifications: 'email'
},
company: {
company_id: 'comp_techstartup_2024',
name: 'TechStartup Inc.',
industry: 'SaaS',
size: '50-100',
location: 'New York, NY',
website: 'https://techstartup.com',
subscription_tier: 'Enterprise',
annual_revenue: '$5M-$10M',
founded_year: '2020',
primary_product: 'Project Management Platform',
customer_count: 2500,
team_engineering: 25,
team_sales: 15,
team_marketing: 8,
team_support: 12
}
})
};
fetch('https://{environment}.userpilot.io/v1/identify', 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://{environment}.userpilot.io/v1/identify",
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([
'user_id' => 'user_789456',
'metadata' => [
'name' => 'Sarah Johnson',
'email' => 'sarah.johnson@techstartup.com',
'job_title' => 'Product Manager',
'department' => 'Product',
'location' => 'New York, NY',
'hire_date' => '2022-03-15',
'years_experience' => 8,
'skills' => 'Product Strategy, User Research, Agile',
'subscription_plan' => 'Pro',
'last_login' => '2024-01-15T10:30:00Z',
'preferences_language' => 'en',
'preferences_timezone' => 'America/New_York',
'preferences_notifications' => 'email'
],
'company' => [
'company_id' => 'comp_techstartup_2024',
'name' => 'TechStartup Inc.',
'industry' => 'SaaS',
'size' => '50-100',
'location' => 'New York, NY',
'website' => 'https://techstartup.com',
'subscription_tier' => 'Enterprise',
'annual_revenue' => '$5M-$10M',
'founded_year' => '2020',
'primary_product' => 'Project Management Platform',
'customer_count' => 2500,
'team_engineering' => 25,
'team_sales' => 15,
'team_marketing' => 8,
'team_support' => 12
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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://{environment}.userpilot.io/v1/identify"
payload := strings.NewReader("{\n \"user_id\": \"user_789456\",\n \"metadata\": {\n \"name\": \"Sarah Johnson\",\n \"email\": \"sarah.johnson@techstartup.com\",\n \"job_title\": \"Product Manager\",\n \"department\": \"Product\",\n \"location\": \"New York, NY\",\n \"hire_date\": \"2022-03-15\",\n \"years_experience\": 8,\n \"skills\": \"Product Strategy, User Research, Agile\",\n \"subscription_plan\": \"Pro\",\n \"last_login\": \"2024-01-15T10:30:00Z\",\n \"preferences_language\": \"en\",\n \"preferences_timezone\": \"America/New_York\",\n \"preferences_notifications\": \"email\"\n },\n \"company\": {\n \"company_id\": \"comp_techstartup_2024\",\n \"name\": \"TechStartup Inc.\",\n \"industry\": \"SaaS\",\n \"size\": \"50-100\",\n \"location\": \"New York, NY\",\n \"website\": \"https://techstartup.com\",\n \"subscription_tier\": \"Enterprise\",\n \"annual_revenue\": \"$5M-$10M\",\n \"founded_year\": \"2020\",\n \"primary_product\": \"Project Management Platform\",\n \"customer_count\": 2500,\n \"team_engineering\": 25,\n \"team_sales\": 15,\n \"team_marketing\": 8,\n \"team_support\": 12\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{environment}.userpilot.io/v1/identify")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"user_789456\",\n \"metadata\": {\n \"name\": \"Sarah Johnson\",\n \"email\": \"sarah.johnson@techstartup.com\",\n \"job_title\": \"Product Manager\",\n \"department\": \"Product\",\n \"location\": \"New York, NY\",\n \"hire_date\": \"2022-03-15\",\n \"years_experience\": 8,\n \"skills\": \"Product Strategy, User Research, Agile\",\n \"subscription_plan\": \"Pro\",\n \"last_login\": \"2024-01-15T10:30:00Z\",\n \"preferences_language\": \"en\",\n \"preferences_timezone\": \"America/New_York\",\n \"preferences_notifications\": \"email\"\n },\n \"company\": {\n \"company_id\": \"comp_techstartup_2024\",\n \"name\": \"TechStartup Inc.\",\n \"industry\": \"SaaS\",\n \"size\": \"50-100\",\n \"location\": \"New York, NY\",\n \"website\": \"https://techstartup.com\",\n \"subscription_tier\": \"Enterprise\",\n \"annual_revenue\": \"$5M-$10M\",\n \"founded_year\": \"2020\",\n \"primary_product\": \"Project Management Platform\",\n \"customer_count\": 2500,\n \"team_engineering\": 25,\n \"team_sales\": 15,\n \"team_marketing\": 8,\n \"team_support\": 12\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.userpilot.io/v1/identify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"user_789456\",\n \"metadata\": {\n \"name\": \"Sarah Johnson\",\n \"email\": \"sarah.johnson@techstartup.com\",\n \"job_title\": \"Product Manager\",\n \"department\": \"Product\",\n \"location\": \"New York, NY\",\n \"hire_date\": \"2022-03-15\",\n \"years_experience\": 8,\n \"skills\": \"Product Strategy, User Research, Agile\",\n \"subscription_plan\": \"Pro\",\n \"last_login\": \"2024-01-15T10:30:00Z\",\n \"preferences_language\": \"en\",\n \"preferences_timezone\": \"America/New_York\",\n \"preferences_notifications\": \"email\"\n },\n \"company\": {\n \"company_id\": \"comp_techstartup_2024\",\n \"name\": \"TechStartup Inc.\",\n \"industry\": \"SaaS\",\n \"size\": \"50-100\",\n \"location\": \"New York, NY\",\n \"website\": \"https://techstartup.com\",\n \"subscription_tier\": \"Enterprise\",\n \"annual_revenue\": \"$5M-$10M\",\n \"founded_year\": \"2020\",\n \"primary_product\": \"Project Management Platform\",\n \"customer_count\": 2500,\n \"team_engineering\": 25,\n \"team_sales\": 15,\n \"team_marketing\": 8,\n \"team_support\": 12\n }\n}"
response = http.request(request)
puts response.read_body{
"errors": [
{
"details": "<string>",
"error": "<string>",
"error_code": "<string>",
"message": "<string>"
}
]
}Headers
API authentication token in the format: Token {{API_KEY}}
Obtain your API key from the Userpilot Environment Settings.
Body
application/json
The unique identifier for the user. This is the ID that Userpilot uses to identify the user.
Example:
"123987"
Optional user metadata. You can add, remove, or modify any properties as needed for your use case. Note: Only string values are supported (numbers and dates should be sent as strings).
Show child attributes
Show child attributes
Company information. If provided, company_id is required. Additional company properties are optional metadata.
Show child attributes
Show child attributes
Response
401 - application/json
Unauthorized - Invalid API key
Show child attributes
Show child attributes
Was this page helpful?
āI