curl --request PATCH \
--url https://api.example.com/deals/{deal_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"value": 123,
"stage_id": "<string>",
"owner_id": "<string>",
"close_date": "<string>",
"currency": "<string>",
"source": "<string>",
"champion_id": "<string>",
"notes": "<string>",
"win_probability": 123,
"close_reason": "<string>",
"close_notes": "<string>",
"actual_close": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.example.com/deals/{deal_id}"
payload = {
"name": "<string>",
"value": 123,
"stage_id": "<string>",
"owner_id": "<string>",
"close_date": "<string>",
"currency": "<string>",
"source": "<string>",
"champion_id": "<string>",
"notes": "<string>",
"win_probability": 123,
"close_reason": "<string>",
"close_notes": "<string>",
"actual_close": "<string>",
"tags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
value: 123,
stage_id: '<string>',
owner_id: '<string>',
close_date: '<string>',
currency: '<string>',
source: '<string>',
champion_id: '<string>',
notes: '<string>',
win_probability: 123,
close_reason: '<string>',
close_notes: '<string>',
actual_close: '<string>',
tags: ['<string>']
})
};
fetch('https://api.example.com/deals/{deal_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://api.example.com/deals/{deal_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'value' => 123,
'stage_id' => '<string>',
'owner_id' => '<string>',
'close_date' => '<string>',
'currency' => '<string>',
'source' => '<string>',
'champion_id' => '<string>',
'notes' => '<string>',
'win_probability' => 123,
'close_reason' => '<string>',
'close_notes' => '<string>',
'actual_close' => '<string>',
'tags' => [
'<string>'
]
]),
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://api.example.com/deals/{deal_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"value\": 123,\n \"stage_id\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"close_date\": \"<string>\",\n \"currency\": \"<string>\",\n \"source\": \"<string>\",\n \"champion_id\": \"<string>\",\n \"notes\": \"<string>\",\n \"win_probability\": 123,\n \"close_reason\": \"<string>\",\n \"close_notes\": \"<string>\",\n \"actual_close\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/deals/{deal_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"value\": 123,\n \"stage_id\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"close_date\": \"<string>\",\n \"currency\": \"<string>\",\n \"source\": \"<string>\",\n \"champion_id\": \"<string>\",\n \"notes\": \"<string>\",\n \"win_probability\": 123,\n \"close_reason\": \"<string>\",\n \"close_notes\": \"<string>\",\n \"actual_close\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/deals/{deal_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"value\": 123,\n \"stage_id\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"close_date\": \"<string>\",\n \"currency\": \"<string>\",\n \"source\": \"<string>\",\n \"champion_id\": \"<string>\",\n \"notes\": \"<string>\",\n \"win_probability\": 123,\n \"close_reason\": \"<string>\",\n \"close_notes\": \"<string>\",\n \"actual_close\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Update a Deal
curl --request PATCH \
--url https://api.example.com/deals/{deal_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"value": 123,
"stage_id": "<string>",
"owner_id": "<string>",
"close_date": "<string>",
"currency": "<string>",
"source": "<string>",
"champion_id": "<string>",
"notes": "<string>",
"win_probability": 123,
"close_reason": "<string>",
"close_notes": "<string>",
"actual_close": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.example.com/deals/{deal_id}"
payload = {
"name": "<string>",
"value": 123,
"stage_id": "<string>",
"owner_id": "<string>",
"close_date": "<string>",
"currency": "<string>",
"source": "<string>",
"champion_id": "<string>",
"notes": "<string>",
"win_probability": 123,
"close_reason": "<string>",
"close_notes": "<string>",
"actual_close": "<string>",
"tags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
value: 123,
stage_id: '<string>',
owner_id: '<string>',
close_date: '<string>',
currency: '<string>',
source: '<string>',
champion_id: '<string>',
notes: '<string>',
win_probability: 123,
close_reason: '<string>',
close_notes: '<string>',
actual_close: '<string>',
tags: ['<string>']
})
};
fetch('https://api.example.com/deals/{deal_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://api.example.com/deals/{deal_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'value' => 123,
'stage_id' => '<string>',
'owner_id' => '<string>',
'close_date' => '<string>',
'currency' => '<string>',
'source' => '<string>',
'champion_id' => '<string>',
'notes' => '<string>',
'win_probability' => 123,
'close_reason' => '<string>',
'close_notes' => '<string>',
'actual_close' => '<string>',
'tags' => [
'<string>'
]
]),
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://api.example.com/deals/{deal_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"value\": 123,\n \"stage_id\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"close_date\": \"<string>\",\n \"currency\": \"<string>\",\n \"source\": \"<string>\",\n \"champion_id\": \"<string>\",\n \"notes\": \"<string>\",\n \"win_probability\": 123,\n \"close_reason\": \"<string>\",\n \"close_notes\": \"<string>\",\n \"actual_close\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/deals/{deal_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"value\": 123,\n \"stage_id\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"close_date\": \"<string>\",\n \"currency\": \"<string>\",\n \"source\": \"<string>\",\n \"champion_id\": \"<string>\",\n \"notes\": \"<string>\",\n \"win_probability\": 123,\n \"close_reason\": \"<string>\",\n \"close_notes\": \"<string>\",\n \"actual_close\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/deals/{deal_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"value\": 123,\n \"stage_id\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"close_date\": \"<string>\",\n \"currency\": \"<string>\",\n \"source\": \"<string>\",\n \"champion_id\": \"<string>\",\n \"notes\": \"<string>\",\n \"win_probability\": 123,\n \"close_reason\": \"<string>\",\n \"close_notes\": \"<string>\",\n \"actual_close\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}value, close_date, and geo_scope are special: sending an explicit null clears the column and still counts as a change; for every other field, sending null is treated the same as omitting it (no-op).
Owner reassignment isn’t possible here. owner_id is not a field on this endpoint’s body, so it’s dropped before validation — a request whose only key is owner_id reaches the handler with nothing to update and returns 400. A deal’s owner is fixed to its creator at creation; no endpoint on this router reassigns it.
Auth
Requires a CRM manage scope and an active organization on the token. Any*:manage scope qualifies — in practice contacts:manage, deals:manage, companies:manage, or activities:manage.
Side effects
- If
stage_idchanges: dispatches aDealUpdateWorkflow(Temporal) that logs the stage-change activity and evaluates AI next-actions/contact-promotion off the request path, and records astage_changeanalytics event. - Classifies and enqueues notification events for changes to
stage_id,value, orclose_date. (owner_idis also a notifiable field, but it isn’t part of this endpoint’s body — see above.)
Response
The updateddeals row — same fields as the deal object, but raw columns only (no account/stage embeds); use Get a Deal for the enriched shape.
Errors
| Status | Cause |
|---|---|
400 | Body has no fields to update. |
404 | No deal with that id in this org. |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The deal's id.
Body
New deal name.
New deal value; explicit null clears it.
Move the deal to this pipeline stage.
Logto user id of the owning rep; explicit null unassigns the deal.
New expected close date, YYYY-MM-DD; explicit null clears it.
ISO 4217 currency code.
Free-text origin of the deal.
Contact id of the internal champion.
Free-text notes.
Manual win-probability override, 0-100.
Reason code recorded when closing the deal.
Free-text notes recorded when closing the deal.
Actual close date, YYYY-MM-DD.
Replace the deal's tag list.
Deal's geographic scope; explicit null clears it.
local, regional, international Analytics-only hint for how the stage was changed; never persisted as a deal column.
kanban_drag, detail_dropdown, stage_bar, ai_assistant, api, bulk_edit Response
Successful Response