Create a deal from intake data
curl --request POST \
--url https://app.leonar.app/api/v1/deals/intake \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deal": {
"title": "Inbound demo request",
"stage_id": "e5f6a7b8-9012-34cd-efab-567890123def",
"primary_source_id": "a7b8c9d0-1234-56ef-abcd-789012345ef1",
"expected_amount": 12000,
"currency": "EUR"
},
"company": {
"name": "Acme",
"domain": "acme.com",
"industry": "SaaS"
},
"contact": {
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@acme.com",
"title": "VP Sales"
}
}
'import requests
url = "https://app.leonar.app/api/v1/deals/intake"
payload = {
"deal": {
"title": "Inbound demo request",
"stage_id": "e5f6a7b8-9012-34cd-efab-567890123def",
"primary_source_id": "a7b8c9d0-1234-56ef-abcd-789012345ef1",
"expected_amount": 12000,
"currency": "EUR"
},
"company": {
"name": "Acme",
"domain": "acme.com",
"industry": "SaaS"
},
"contact": {
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@acme.com",
"title": "VP Sales"
}
}
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({
deal: {
title: 'Inbound demo request',
stage_id: 'e5f6a7b8-9012-34cd-efab-567890123def',
primary_source_id: 'a7b8c9d0-1234-56ef-abcd-789012345ef1',
expected_amount: 12000,
currency: 'EUR'
},
company: {name: 'Acme', domain: 'acme.com', industry: 'SaaS'},
contact: {
first_name: 'Jane',
last_name: 'Doe',
email: 'jane@acme.com',
title: 'VP Sales'
}
})
};
fetch('https://app.leonar.app/api/v1/deals/intake', 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/deals/intake",
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([
'deal' => [
'title' => 'Inbound demo request',
'stage_id' => 'e5f6a7b8-9012-34cd-efab-567890123def',
'primary_source_id' => 'a7b8c9d0-1234-56ef-abcd-789012345ef1',
'expected_amount' => 12000,
'currency' => 'EUR'
],
'company' => [
'name' => 'Acme',
'domain' => 'acme.com',
'industry' => 'SaaS'
],
'contact' => [
'first_name' => 'Jane',
'last_name' => 'Doe',
'email' => 'jane@acme.com',
'title' => 'VP Sales'
]
]),
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/deals/intake"
payload := strings.NewReader("{\n \"deal\": {\n \"title\": \"Inbound demo request\",\n \"stage_id\": \"e5f6a7b8-9012-34cd-efab-567890123def\",\n \"primary_source_id\": \"a7b8c9d0-1234-56ef-abcd-789012345ef1\",\n \"expected_amount\": 12000,\n \"currency\": \"EUR\"\n },\n \"company\": {\n \"name\": \"Acme\",\n \"domain\": \"acme.com\",\n \"industry\": \"SaaS\"\n },\n \"contact\": {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"email\": \"jane@acme.com\",\n \"title\": \"VP Sales\"\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/deals/intake")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deal\": {\n \"title\": \"Inbound demo request\",\n \"stage_id\": \"e5f6a7b8-9012-34cd-efab-567890123def\",\n \"primary_source_id\": \"a7b8c9d0-1234-56ef-abcd-789012345ef1\",\n \"expected_amount\": 12000,\n \"currency\": \"EUR\"\n },\n \"company\": {\n \"name\": \"Acme\",\n \"domain\": \"acme.com\",\n \"industry\": \"SaaS\"\n },\n \"contact\": {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"email\": \"jane@acme.com\",\n \"title\": \"VP Sales\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.leonar.app/api/v1/deals/intake")
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 \"deal\": {\n \"title\": \"Inbound demo request\",\n \"stage_id\": \"e5f6a7b8-9012-34cd-efab-567890123def\",\n \"primary_source_id\": \"a7b8c9d0-1234-56ef-abcd-789012345ef1\",\n \"expected_amount\": 12000,\n \"currency\": \"EUR\"\n },\n \"company\": {\n \"name\": \"Acme\",\n \"domain\": \"acme.com\",\n \"industry\": \"SaaS\"\n },\n \"contact\": {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"email\": \"jane@acme.com\",\n \"title\": \"VP Sales\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"deal": {
"id": "c3d4e5f6-7890-12ab-cdef-345678901bcd",
"title": "Recruitment - 3 Senior Engineers",
"status": "open",
"amount": 45000,
"signed_amount": null,
"currency": "EUR",
"expected_amount": 45000,
"expected_close_date": "2025-03-15",
"probability": 60,
"pipeline_id": "d4e5f6a7-8901-23bc-defa-456789012cde",
"stage_id": "e5f6a7b8-9012-34cd-efab-567890123def",
"company_id": "b2c3d4e5-6789-01ab-cdef-234567890abc",
"owner_id": "f6a7b8c9-0123-45de-fabc-678901234ef0",
"primary_source_id": "a7b8c9d0-1234-56ef-abcd-789012345ef1",
"closed_at": null,
"created_at": "2025-02-01T10:00:00Z",
"updated_at": "2025-02-10T15:30:00Z",
"archived_at": null
},
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": true,
"name": "<string>"
},
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": true,
"name": "<string>"
}
}
}{
"error": {
"code": "validation_error",
"message": "Invalid input"
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found"
}
}Deals
Create a deal from intake data
Creates or reuses a company and contact, then creates a new deal in the requested stage. Company deduplication checks existing records by LinkedIn URL, domain, then name. Contact deduplication checks existing records by LinkedIn profile, email, then name + company.
POST
/
deals
/
intake
Create a deal from intake data
curl --request POST \
--url https://app.leonar.app/api/v1/deals/intake \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deal": {
"title": "Inbound demo request",
"stage_id": "e5f6a7b8-9012-34cd-efab-567890123def",
"primary_source_id": "a7b8c9d0-1234-56ef-abcd-789012345ef1",
"expected_amount": 12000,
"currency": "EUR"
},
"company": {
"name": "Acme",
"domain": "acme.com",
"industry": "SaaS"
},
"contact": {
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@acme.com",
"title": "VP Sales"
}
}
'import requests
url = "https://app.leonar.app/api/v1/deals/intake"
payload = {
"deal": {
"title": "Inbound demo request",
"stage_id": "e5f6a7b8-9012-34cd-efab-567890123def",
"primary_source_id": "a7b8c9d0-1234-56ef-abcd-789012345ef1",
"expected_amount": 12000,
"currency": "EUR"
},
"company": {
"name": "Acme",
"domain": "acme.com",
"industry": "SaaS"
},
"contact": {
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@acme.com",
"title": "VP Sales"
}
}
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({
deal: {
title: 'Inbound demo request',
stage_id: 'e5f6a7b8-9012-34cd-efab-567890123def',
primary_source_id: 'a7b8c9d0-1234-56ef-abcd-789012345ef1',
expected_amount: 12000,
currency: 'EUR'
},
company: {name: 'Acme', domain: 'acme.com', industry: 'SaaS'},
contact: {
first_name: 'Jane',
last_name: 'Doe',
email: 'jane@acme.com',
title: 'VP Sales'
}
})
};
fetch('https://app.leonar.app/api/v1/deals/intake', 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/deals/intake",
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([
'deal' => [
'title' => 'Inbound demo request',
'stage_id' => 'e5f6a7b8-9012-34cd-efab-567890123def',
'primary_source_id' => 'a7b8c9d0-1234-56ef-abcd-789012345ef1',
'expected_amount' => 12000,
'currency' => 'EUR'
],
'company' => [
'name' => 'Acme',
'domain' => 'acme.com',
'industry' => 'SaaS'
],
'contact' => [
'first_name' => 'Jane',
'last_name' => 'Doe',
'email' => 'jane@acme.com',
'title' => 'VP Sales'
]
]),
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/deals/intake"
payload := strings.NewReader("{\n \"deal\": {\n \"title\": \"Inbound demo request\",\n \"stage_id\": \"e5f6a7b8-9012-34cd-efab-567890123def\",\n \"primary_source_id\": \"a7b8c9d0-1234-56ef-abcd-789012345ef1\",\n \"expected_amount\": 12000,\n \"currency\": \"EUR\"\n },\n \"company\": {\n \"name\": \"Acme\",\n \"domain\": \"acme.com\",\n \"industry\": \"SaaS\"\n },\n \"contact\": {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"email\": \"jane@acme.com\",\n \"title\": \"VP Sales\"\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/deals/intake")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deal\": {\n \"title\": \"Inbound demo request\",\n \"stage_id\": \"e5f6a7b8-9012-34cd-efab-567890123def\",\n \"primary_source_id\": \"a7b8c9d0-1234-56ef-abcd-789012345ef1\",\n \"expected_amount\": 12000,\n \"currency\": \"EUR\"\n },\n \"company\": {\n \"name\": \"Acme\",\n \"domain\": \"acme.com\",\n \"industry\": \"SaaS\"\n },\n \"contact\": {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"email\": \"jane@acme.com\",\n \"title\": \"VP Sales\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.leonar.app/api/v1/deals/intake")
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 \"deal\": {\n \"title\": \"Inbound demo request\",\n \"stage_id\": \"e5f6a7b8-9012-34cd-efab-567890123def\",\n \"primary_source_id\": \"a7b8c9d0-1234-56ef-abcd-789012345ef1\",\n \"expected_amount\": 12000,\n \"currency\": \"EUR\"\n },\n \"company\": {\n \"name\": \"Acme\",\n \"domain\": \"acme.com\",\n \"industry\": \"SaaS\"\n },\n \"contact\": {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"email\": \"jane@acme.com\",\n \"title\": \"VP Sales\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"deal": {
"id": "c3d4e5f6-7890-12ab-cdef-345678901bcd",
"title": "Recruitment - 3 Senior Engineers",
"status": "open",
"amount": 45000,
"signed_amount": null,
"currency": "EUR",
"expected_amount": 45000,
"expected_close_date": "2025-03-15",
"probability": 60,
"pipeline_id": "d4e5f6a7-8901-23bc-defa-456789012cde",
"stage_id": "e5f6a7b8-9012-34cd-efab-567890123def",
"company_id": "b2c3d4e5-6789-01ab-cdef-234567890abc",
"owner_id": "f6a7b8c9-0123-45de-fabc-678901234ef0",
"primary_source_id": "a7b8c9d0-1234-56ef-abcd-789012345ef1",
"closed_at": null,
"created_at": "2025-02-01T10:00:00Z",
"updated_at": "2025-02-10T15:30:00Z",
"archived_at": null
},
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": true,
"name": "<string>"
},
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": true,
"name": "<string>"
}
}
}{
"error": {
"code": "validation_error",
"message": "Invalid input"
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found"
}
}Authorizations
API key starting with leo_
Body
application/json
Response
Deal intake processed
Show child attributes
Show child attributes
⌘I