Users - Bulk Identify and Update
curl --request POST \
--url https://{environment}.userpilot.io/v1/users/bulk_identify \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"users": [
{
"user_id": "user_123",
"company_id": "comp_techstartup_2024",
"metadata": {
"name": "John Smith",
"email": "john.smith@techstartup.com",
"job_title": "Support Manager",
"tickets_created": "2024-01-15T08:00:00Z",
"tickets_resolved": "2024-01-15T16:30:00Z",
"tickets_pending": 3,
"avg_resolution_time": 3.25,
"customer_satisfaction": "95%",
"escalation_count": 10
}
},
{
"user_id": "user_456",
"company_id": "comp_techstartup_2024",
"metadata": {
"name": "Emma Davis",
"email": "emma.davis@techstartup.com",
"job_title": "Support Specialist",
"tickets_created": "2024-01-15T09:15:00Z",
"tickets_resolved": "2024-01-15T17:45:00Z",
"tickets_pending": 5,
"avg_resolution_time": 4.5,
"customer_satisfaction": "92%",
"escalation_count": 8
}
}
]
}
'import requests
url = "https://{environment}.userpilot.io/v1/users/bulk_identify"
payload = { "users": [
{
"user_id": "user_123",
"company_id": "comp_techstartup_2024",
"metadata": {
"name": "John Smith",
"email": "john.smith@techstartup.com",
"job_title": "Support Manager",
"tickets_created": "2024-01-15T08:00:00Z",
"tickets_resolved": "2024-01-15T16:30:00Z",
"tickets_pending": 3,
"avg_resolution_time": 3.25,
"customer_satisfaction": "95%",
"escalation_count": 10
}
},
{
"user_id": "user_456",
"company_id": "comp_techstartup_2024",
"metadata": {
"name": "Emma Davis",
"email": "emma.davis@techstartup.com",
"job_title": "Support Specialist",
"tickets_created": "2024-01-15T09:15:00Z",
"tickets_resolved": "2024-01-15T17:45:00Z",
"tickets_pending": 5,
"avg_resolution_time": 4.5,
"customer_satisfaction": "92%",
"escalation_count": 8
}
}
] }
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({
users: [
{
user_id: 'user_123',
company_id: 'comp_techstartup_2024',
metadata: {
name: 'John Smith',
email: 'john.smith@techstartup.com',
job_title: 'Support Manager',
tickets_created: '2024-01-15T08:00:00Z',
tickets_resolved: '2024-01-15T16:30:00Z',
tickets_pending: 3,
avg_resolution_time: 3.25,
customer_satisfaction: '95%',
escalation_count: 10
}
},
{
user_id: 'user_456',
company_id: 'comp_techstartup_2024',
metadata: {
name: 'Emma Davis',
email: 'emma.davis@techstartup.com',
job_title: 'Support Specialist',
tickets_created: '2024-01-15T09:15:00Z',
tickets_resolved: '2024-01-15T17:45:00Z',
tickets_pending: 5,
avg_resolution_time: 4.5,
customer_satisfaction: '92%',
escalation_count: 8
}
}
]
})
};
fetch('https://{environment}.userpilot.io/v1/users/bulk_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/users/bulk_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([
'users' => [
[
'user_id' => 'user_123',
'company_id' => 'comp_techstartup_2024',
'metadata' => [
'name' => 'John Smith',
'email' => 'john.smith@techstartup.com',
'job_title' => 'Support Manager',
'tickets_created' => '2024-01-15T08:00:00Z',
'tickets_resolved' => '2024-01-15T16:30:00Z',
'tickets_pending' => 3,
'avg_resolution_time' => 3.25,
'customer_satisfaction' => '95%',
'escalation_count' => 10
]
],
[
'user_id' => 'user_456',
'company_id' => 'comp_techstartup_2024',
'metadata' => [
'name' => 'Emma Davis',
'email' => 'emma.davis@techstartup.com',
'job_title' => 'Support Specialist',
'tickets_created' => '2024-01-15T09:15:00Z',
'tickets_resolved' => '2024-01-15T17:45:00Z',
'tickets_pending' => 5,
'avg_resolution_time' => 4.5,
'customer_satisfaction' => '92%',
'escalation_count' => 8
]
]
]
]),
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/users/bulk_identify"
payload := strings.NewReader("{\n \"users\": [\n {\n \"user_id\": \"user_123\",\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"John Smith\",\n \"email\": \"john.smith@techstartup.com\",\n \"job_title\": \"Support Manager\",\n \"tickets_created\": \"2024-01-15T08:00:00Z\",\n \"tickets_resolved\": \"2024-01-15T16:30:00Z\",\n \"tickets_pending\": 3,\n \"avg_resolution_time\": 3.25,\n \"customer_satisfaction\": \"95%\",\n \"escalation_count\": 10\n }\n },\n {\n \"user_id\": \"user_456\",\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"Emma Davis\",\n \"email\": \"emma.davis@techstartup.com\",\n \"job_title\": \"Support Specialist\",\n \"tickets_created\": \"2024-01-15T09:15:00Z\",\n \"tickets_resolved\": \"2024-01-15T17:45:00Z\",\n \"tickets_pending\": 5,\n \"avg_resolution_time\": 4.5,\n \"customer_satisfaction\": \"92%\",\n \"escalation_count\": 8\n }\n }\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/users/bulk_identify")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"users\": [\n {\n \"user_id\": \"user_123\",\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"John Smith\",\n \"email\": \"john.smith@techstartup.com\",\n \"job_title\": \"Support Manager\",\n \"tickets_created\": \"2024-01-15T08:00:00Z\",\n \"tickets_resolved\": \"2024-01-15T16:30:00Z\",\n \"tickets_pending\": 3,\n \"avg_resolution_time\": 3.25,\n \"customer_satisfaction\": \"95%\",\n \"escalation_count\": 10\n }\n },\n {\n \"user_id\": \"user_456\",\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"Emma Davis\",\n \"email\": \"emma.davis@techstartup.com\",\n \"job_title\": \"Support Specialist\",\n \"tickets_created\": \"2024-01-15T09:15:00Z\",\n \"tickets_resolved\": \"2024-01-15T17:45:00Z\",\n \"tickets_pending\": 5,\n \"avg_resolution_time\": 4.5,\n \"customer_satisfaction\": \"92%\",\n \"escalation_count\": 8\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.userpilot.io/v1/users/bulk_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 \"users\": [\n {\n \"user_id\": \"user_123\",\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"John Smith\",\n \"email\": \"john.smith@techstartup.com\",\n \"job_title\": \"Support Manager\",\n \"tickets_created\": \"2024-01-15T08:00:00Z\",\n \"tickets_resolved\": \"2024-01-15T16:30:00Z\",\n \"tickets_pending\": 3,\n \"avg_resolution_time\": 3.25,\n \"customer_satisfaction\": \"95%\",\n \"escalation_count\": 10\n }\n },\n {\n \"user_id\": \"user_456\",\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"Emma Davis\",\n \"email\": \"emma.davis@techstartup.com\",\n \"job_title\": \"Support Specialist\",\n \"tickets_created\": \"2024-01-15T09:15:00Z\",\n \"tickets_resolved\": \"2024-01-15T17:45:00Z\",\n \"tickets_pending\": 5,\n \"avg_resolution_time\": 4.5,\n \"customer_satisfaction\": \"92%\",\n \"escalation_count\": 8\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"end_time": null,
"file_size": 123,
"filename": "<string>",
"job_id": "<string>",
"links": "<string>",
"start_time": "<string>",
"total_rows": 123,
"type": "<string>"
}Endpoints
Bulk Users Update
Create or update multiple user profiles in a single API request using the bulk_identify endpoint.
POST
/
v1
/
users
/
bulk_identify
Users - Bulk Identify and Update
curl --request POST \
--url https://{environment}.userpilot.io/v1/users/bulk_identify \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"users": [
{
"user_id": "user_123",
"company_id": "comp_techstartup_2024",
"metadata": {
"name": "John Smith",
"email": "john.smith@techstartup.com",
"job_title": "Support Manager",
"tickets_created": "2024-01-15T08:00:00Z",
"tickets_resolved": "2024-01-15T16:30:00Z",
"tickets_pending": 3,
"avg_resolution_time": 3.25,
"customer_satisfaction": "95%",
"escalation_count": 10
}
},
{
"user_id": "user_456",
"company_id": "comp_techstartup_2024",
"metadata": {
"name": "Emma Davis",
"email": "emma.davis@techstartup.com",
"job_title": "Support Specialist",
"tickets_created": "2024-01-15T09:15:00Z",
"tickets_resolved": "2024-01-15T17:45:00Z",
"tickets_pending": 5,
"avg_resolution_time": 4.5,
"customer_satisfaction": "92%",
"escalation_count": 8
}
}
]
}
'import requests
url = "https://{environment}.userpilot.io/v1/users/bulk_identify"
payload = { "users": [
{
"user_id": "user_123",
"company_id": "comp_techstartup_2024",
"metadata": {
"name": "John Smith",
"email": "john.smith@techstartup.com",
"job_title": "Support Manager",
"tickets_created": "2024-01-15T08:00:00Z",
"tickets_resolved": "2024-01-15T16:30:00Z",
"tickets_pending": 3,
"avg_resolution_time": 3.25,
"customer_satisfaction": "95%",
"escalation_count": 10
}
},
{
"user_id": "user_456",
"company_id": "comp_techstartup_2024",
"metadata": {
"name": "Emma Davis",
"email": "emma.davis@techstartup.com",
"job_title": "Support Specialist",
"tickets_created": "2024-01-15T09:15:00Z",
"tickets_resolved": "2024-01-15T17:45:00Z",
"tickets_pending": 5,
"avg_resolution_time": 4.5,
"customer_satisfaction": "92%",
"escalation_count": 8
}
}
] }
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({
users: [
{
user_id: 'user_123',
company_id: 'comp_techstartup_2024',
metadata: {
name: 'John Smith',
email: 'john.smith@techstartup.com',
job_title: 'Support Manager',
tickets_created: '2024-01-15T08:00:00Z',
tickets_resolved: '2024-01-15T16:30:00Z',
tickets_pending: 3,
avg_resolution_time: 3.25,
customer_satisfaction: '95%',
escalation_count: 10
}
},
{
user_id: 'user_456',
company_id: 'comp_techstartup_2024',
metadata: {
name: 'Emma Davis',
email: 'emma.davis@techstartup.com',
job_title: 'Support Specialist',
tickets_created: '2024-01-15T09:15:00Z',
tickets_resolved: '2024-01-15T17:45:00Z',
tickets_pending: 5,
avg_resolution_time: 4.5,
customer_satisfaction: '92%',
escalation_count: 8
}
}
]
})
};
fetch('https://{environment}.userpilot.io/v1/users/bulk_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/users/bulk_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([
'users' => [
[
'user_id' => 'user_123',
'company_id' => 'comp_techstartup_2024',
'metadata' => [
'name' => 'John Smith',
'email' => 'john.smith@techstartup.com',
'job_title' => 'Support Manager',
'tickets_created' => '2024-01-15T08:00:00Z',
'tickets_resolved' => '2024-01-15T16:30:00Z',
'tickets_pending' => 3,
'avg_resolution_time' => 3.25,
'customer_satisfaction' => '95%',
'escalation_count' => 10
]
],
[
'user_id' => 'user_456',
'company_id' => 'comp_techstartup_2024',
'metadata' => [
'name' => 'Emma Davis',
'email' => 'emma.davis@techstartup.com',
'job_title' => 'Support Specialist',
'tickets_created' => '2024-01-15T09:15:00Z',
'tickets_resolved' => '2024-01-15T17:45:00Z',
'tickets_pending' => 5,
'avg_resolution_time' => 4.5,
'customer_satisfaction' => '92%',
'escalation_count' => 8
]
]
]
]),
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/users/bulk_identify"
payload := strings.NewReader("{\n \"users\": [\n {\n \"user_id\": \"user_123\",\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"John Smith\",\n \"email\": \"john.smith@techstartup.com\",\n \"job_title\": \"Support Manager\",\n \"tickets_created\": \"2024-01-15T08:00:00Z\",\n \"tickets_resolved\": \"2024-01-15T16:30:00Z\",\n \"tickets_pending\": 3,\n \"avg_resolution_time\": 3.25,\n \"customer_satisfaction\": \"95%\",\n \"escalation_count\": 10\n }\n },\n {\n \"user_id\": \"user_456\",\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"Emma Davis\",\n \"email\": \"emma.davis@techstartup.com\",\n \"job_title\": \"Support Specialist\",\n \"tickets_created\": \"2024-01-15T09:15:00Z\",\n \"tickets_resolved\": \"2024-01-15T17:45:00Z\",\n \"tickets_pending\": 5,\n \"avg_resolution_time\": 4.5,\n \"customer_satisfaction\": \"92%\",\n \"escalation_count\": 8\n }\n }\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/users/bulk_identify")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"users\": [\n {\n \"user_id\": \"user_123\",\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"John Smith\",\n \"email\": \"john.smith@techstartup.com\",\n \"job_title\": \"Support Manager\",\n \"tickets_created\": \"2024-01-15T08:00:00Z\",\n \"tickets_resolved\": \"2024-01-15T16:30:00Z\",\n \"tickets_pending\": 3,\n \"avg_resolution_time\": 3.25,\n \"customer_satisfaction\": \"95%\",\n \"escalation_count\": 10\n }\n },\n {\n \"user_id\": \"user_456\",\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"Emma Davis\",\n \"email\": \"emma.davis@techstartup.com\",\n \"job_title\": \"Support Specialist\",\n \"tickets_created\": \"2024-01-15T09:15:00Z\",\n \"tickets_resolved\": \"2024-01-15T17:45:00Z\",\n \"tickets_pending\": 5,\n \"avg_resolution_time\": 4.5,\n \"customer_satisfaction\": \"92%\",\n \"escalation_count\": 8\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.userpilot.io/v1/users/bulk_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 \"users\": [\n {\n \"user_id\": \"user_123\",\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"John Smith\",\n \"email\": \"john.smith@techstartup.com\",\n \"job_title\": \"Support Manager\",\n \"tickets_created\": \"2024-01-15T08:00:00Z\",\n \"tickets_resolved\": \"2024-01-15T16:30:00Z\",\n \"tickets_pending\": 3,\n \"avg_resolution_time\": 3.25,\n \"customer_satisfaction\": \"95%\",\n \"escalation_count\": 10\n }\n },\n {\n \"user_id\": \"user_456\",\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"Emma Davis\",\n \"email\": \"emma.davis@techstartup.com\",\n \"job_title\": \"Support Specialist\",\n \"tickets_created\": \"2024-01-15T09:15:00Z\",\n \"tickets_resolved\": \"2024-01-15T17:45:00Z\",\n \"tickets_pending\": 5,\n \"avg_resolution_time\": 4.5,\n \"customer_satisfaction\": \"92%\",\n \"escalation_count\": 8\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"end_time": null,
"file_size": 123,
"filename": "<string>",
"job_id": "<string>",
"links": "<string>",
"start_time": "<string>",
"total_rows": 123,
"type": "<string>"
}Headers
API authentication token in the format: Token {{API_KEY}}
Obtain your API key from the Userpilot Environment Settings.
Body
application/json
Show child attributes
Show child attributes
Was this page helpful?
⌘I