Update a deal
curl --request PUT \
--url https://app.leonar.app/api/v1/deals/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"signed_amount": 123,
"currency": "<string>",
"expected_amount": 123,
"expected_close_date": "2023-12-25",
"probability": 123,
"custom_data": {}
}
'import requests
url = "https://app.leonar.app/api/v1/deals/{id}"
payload = {
"title": "<string>",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"signed_amount": 123,
"currency": "<string>",
"expected_amount": 123,
"expected_close_date": "2023-12-25",
"probability": 123,
"custom_data": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
company_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
contact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
owner_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
primary_source_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: 123,
signed_amount: 123,
currency: '<string>',
expected_amount: 123,
expected_close_date: '2023-12-25',
probability: 123,
custom_data: {}
})
};
fetch('https://app.leonar.app/api/v1/deals/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'company_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'contact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'owner_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'primary_source_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => 123,
'signed_amount' => 123,
'currency' => '<string>',
'expected_amount' => 123,
'expected_close_date' => '2023-12-25',
'probability' => 123,
'custom_data' => [
]
]),
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/{id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"primary_source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"signed_amount\": 123,\n \"currency\": \"<string>\",\n \"expected_amount\": 123,\n \"expected_close_date\": \"2023-12-25\",\n \"probability\": 123,\n \"custom_data\": {}\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.leonar.app/api/v1/deals/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"primary_source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"signed_amount\": 123,\n \"currency\": \"<string>\",\n \"expected_amount\": 123,\n \"expected_close_date\": \"2023-12-25\",\n \"probability\": 123,\n \"custom_data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.leonar.app/api/v1/deals/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"primary_source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"signed_amount\": 123,\n \"currency\": \"<string>\",\n \"expected_amount\": 123,\n \"expected_close_date\": \"2023-12-25\",\n \"probability\": 123,\n \"custom_data\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"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
}
}{
"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
Update a deal
PUT
/
deals
/
{id}
Update a deal
curl --request PUT \
--url https://app.leonar.app/api/v1/deals/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"signed_amount": 123,
"currency": "<string>",
"expected_amount": 123,
"expected_close_date": "2023-12-25",
"probability": 123,
"custom_data": {}
}
'import requests
url = "https://app.leonar.app/api/v1/deals/{id}"
payload = {
"title": "<string>",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"signed_amount": 123,
"currency": "<string>",
"expected_amount": 123,
"expected_close_date": "2023-12-25",
"probability": 123,
"custom_data": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
company_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
contact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
owner_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
primary_source_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: 123,
signed_amount: 123,
currency: '<string>',
expected_amount: 123,
expected_close_date: '2023-12-25',
probability: 123,
custom_data: {}
})
};
fetch('https://app.leonar.app/api/v1/deals/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'company_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'contact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'owner_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'primary_source_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => 123,
'signed_amount' => 123,
'currency' => '<string>',
'expected_amount' => 123,
'expected_close_date' => '2023-12-25',
'probability' => 123,
'custom_data' => [
]
]),
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/{id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"primary_source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"signed_amount\": 123,\n \"currency\": \"<string>\",\n \"expected_amount\": 123,\n \"expected_close_date\": \"2023-12-25\",\n \"probability\": 123,\n \"custom_data\": {}\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.leonar.app/api/v1/deals/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"primary_source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"signed_amount\": 123,\n \"currency\": \"<string>\",\n \"expected_amount\": 123,\n \"expected_close_date\": \"2023-12-25\",\n \"probability\": 123,\n \"custom_data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.leonar.app/api/v1/deals/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"primary_source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"signed_amount\": 123,\n \"currency\": \"<string>\",\n \"expected_amount\": 123,\n \"expected_close_date\": \"2023-12-25\",\n \"probability\": 123,\n \"custom_data\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"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
}
}{
"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_
Path Parameters
Deal ID
Body
application/json
Set to a source definition ID, or null to clear the primary source.
Response
Deal updated
Show child attributes
Show child attributes
Example:
{ "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 }
⌘I