Create a company
curl --request POST \
--url https://app.leonar.app/api/v1/companies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Doctolib",
"domain": "doctolib.com",
"industry": "Health Tech",
"company_size": "1001-5000",
"location": "Paris, France",
"status_id": "550e8400-e29b-41d4-a716-446655440000",
"custom_data": {
"crm_tier": "enterprise"
}
}
'import requests
url = "https://app.leonar.app/api/v1/companies"
payload = {
"name": "Doctolib",
"domain": "doctolib.com",
"industry": "Health Tech",
"company_size": "1001-5000",
"location": "Paris, France",
"status_id": "550e8400-e29b-41d4-a716-446655440000",
"custom_data": { "crm_tier": "enterprise" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Doctolib',
domain: 'doctolib.com',
industry: 'Health Tech',
company_size: '1001-5000',
location: 'Paris, France',
status_id: '550e8400-e29b-41d4-a716-446655440000',
custom_data: {crm_tier: 'enterprise'}
})
};
fetch('https://app.leonar.app/api/v1/companies', 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://app.leonar.app/api/v1/companies",
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' => 'Doctolib',
'domain' => 'doctolib.com',
'industry' => 'Health Tech',
'company_size' => '1001-5000',
'location' => 'Paris, France',
'status_id' => '550e8400-e29b-41d4-a716-446655440000',
'custom_data' => [
'crm_tier' => 'enterprise'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.leonar.app/api/v1/companies"
payload := strings.NewReader("{\n \"name\": \"Doctolib\",\n \"domain\": \"doctolib.com\",\n \"industry\": \"Health Tech\",\n \"company_size\": \"1001-5000\",\n \"location\": \"Paris, France\",\n \"status_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"custom_data\": {\n \"crm_tier\": \"enterprise\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.leonar.app/api/v1/companies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Doctolib\",\n \"domain\": \"doctolib.com\",\n \"industry\": \"Health Tech\",\n \"company_size\": \"1001-5000\",\n \"location\": \"Paris, France\",\n \"status_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"custom_data\": {\n \"crm_tier\": \"enterprise\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.leonar.app/api/v1/companies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Doctolib\",\n \"domain\": \"doctolib.com\",\n \"industry\": \"Health Tech\",\n \"company_size\": \"1001-5000\",\n \"location\": \"Paris, France\",\n \"status_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"custom_data\": {\n \"crm_tier\": \"enterprise\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "b2c3d4e5-6789-01ab-cdef-234567890abc",
"name": "Doctolib",
"domain": "doctolib.com",
"industry": "Health Tech",
"company_size": "1001-5000",
"description": null,
"location": "Paris, France",
"logo_url": "https://logo.clearbit.com/doctolib.com",
"phone": null,
"linkedin_url": "https://www.linkedin.com/company/doctolib",
"annual_revenue": null,
"owner_id": null,
"status_id": "550e8400-e29b-41d4-a716-446655440000",
"status": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Customer",
"color": "#22c55e",
"position": 1,
"is_default": false
},
"custom_data": {
"crm_tier": "enterprise"
},
"created_at": "2025-01-10T08:00:00Z",
"updated_at": "2025-01-20T14:00:00Z",
"archived_at": null
}
}{
"error": {
"code": "validation_error",
"message": "Invalid input"
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key"
}
}Companies
Create a company
POST
/
companies
Create a company
curl --request POST \
--url https://app.leonar.app/api/v1/companies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Doctolib",
"domain": "doctolib.com",
"industry": "Health Tech",
"company_size": "1001-5000",
"location": "Paris, France",
"status_id": "550e8400-e29b-41d4-a716-446655440000",
"custom_data": {
"crm_tier": "enterprise"
}
}
'import requests
url = "https://app.leonar.app/api/v1/companies"
payload = {
"name": "Doctolib",
"domain": "doctolib.com",
"industry": "Health Tech",
"company_size": "1001-5000",
"location": "Paris, France",
"status_id": "550e8400-e29b-41d4-a716-446655440000",
"custom_data": { "crm_tier": "enterprise" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Doctolib',
domain: 'doctolib.com',
industry: 'Health Tech',
company_size: '1001-5000',
location: 'Paris, France',
status_id: '550e8400-e29b-41d4-a716-446655440000',
custom_data: {crm_tier: 'enterprise'}
})
};
fetch('https://app.leonar.app/api/v1/companies', 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://app.leonar.app/api/v1/companies",
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' => 'Doctolib',
'domain' => 'doctolib.com',
'industry' => 'Health Tech',
'company_size' => '1001-5000',
'location' => 'Paris, France',
'status_id' => '550e8400-e29b-41d4-a716-446655440000',
'custom_data' => [
'crm_tier' => 'enterprise'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.leonar.app/api/v1/companies"
payload := strings.NewReader("{\n \"name\": \"Doctolib\",\n \"domain\": \"doctolib.com\",\n \"industry\": \"Health Tech\",\n \"company_size\": \"1001-5000\",\n \"location\": \"Paris, France\",\n \"status_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"custom_data\": {\n \"crm_tier\": \"enterprise\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.leonar.app/api/v1/companies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Doctolib\",\n \"domain\": \"doctolib.com\",\n \"industry\": \"Health Tech\",\n \"company_size\": \"1001-5000\",\n \"location\": \"Paris, France\",\n \"status_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"custom_data\": {\n \"crm_tier\": \"enterprise\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.leonar.app/api/v1/companies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Doctolib\",\n \"domain\": \"doctolib.com\",\n \"industry\": \"Health Tech\",\n \"company_size\": \"1001-5000\",\n \"location\": \"Paris, France\",\n \"status_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"custom_data\": {\n \"crm_tier\": \"enterprise\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "b2c3d4e5-6789-01ab-cdef-234567890abc",
"name": "Doctolib",
"domain": "doctolib.com",
"industry": "Health Tech",
"company_size": "1001-5000",
"description": null,
"location": "Paris, France",
"logo_url": "https://logo.clearbit.com/doctolib.com",
"phone": null,
"linkedin_url": "https://www.linkedin.com/company/doctolib",
"annual_revenue": null,
"owner_id": null,
"status_id": "550e8400-e29b-41d4-a716-446655440000",
"status": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Customer",
"color": "#22c55e",
"position": 1,
"is_default": false
},
"custom_data": {
"crm_tier": "enterprise"
},
"created_at": "2025-01-10T08:00:00Z",
"updated_at": "2025-01-20T14:00:00Z",
"archived_at": null
}
}{
"error": {
"code": "validation_error",
"message": "Invalid input"
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key"
}
}Authorizations
API key starting with leo_
Body
application/json
Maximum string length:
255Maximum string length:
255Maximum string length:
100Maximum string length:
50Maximum string length:
5000Maximum string length:
500Maximum string length:
50Company status ID. Must belong to the API key workspace.
Custom field values indexed by custom field key.
Values are validated against workspace custom field definitions.
Response
Company created
Show child attributes
Show child attributes
Example:
{
"id": "b2c3d4e5-6789-01ab-cdef-234567890abc",
"name": "Doctolib",
"domain": "doctolib.com",
"industry": "Health Tech",
"company_size": "1001-5000",
"description": null,
"location": "Paris, France",
"logo_url": "https://logo.clearbit.com/doctolib.com",
"phone": null,
"linkedin_url": "https://www.linkedin.com/company/doctolib",
"annual_revenue": null,
"owner_id": null,
"status_id": "550e8400-e29b-41d4-a716-446655440000",
"status": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Customer",
"color": "#22c55e",
"position": 1,
"is_default": false
},
"custom_data": { "crm_tier": "enterprise" },
"created_at": "2025-01-10T08:00:00Z",
"updated_at": "2025-01-20T14:00:00Z",
"archived_at": null
}
⌘I