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": "<string>",
"attioId": "<string>",
"attioWorkspaceId": "<string>"
},
"url": "<string>",
"amount": {
"currency": "<string>",
"value": 123
},
"closedAt": "<string>",
"ownerEmail": "<string>",
"ownerId": "<string>",
"ownerName": "<string>",
"pipeline": "<string>",
"pipelineId": "<string>",
"stage": "<string>",
"stageId": "<string>",
"summary": {
"markdown": "<string>"
},
"title": "<string>",
"type": "<string>",
"typeId": "<string>"
}
}
}The update is partial: omitted attributes keep their current values, and at least one attribute must be provided. Use the CRM ids returned by the deal (
ownerId, stageId, typeId) when updating those attributes.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 (the ownerId returned by the deal).
Stage id in the CRM (the stageId returned by the deal).
Deal title.
Deal type id in the CRM (the typeId returned by the deal).
Response
Deal was successfully updated
Show child attributes
Show child attributes
Previous
List deal viewsList the deal views of the workspace. Only public views are returned; built-in default views are not included.
Next
⌘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": "<string>",
"attioId": "<string>",
"attioWorkspaceId": "<string>"
},
"url": "<string>",
"amount": {
"currency": "<string>",
"value": 123
},
"closedAt": "<string>",
"ownerEmail": "<string>",
"ownerId": "<string>",
"ownerName": "<string>",
"pipeline": "<string>",
"pipelineId": "<string>",
"stage": "<string>",
"stageId": "<string>",
"summary": {
"markdown": "<string>"
},
"title": "<string>",
"type": "<string>",
"typeId": "<string>"
}
}
}