Deal
Update deal
Update a deal. The update is written to the connected CRM first, then mirrored in Claap. At least one field must be provided; omitted fields keep their current values.
PATCH
/
v1
/
deals
/
{dealId}
cURL
curl --request PATCH \
--url https://api.claap.io/v1/deals/{dealId} \
--header 'Content-Type: application/json' \
--header 'X-Claap-Key: <api-key>' \
--data '
{
"amount": 123,
"closedAt": "<string>",
"ownerId": "<string>",
"stageId": "<string>",
"title": "<string>",
"typeId": "<string>"
}
'import requests
url = "https://api.claap.io/v1/deals/{dealId}"
payload = {
"amount": 123,
"closedAt": "<string>",
"ownerId": "<string>",
"stageId": "<string>",
"title": "<string>",
"typeId": "<string>"
}
headers = {
"X-Claap-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Claap-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
closedAt: '<string>',
ownerId: '<string>',
stageId: '<string>',
title: '<string>',
typeId: '<string>'
})
};
fetch('https://api.claap.io/v1/deals/{dealId}', 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.claap.io/v1/deals/{dealId}",
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([
'amount' => 123,
'closedAt' => '<string>',
'ownerId' => '<string>',
'stageId' => '<string>',
'title' => '<string>',
'typeId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Claap-Key: <api-key>"
],
]);
$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.claap.io/v1/deals/{dealId}"
payload := strings.NewReader("{\n \"amount\": 123,\n \"closedAt\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"title\": \"<string>\",\n \"typeId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Claap-Key", "<api-key>")
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.claap.io/v1/deals/{dealId}")
.header("X-Claap-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"closedAt\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"title\": \"<string>\",\n \"typeId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.claap.io/v1/deals/{dealId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Claap-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"closedAt\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"title\": \"<string>\",\n \"typeId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"result": {
"deal": {
"dealId": "<string>",
"companyIds": [
"<string>"
],
"contactIds": [
"<string>"
],
"openedAt": "<string>",
"source": {
"kind": "Attio",
"attioId": "<string>",
"attioWorkspaceId": "<string>"
},
"url": "<string>",
"amount": {
"currency": "<string>",
"value": 123
},
"closedAt": "<string>",
"ownerEmail": "<string>",
"ownerId": "<string>",
"ownerName": "<string>",
"pipelineId": "<string>",
"stageId": "<string>",
"summary": {
"markdown": "<string>"
},
"title": "<string>",
"typeId": "<string>"
}
}
}The update is partial: omitted attributes keep their current values, and at least one attribute must be provided. Use CRM ids when updating
ownerId, stageId and typeId: the valid ids can be discovered with the list deal owners, list deal stages and list deal types endpoints, or read from an existing deal.Authorizations
Path Parameters
Deal identifier
Body
application/json
Deal amount, in the currency configured in the CRM.
Deal close date (ISO datetime).
Deal owner id in the CRM. List the valid ids with GET /v1/deals/owners.
Stage id in the CRM. List the valid ids with GET /v1/deals/stages.
Deal title.
Deal type id in the CRM. List the valid ids with GET /v1/deals/types.
Response
Deal was successfully updated
Show child attributes
Show child attributes
⌘I
cURL
curl --request PATCH \
--url https://api.claap.io/v1/deals/{dealId} \
--header 'Content-Type: application/json' \
--header 'X-Claap-Key: <api-key>' \
--data '
{
"amount": 123,
"closedAt": "<string>",
"ownerId": "<string>",
"stageId": "<string>",
"title": "<string>",
"typeId": "<string>"
}
'import requests
url = "https://api.claap.io/v1/deals/{dealId}"
payload = {
"amount": 123,
"closedAt": "<string>",
"ownerId": "<string>",
"stageId": "<string>",
"title": "<string>",
"typeId": "<string>"
}
headers = {
"X-Claap-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Claap-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
closedAt: '<string>',
ownerId: '<string>',
stageId: '<string>',
title: '<string>',
typeId: '<string>'
})
};
fetch('https://api.claap.io/v1/deals/{dealId}', 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.claap.io/v1/deals/{dealId}",
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([
'amount' => 123,
'closedAt' => '<string>',
'ownerId' => '<string>',
'stageId' => '<string>',
'title' => '<string>',
'typeId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Claap-Key: <api-key>"
],
]);
$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.claap.io/v1/deals/{dealId}"
payload := strings.NewReader("{\n \"amount\": 123,\n \"closedAt\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"title\": \"<string>\",\n \"typeId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Claap-Key", "<api-key>")
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.claap.io/v1/deals/{dealId}")
.header("X-Claap-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"closedAt\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"title\": \"<string>\",\n \"typeId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.claap.io/v1/deals/{dealId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Claap-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"closedAt\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"title\": \"<string>\",\n \"typeId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"result": {
"deal": {
"dealId": "<string>",
"companyIds": [
"<string>"
],
"contactIds": [
"<string>"
],
"openedAt": "<string>",
"source": {
"kind": "Attio",
"attioId": "<string>",
"attioWorkspaceId": "<string>"
},
"url": "<string>",
"amount": {
"currency": "<string>",
"value": 123
},
"closedAt": "<string>",
"ownerEmail": "<string>",
"ownerId": "<string>",
"ownerName": "<string>",
"pipelineId": "<string>",
"stageId": "<string>",
"summary": {
"markdown": "<string>"
},
"title": "<string>",
"typeId": "<string>"
}
}
}