Create or update a custom object record by external_id
curl --request PUT \
--url https://api.statisfy.com/v1/objects/{object}/records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": null,
"contact_id": null,
"external_id": null,
"fields": {}
}
'import requests
url = "https://api.statisfy.com/v1/objects/{object}/records"
payload = {
"account_id": None,
"contact_id": None,
"external_id": None,
"fields": {}
}
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({account_id: null, contact_id: null, external_id: null, fields: {}})
};
fetch('https://api.statisfy.com/v1/objects/{object}/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/{object}/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([
'account_id' => null,
'contact_id' => null,
'external_id' => null,
'fields' => [
]
]),
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/{object}/records"
payload := strings.NewReader("{\n \"account_id\": null,\n \"contact_id\": null,\n \"external_id\": null,\n \"fields\": {}\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/{object}/records")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": null,\n \"contact_id\": null,\n \"external_id\": null,\n \"fields\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/objects/{object}/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 \"account_id\": null,\n \"contact_id\": null,\n \"external_id\": null,\n \"fields\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"result": "created",
"account_id": "<string>",
"contact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"fields": {},
"updated_at": "2023-11-07T05:31:56Z"
}{
"id": "<string>",
"object": "<string>",
"result": "created",
"account_id": "<string>",
"contact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"fields": {},
"updated_at": "2023-11-07T05:31:56Z"
}custom_objects
Create or update a custom object record by external_id
Finds the object's record with the body's `external_id` on the body's account or contact and updates it, or creates the record when there is none (a create needs a Statisfy object). `result` says which. What each field takes is in GET /v1/fields?object=<object>: its type, its options, and whether the API may write it (`writable`). A field your CRM fills is written only while Salesforce writeback is on for the object, and can't be cleared here; an object a warehouse or another system fills is read only. Every problem with the body comes back at once, in one 422.
PUT
/
v1
/
objects
/
{object}
/
records
Create or update a custom object record by external_id
curl --request PUT \
--url https://api.statisfy.com/v1/objects/{object}/records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": null,
"contact_id": null,
"external_id": null,
"fields": {}
}
'import requests
url = "https://api.statisfy.com/v1/objects/{object}/records"
payload = {
"account_id": None,
"contact_id": None,
"external_id": None,
"fields": {}
}
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({account_id: null, contact_id: null, external_id: null, fields: {}})
};
fetch('https://api.statisfy.com/v1/objects/{object}/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/{object}/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([
'account_id' => null,
'contact_id' => null,
'external_id' => null,
'fields' => [
]
]),
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/{object}/records"
payload := strings.NewReader("{\n \"account_id\": null,\n \"contact_id\": null,\n \"external_id\": null,\n \"fields\": {}\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/{object}/records")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": null,\n \"contact_id\": null,\n \"external_id\": null,\n \"fields\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/objects/{object}/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 \"account_id\": null,\n \"contact_id\": null,\n \"external_id\": null,\n \"fields\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"result": "created",
"account_id": "<string>",
"contact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"fields": {},
"updated_at": "2023-11-07T05:31:56Z"
}{
"id": "<string>",
"object": "<string>",
"result": "created",
"account_id": "<string>",
"contact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"fields": {},
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
An API key, sent as Authorization: Bearer stfy_live_…. See Authentication for how to get one and which scopes it needs.
Path Parameters
Query Parameters
Body
application/json
Response
Successful Response
Was this page helpful?