Update object record
curl --request PATCH \
--url https://api.sapt.ai/projects/{projectId}/object-records/{recordId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {},
"externalId": "<string>",
"expectedData": {},
"expectedStatus": "<string>",
"relations": {}
}
'import requests
url = "https://api.sapt.ai/projects/{projectId}/object-records/{recordId}"
payload = {
"data": {},
"externalId": "<string>",
"expectedData": {},
"expectedStatus": "<string>",
"relations": {}
}
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({
data: {},
externalId: '<string>',
expectedData: {},
expectedStatus: '<string>',
relations: {}
})
};
fetch('https://api.sapt.ai/projects/{projectId}/object-records/{recordId}', 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.sapt.ai/projects/{projectId}/object-records/{recordId}",
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([
'data' => [
],
'externalId' => '<string>',
'expectedData' => [
],
'expectedStatus' => '<string>',
'relations' => [
]
]),
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.sapt.ai/projects/{projectId}/object-records/{recordId}"
payload := strings.NewReader("{\n \"data\": {},\n \"externalId\": \"<string>\",\n \"expectedData\": {},\n \"expectedStatus\": \"<string>\",\n \"relations\": {}\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.sapt.ai/projects/{projectId}/object-records/{recordId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {},\n \"externalId\": \"<string>\",\n \"expectedData\": {},\n \"expectedStatus\": \"<string>\",\n \"relations\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/projects/{projectId}/object-records/{recordId}")
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 \"data\": {},\n \"externalId\": \"<string>\",\n \"expectedData\": {},\n \"expectedStatus\": \"<string>\",\n \"relations\": {}\n}"
response = http.request(request)
puts response.read_body{
"record": {
"id": "<string>",
"typeSlug": "<string>",
"displayName": "<string>",
"externalId": "<string>",
"data": {},
"personRefId": "<string>",
"companyRefId": "<string>",
"amountCents": "<string>",
"currency": "<string>",
"status": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"providerExternalId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"updatedBy": "<string>"
}
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}CRM
Update object record
Partially update an object record. data is a partial merge — pass null for a key to delete it. Optional expectedData (JSONB containment) and expectedStatus fields make the write conditional; a stale precondition returns 409 without changing the record. Person-linked types may refresh personRefId from identity-bearing data.
PATCH
/
projects
/
{projectId}
/
object-records
/
{recordId}
Update object record
curl --request PATCH \
--url https://api.sapt.ai/projects/{projectId}/object-records/{recordId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {},
"externalId": "<string>",
"expectedData": {},
"expectedStatus": "<string>",
"relations": {}
}
'import requests
url = "https://api.sapt.ai/projects/{projectId}/object-records/{recordId}"
payload = {
"data": {},
"externalId": "<string>",
"expectedData": {},
"expectedStatus": "<string>",
"relations": {}
}
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({
data: {},
externalId: '<string>',
expectedData: {},
expectedStatus: '<string>',
relations: {}
})
};
fetch('https://api.sapt.ai/projects/{projectId}/object-records/{recordId}', 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.sapt.ai/projects/{projectId}/object-records/{recordId}",
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([
'data' => [
],
'externalId' => '<string>',
'expectedData' => [
],
'expectedStatus' => '<string>',
'relations' => [
]
]),
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.sapt.ai/projects/{projectId}/object-records/{recordId}"
payload := strings.NewReader("{\n \"data\": {},\n \"externalId\": \"<string>\",\n \"expectedData\": {},\n \"expectedStatus\": \"<string>\",\n \"relations\": {}\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.sapt.ai/projects/{projectId}/object-records/{recordId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {},\n \"externalId\": \"<string>\",\n \"expectedData\": {},\n \"expectedStatus\": \"<string>\",\n \"relations\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/projects/{projectId}/object-records/{recordId}")
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 \"data\": {},\n \"externalId\": \"<string>\",\n \"expectedData\": {},\n \"expectedStatus\": \"<string>\",\n \"relations\": {}\n}"
response = http.request(request)
puts response.read_body{
"record": {
"id": "<string>",
"typeSlug": "<string>",
"displayName": "<string>",
"externalId": "<string>",
"data": {},
"personRefId": "<string>",
"companyRefId": "<string>",
"amountCents": "<string>",
"currency": "<string>",
"status": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"providerExternalId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"updatedBy": "<string>"
}
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Authorizations
JWT token obtained from /api/auth/token endpoint. Token is verified using JWKS and must include a valid user identifier.
Body
application/json
Response
Success
Show child attributes
Show child attributes