curl --request PATCH \
--url https://api.statisfy.com/v1/objects/contact/records/{contact_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounts": null,
"department": null,
"fields": {},
"first_name": null,
"last_name": null,
"name": null,
"role": null,
"title": null
}
'import requests
url = "https://api.statisfy.com/v1/objects/contact/records/{contact_id}"
payload = {
"accounts": None,
"department": None,
"fields": {},
"first_name": None,
"last_name": None,
"name": None,
"role": None,
"title": None
}
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({
accounts: null,
department: null,
fields: {},
first_name: null,
last_name: null,
name: null,
role: null,
title: null
})
};
fetch('https://api.statisfy.com/v1/objects/contact/records/{contact_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.statisfy.com/v1/objects/contact/records/{contact_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([
'accounts' => null,
'department' => null,
'fields' => [
],
'first_name' => null,
'last_name' => null,
'name' => null,
'role' => null,
'title' => null
]),
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.statisfy.com/v1/objects/contact/records/{contact_id}"
payload := strings.NewReader("{\n \"accounts\": null,\n \"department\": null,\n \"fields\": {},\n \"first_name\": null,\n \"last_name\": null,\n \"name\": null,\n \"role\": null,\n \"title\": null\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.statisfy.com/v1/objects/contact/records/{contact_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounts\": null,\n \"department\": null,\n \"fields\": {},\n \"first_name\": null,\n \"last_name\": null,\n \"name\": null,\n \"role\": null,\n \"title\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/objects/contact/records/{contact_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 \"accounts\": null,\n \"department\": null,\n \"fields\": {},\n \"first_name\": null,\n \"last_name\": null,\n \"name\": null,\n \"role\": null,\n \"title\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"account": "<string>",
"accounts": [
"<string>"
],
"crm_contact_id": "<string>",
"department": "<string>",
"email": "<string>",
"engagements": 0,
"fields": {},
"first_name": "<string>",
"is_key_contact": false,
"last_engagement_date": "<string>",
"last_name": "<string>",
"name": "<string>",
"origin": "crm",
"role": "<string>",
"sentiment": "negative",
"title": "<string>"
}Update a contact
Changes only the keys sent: name, first_name, last_name, title, role, department and accounts at the top level (unless a sync in your workspace owns one), custom fields under fields. Each value written counts as Statisfy’s: later CRM syncs do not overwrite it. A cleared value is not kept that way: a sync from your CRM may fill it again. null or a blank string clears title, role, department, first_name and last_name; name cannot be cleared. A name part sent without name rebuilds the name from the parts sent and the stored ones (the middle name included); a name sent beside them is the name as sent. For a contact with only a full name stored, a lone part is a 422 (send name with it), as is clearing every part. Sending name, first_name or last_name for a portal user (a contact with a login) is a 422: their name lives on their login profile. accounts replaces the contact’s accounts, the primary first (live account ids, each once); it cannot be emptied. Key-contact marks on accounts dropped from the list are removed; marks on accounts it keeps stay. As in the app, the accounts count as set by hand. email is set at create and cannot change: create a new contact for a new address. Every key is checked before anything is written, and any problem refuses the whole request with a 422 listing each one in details. Where your workspace pushes contacts to Salesforce, the next push sends the name, title and mapped custom fields; not role, department or accounts, and not a cleared value. A 500 whose details list fields as written means those standard fields were written and the custom values were not; it says whether to send them again or what refused them.
curl --request PATCH \
--url https://api.statisfy.com/v1/objects/contact/records/{contact_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounts": null,
"department": null,
"fields": {},
"first_name": null,
"last_name": null,
"name": null,
"role": null,
"title": null
}
'import requests
url = "https://api.statisfy.com/v1/objects/contact/records/{contact_id}"
payload = {
"accounts": None,
"department": None,
"fields": {},
"first_name": None,
"last_name": None,
"name": None,
"role": None,
"title": None
}
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({
accounts: null,
department: null,
fields: {},
first_name: null,
last_name: null,
name: null,
role: null,
title: null
})
};
fetch('https://api.statisfy.com/v1/objects/contact/records/{contact_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.statisfy.com/v1/objects/contact/records/{contact_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([
'accounts' => null,
'department' => null,
'fields' => [
],
'first_name' => null,
'last_name' => null,
'name' => null,
'role' => null,
'title' => null
]),
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.statisfy.com/v1/objects/contact/records/{contact_id}"
payload := strings.NewReader("{\n \"accounts\": null,\n \"department\": null,\n \"fields\": {},\n \"first_name\": null,\n \"last_name\": null,\n \"name\": null,\n \"role\": null,\n \"title\": null\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.statisfy.com/v1/objects/contact/records/{contact_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounts\": null,\n \"department\": null,\n \"fields\": {},\n \"first_name\": null,\n \"last_name\": null,\n \"name\": null,\n \"role\": null,\n \"title\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/objects/contact/records/{contact_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 \"accounts\": null,\n \"department\": null,\n \"fields\": {},\n \"first_name\": null,\n \"last_name\": null,\n \"name\": null,\n \"role\": null,\n \"title\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"account": "<string>",
"accounts": [
"<string>"
],
"crm_contact_id": "<string>",
"department": "<string>",
"email": "<string>",
"engagements": 0,
"fields": {},
"first_name": "<string>",
"is_key_contact": false,
"last_engagement_date": "<string>",
"last_name": "<string>",
"name": "<string>",
"origin": "crm",
"role": "<string>",
"sentiment": "negative",
"title": "<string>"
}Authorizations
An API key, sent as Authorization: Bearer stfy_live_…. See Authentication for how to get one and which scopes it needs.
Body
Response
Successful Response
Was this page helpful?