curl --request PUT \
--url https://api.statisfy.com/v1/objects/account/records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alias_domains": null,
"arr": null,
"crm_account_id": null,
"domain": null,
"fields": {},
"name": null,
"renewal_date": null,
"type": null
}
'import requests
url = "https://api.statisfy.com/v1/objects/account/records"
payload = {
"alias_domains": None,
"arr": None,
"crm_account_id": None,
"domain": None,
"fields": {},
"name": None,
"renewal_date": None,
"type": 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({
alias_domains: null,
arr: null,
crm_account_id: null,
domain: null,
fields: {},
name: null,
renewal_date: null,
type: null
})
};
fetch('https://api.statisfy.com/v1/objects/account/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/account/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([
'alias_domains' => null,
'arr' => null,
'crm_account_id' => null,
'domain' => null,
'fields' => [
],
'name' => null,
'renewal_date' => null,
'type' => 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/account/records"
payload := strings.NewReader("{\n \"alias_domains\": null,\n \"arr\": null,\n \"crm_account_id\": null,\n \"domain\": null,\n \"fields\": {},\n \"name\": null,\n \"renewal_date\": null,\n \"type\": 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/account/records")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alias_domains\": null,\n \"arr\": null,\n \"crm_account_id\": null,\n \"domain\": null,\n \"fields\": {},\n \"name\": null,\n \"renewal_date\": null,\n \"type\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/objects/account/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 \"alias_domains\": null,\n \"arr\": null,\n \"crm_account_id\": null,\n \"domain\": null,\n \"fields\": {},\n \"name\": null,\n \"renewal_date\": null,\n \"type\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"result": "created",
"account_summary__s_": "<string>",
"arr": 123,
"crm_account_id": "<string>",
"currency": "<string>",
"domain": "<string>",
"experience_health": "<string>",
"feature_requests_health": "<string>",
"fields": {},
"health": "<string>",
"health_summary": "<string>",
"hierarchy": "<string>",
"last_activity_date": "<string>",
"name": "<string>",
"outcomes_health": "<string>",
"owner_names": [
"<string>"
],
"owners": [
{
"user_id": "<string>",
"field": "<string>",
"role": "<string>",
"source": "<string>"
}
],
"parent": "<string>",
"product_usage_health": "<string>",
"relationship_health": "<string>",
"renewal_date": "<string>",
"risks_health": "<string>",
"type": "<string>"
}{
"id": "<string>",
"result": "created",
"account_summary__s_": "<string>",
"arr": 123,
"crm_account_id": "<string>",
"currency": "<string>",
"domain": "<string>",
"experience_health": "<string>",
"feature_requests_health": "<string>",
"fields": {},
"health": "<string>",
"health_summary": "<string>",
"hierarchy": "<string>",
"last_activity_date": "<string>",
"name": "<string>",
"outcomes_health": "<string>",
"owner_names": [
"<string>"
],
"owners": [
{
"user_id": "<string>",
"field": "<string>",
"role": "<string>",
"source": "<string>"
}
],
"parent": "<string>",
"product_usage_health": "<string>",
"relationship_health": "<string>",
"renewal_date": "<string>",
"risks_health": "<string>",
"type": "<string>"
}Update the matching account, or create it
match=crm_account_id or match=domain names the body key that finds the account; a CRM id matches as stored or in its other Salesforce form (15 or 18 characters). One live account matches: it is updated and the answer is 200 with result: "updated". None does: the body is a create and the answer is 201 with result: "created". Several live accounts share the domain: 409 listing up to 10 of them. A CRM id a deleted account holds: 409. On the update side, domain must be one of the account’s domains and alias_domains among them (409 otherwise; the API does not change them); crm_account_id must be the account’s, or, on an account with none yet, one no other account holds, which is then set. A key describe marks read-only is accepted when its value equals what a read returns for it, in the same form, so the same full record can be sent every time. Retrying is safe: a retry after a create updates, but two upserts of one domain at the same moment can both create. Needs accounts:create and accounts:update. name and domain are required. domain is lowercased, then normalised as the app does it (protocol, www. and path removed). domain, alias_domains and crm_account_id can be set only when an account is created. Every other key is an update key, checked the same way: where describe marks name read-only (the workspace has not turned on account creation, or a sync such as a CRM or warehouse owns account names), a create is a 422 whose details mark name as field_not_writable. type defaults to Customer. A domain another live account holds, as its domain or an alias, is a 409 naming that account in details[].account_ids; so is a CRM id any account holds, a deleted one included, since a deleted account keeps its CRM id. The domain check matches exactly, so an older account stored with a domain in another case does not count, and two creates of one domain at the same moment can both succeed: run them one at a time, or match on crm_account_id.
curl --request PUT \
--url https://api.statisfy.com/v1/objects/account/records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alias_domains": null,
"arr": null,
"crm_account_id": null,
"domain": null,
"fields": {},
"name": null,
"renewal_date": null,
"type": null
}
'import requests
url = "https://api.statisfy.com/v1/objects/account/records"
payload = {
"alias_domains": None,
"arr": None,
"crm_account_id": None,
"domain": None,
"fields": {},
"name": None,
"renewal_date": None,
"type": 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({
alias_domains: null,
arr: null,
crm_account_id: null,
domain: null,
fields: {},
name: null,
renewal_date: null,
type: null
})
};
fetch('https://api.statisfy.com/v1/objects/account/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/account/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([
'alias_domains' => null,
'arr' => null,
'crm_account_id' => null,
'domain' => null,
'fields' => [
],
'name' => null,
'renewal_date' => null,
'type' => 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/account/records"
payload := strings.NewReader("{\n \"alias_domains\": null,\n \"arr\": null,\n \"crm_account_id\": null,\n \"domain\": null,\n \"fields\": {},\n \"name\": null,\n \"renewal_date\": null,\n \"type\": 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/account/records")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alias_domains\": null,\n \"arr\": null,\n \"crm_account_id\": null,\n \"domain\": null,\n \"fields\": {},\n \"name\": null,\n \"renewal_date\": null,\n \"type\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/objects/account/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 \"alias_domains\": null,\n \"arr\": null,\n \"crm_account_id\": null,\n \"domain\": null,\n \"fields\": {},\n \"name\": null,\n \"renewal_date\": null,\n \"type\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"result": "created",
"account_summary__s_": "<string>",
"arr": 123,
"crm_account_id": "<string>",
"currency": "<string>",
"domain": "<string>",
"experience_health": "<string>",
"feature_requests_health": "<string>",
"fields": {},
"health": "<string>",
"health_summary": "<string>",
"hierarchy": "<string>",
"last_activity_date": "<string>",
"name": "<string>",
"outcomes_health": "<string>",
"owner_names": [
"<string>"
],
"owners": [
{
"user_id": "<string>",
"field": "<string>",
"role": "<string>",
"source": "<string>"
}
],
"parent": "<string>",
"product_usage_health": "<string>",
"relationship_health": "<string>",
"renewal_date": "<string>",
"risks_health": "<string>",
"type": "<string>"
}{
"id": "<string>",
"result": "created",
"account_summary__s_": "<string>",
"arr": 123,
"crm_account_id": "<string>",
"currency": "<string>",
"domain": "<string>",
"experience_health": "<string>",
"feature_requests_health": "<string>",
"fields": {},
"health": "<string>",
"health_summary": "<string>",
"hierarchy": "<string>",
"last_activity_date": "<string>",
"name": "<string>",
"outcomes_health": "<string>",
"owner_names": [
"<string>"
],
"owners": [
{
"user_id": "<string>",
"field": "<string>",
"role": "<string>",
"source": "<string>"
}
],
"parent": "<string>",
"product_usage_health": "<string>",
"relationship_health": "<string>",
"renewal_date": "<string>",
"risks_health": "<string>",
"type": "<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?