Identify Company
curl --request POST \
--url https://{environment}.userpilot.io/v1/companies/identify \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"company_id": "comp_techstartup_2024",
"metadata": {
"name": "Acme Corporation",
"industry": "Technology",
"size": "100-500",
"location": "San Francisco, CA",
"website": "https://acme.com",
"subscription_tier": "Enterprise",
"annual_revenue": "$10M-$50M",
"founded_year": "2020"
}
}
'import requests
url = "https://{environment}.userpilot.io/v1/companies/identify"
payload = {
"company_id": "comp_techstartup_2024",
"metadata": {
"name": "Acme Corporation",
"industry": "Technology",
"size": "100-500",
"location": "San Francisco, CA",
"website": "https://acme.com",
"subscription_tier": "Enterprise",
"annual_revenue": "$10M-$50M",
"founded_year": "2020"
}
}
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({
company_id: 'comp_techstartup_2024',
metadata: {
name: 'Acme Corporation',
industry: 'Technology',
size: '100-500',
location: 'San Francisco, CA',
website: 'https://acme.com',
subscription_tier: 'Enterprise',
annual_revenue: '$10M-$50M',
founded_year: '2020'
}
})
};
fetch('https://{environment}.userpilot.io/v1/companies/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/companies/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([
'company_id' => 'comp_techstartup_2024',
'metadata' => [
'name' => 'Acme Corporation',
'industry' => 'Technology',
'size' => '100-500',
'location' => 'San Francisco, CA',
'website' => 'https://acme.com',
'subscription_tier' => 'Enterprise',
'annual_revenue' => '$10M-$50M',
'founded_year' => '2020'
]
]),
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/companies/identify"
payload := strings.NewReader("{\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"Acme Corporation\",\n \"industry\": \"Technology\",\n \"size\": \"100-500\",\n \"location\": \"San Francisco, CA\",\n \"website\": \"https://acme.com\",\n \"subscription_tier\": \"Enterprise\",\n \"annual_revenue\": \"$10M-$50M\",\n \"founded_year\": \"2020\"\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/companies/identify")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"Acme Corporation\",\n \"industry\": \"Technology\",\n \"size\": \"100-500\",\n \"location\": \"San Francisco, CA\",\n \"website\": \"https://acme.com\",\n \"subscription_tier\": \"Enterprise\",\n \"annual_revenue\": \"$10M-$50M\",\n \"founded_year\": \"2020\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.userpilot.io/v1/companies/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 \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"Acme Corporation\",\n \"industry\": \"Technology\",\n \"size\": \"100-500\",\n \"location\": \"San Francisco, CA\",\n \"website\": \"https://acme.com\",\n \"subscription_tier\": \"Enterprise\",\n \"annual_revenue\": \"$10M-$50M\",\n \"founded_year\": \"2020\"\n }\n}"
response = http.request(request)
puts response.read_body{
"errors": [
{
"details": "<string>",
"error": "<string>",
"error_code": "<string>",
"message": "<string>"
}
]
}{
"errors": [
{
"details": "<string>",
"error": "<string>",
"error_code": "<string>",
"message": "<string>"
}
]
}Endpoints
Identify Company
Create or update a company profile with properties like name, industry, and size via HTTP POST request.
POST
/
v1
/
companies
/
identify
Identify Company
curl --request POST \
--url https://{environment}.userpilot.io/v1/companies/identify \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"company_id": "comp_techstartup_2024",
"metadata": {
"name": "Acme Corporation",
"industry": "Technology",
"size": "100-500",
"location": "San Francisco, CA",
"website": "https://acme.com",
"subscription_tier": "Enterprise",
"annual_revenue": "$10M-$50M",
"founded_year": "2020"
}
}
'import requests
url = "https://{environment}.userpilot.io/v1/companies/identify"
payload = {
"company_id": "comp_techstartup_2024",
"metadata": {
"name": "Acme Corporation",
"industry": "Technology",
"size": "100-500",
"location": "San Francisco, CA",
"website": "https://acme.com",
"subscription_tier": "Enterprise",
"annual_revenue": "$10M-$50M",
"founded_year": "2020"
}
}
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({
company_id: 'comp_techstartup_2024',
metadata: {
name: 'Acme Corporation',
industry: 'Technology',
size: '100-500',
location: 'San Francisco, CA',
website: 'https://acme.com',
subscription_tier: 'Enterprise',
annual_revenue: '$10M-$50M',
founded_year: '2020'
}
})
};
fetch('https://{environment}.userpilot.io/v1/companies/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/companies/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([
'company_id' => 'comp_techstartup_2024',
'metadata' => [
'name' => 'Acme Corporation',
'industry' => 'Technology',
'size' => '100-500',
'location' => 'San Francisco, CA',
'website' => 'https://acme.com',
'subscription_tier' => 'Enterprise',
'annual_revenue' => '$10M-$50M',
'founded_year' => '2020'
]
]),
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/companies/identify"
payload := strings.NewReader("{\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"Acme Corporation\",\n \"industry\": \"Technology\",\n \"size\": \"100-500\",\n \"location\": \"San Francisco, CA\",\n \"website\": \"https://acme.com\",\n \"subscription_tier\": \"Enterprise\",\n \"annual_revenue\": \"$10M-$50M\",\n \"founded_year\": \"2020\"\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/companies/identify")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"Acme Corporation\",\n \"industry\": \"Technology\",\n \"size\": \"100-500\",\n \"location\": \"San Francisco, CA\",\n \"website\": \"https://acme.com\",\n \"subscription_tier\": \"Enterprise\",\n \"annual_revenue\": \"$10M-$50M\",\n \"founded_year\": \"2020\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.userpilot.io/v1/companies/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 \"company_id\": \"comp_techstartup_2024\",\n \"metadata\": {\n \"name\": \"Acme Corporation\",\n \"industry\": \"Technology\",\n \"size\": \"100-500\",\n \"location\": \"San Francisco, CA\",\n \"website\": \"https://acme.com\",\n \"subscription_tier\": \"Enterprise\",\n \"annual_revenue\": \"$10M-$50M\",\n \"founded_year\": \"2020\"\n }\n}"
response = http.request(request)
puts response.read_body{
"errors": [
{
"details": "<string>",
"error": "<string>",
"error_code": "<string>",
"message": "<string>"
}
]
}{
"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
Response
Accepted - Company identification successful
Was this page helpful?
āI