curl --request PUT \
--url https://api.statisfy.com/v1/objects/contact/records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounts": null,
"department": null,
"email": 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"
payload = {
"accounts": None,
"department": None,
"email": None,
"fields": {},
"first_name": None,
"last_name": None,
"name": None,
"role": None,
"title": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accounts: null,
department: null,
email: null,
fields: {},
first_name: null,
last_name: null,
name: null,
role: null,
title: null
})
};
fetch('https://api.statisfy.com/v1/objects/contact/records', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'accounts' => null,
'department' => null,
'email' => 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"
payload := strings.NewReader("{\n \"accounts\": null,\n \"department\": null,\n \"email\": null,\n \"fields\": {},\n \"first_name\": null,\n \"last_name\": null,\n \"name\": null,\n \"role\": null,\n \"title\": null\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.statisfy.com/v1/objects/contact/records")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounts\": null,\n \"department\": null,\n \"email\": 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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accounts\": null,\n \"department\": null,\n \"email\": 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>",
"result": "created",
"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>"
}{
"id": "<string>",
"result": "created",
"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 the contact with an address, or create it
match=email finds the contact by its address, whatever its case. A contact has it: the body less email is an update, with an update’s rules (accounts replaces the list; a name sent beside parts is kept as sent; a portal user’s name keys are a 422), and the answer is 200 with result: "updated" (a body of the address alone writes nothing). Nobody has it: the body is a create, with a create’s rules (accounts required; the name built from parts sent; department refused), and the answer is 201 with result: "created". Someone who is not a contact has it (a vendor, a digital worker, a teammate off your domains): a 409 naming no one. A retry after a create updates, so the two sides read one body differently: send what each should do. Of two upserts of one new address at the same moment, the other may be a 409 whose details[0].contact_ids names the new contact; retry it to update. Needs contacts:create and contacts:update.
curl --request PUT \
--url https://api.statisfy.com/v1/objects/contact/records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounts": null,
"department": null,
"email": 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"
payload = {
"accounts": None,
"department": None,
"email": None,
"fields": {},
"first_name": None,
"last_name": None,
"name": None,
"role": None,
"title": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accounts: null,
department: null,
email: null,
fields: {},
first_name: null,
last_name: null,
name: null,
role: null,
title: null
})
};
fetch('https://api.statisfy.com/v1/objects/contact/records', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'accounts' => null,
'department' => null,
'email' => 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"
payload := strings.NewReader("{\n \"accounts\": null,\n \"department\": null,\n \"email\": null,\n \"fields\": {},\n \"first_name\": null,\n \"last_name\": null,\n \"name\": null,\n \"role\": null,\n \"title\": null\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.statisfy.com/v1/objects/contact/records")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounts\": null,\n \"department\": null,\n \"email\": 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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accounts\": null,\n \"department\": null,\n \"email\": 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>",
"result": "created",
"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>"
}{
"id": "<string>",
"result": "created",
"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.
Query Parameters
Body
Response
Successful Response
Was this page helpful?