curl --request POST \
--url https://api.statisfy.com/v1/objects/account/records/bulk-updates/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fields": {
"tier__c_": "gold"
},
"list_type": "my_book",
"customer_types": [
"Customer"
],
"filter": {
"renewal_date": {
"lte": "2027-03-31"
}
},
"view_id": 2
}
'import requests
url = "https://api.statisfy.com/v1/objects/account/records/bulk-updates/preview"
payload = {
"fields": { "tier__c_": "gold" },
"list_type": "my_book",
"customer_types": ["Customer"],
"filter": { "renewal_date": { "lte": "2027-03-31" } },
"view_id": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fields: {tier__c_: 'gold'},
list_type: 'my_book',
customer_types: ['Customer'],
filter: {renewal_date: {lte: '2027-03-31'}},
view_id: 2
})
};
fetch('https://api.statisfy.com/v1/objects/account/records/bulk-updates/preview', 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/bulk-updates/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fields' => [
'tier__c_' => 'gold'
],
'list_type' => 'my_book',
'customer_types' => [
'Customer'
],
'filter' => [
'renewal_date' => [
'lte' => '2027-03-31'
]
],
'view_id' => 2
]),
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/bulk-updates/preview"
payload := strings.NewReader("{\n \"fields\": {\n \"tier__c_\": \"gold\"\n },\n \"list_type\": \"my_book\",\n \"customer_types\": [\n \"Customer\"\n ],\n \"filter\": {\n \"renewal_date\": {\n \"lte\": \"2027-03-31\"\n }\n },\n \"view_id\": 2\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.statisfy.com/v1/objects/account/records/bulk-updates/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fields\": {\n \"tier__c_\": \"gold\"\n },\n \"list_type\": \"my_book\",\n \"customer_types\": [\n \"Customer\"\n ],\n \"filter\": {\n \"renewal_date\": {\n \"lte\": \"2027-03-31\"\n }\n },\n \"view_id\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/objects/account/records/bulk-updates/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields\": {\n \"tier__c_\": \"gold\"\n },\n \"list_type\": \"my_book\",\n \"customer_types\": [\n \"Customer\"\n ],\n \"filter\": {\n \"renewal_date\": {\n \"lte\": \"2027-03-31\"\n }\n },\n \"view_id\": 2\n}"
response = http.request(request)
puts response.read_body{
"hard_ceiling": 123,
"matched_count": 123
}Count the accounts a bulk update would set
Counts the accounts the app’s bulk update matches for the key’s person (GET /objects/account/records’s filter and view_id, within list_type and customer_types) and checks the value as a PATCH would, writing nothing. Only a person’s key whose role may run a filter-wide bulk update in the app; any other key is a 403. More matches than the configured ceiling (the preview’s hard_ceiling, 10,000 by default) is a 422.
curl --request POST \
--url https://api.statisfy.com/v1/objects/account/records/bulk-updates/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fields": {
"tier__c_": "gold"
},
"list_type": "my_book",
"customer_types": [
"Customer"
],
"filter": {
"renewal_date": {
"lte": "2027-03-31"
}
},
"view_id": 2
}
'import requests
url = "https://api.statisfy.com/v1/objects/account/records/bulk-updates/preview"
payload = {
"fields": { "tier__c_": "gold" },
"list_type": "my_book",
"customer_types": ["Customer"],
"filter": { "renewal_date": { "lte": "2027-03-31" } },
"view_id": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fields: {tier__c_: 'gold'},
list_type: 'my_book',
customer_types: ['Customer'],
filter: {renewal_date: {lte: '2027-03-31'}},
view_id: 2
})
};
fetch('https://api.statisfy.com/v1/objects/account/records/bulk-updates/preview', 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/bulk-updates/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fields' => [
'tier__c_' => 'gold'
],
'list_type' => 'my_book',
'customer_types' => [
'Customer'
],
'filter' => [
'renewal_date' => [
'lte' => '2027-03-31'
]
],
'view_id' => 2
]),
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/bulk-updates/preview"
payload := strings.NewReader("{\n \"fields\": {\n \"tier__c_\": \"gold\"\n },\n \"list_type\": \"my_book\",\n \"customer_types\": [\n \"Customer\"\n ],\n \"filter\": {\n \"renewal_date\": {\n \"lte\": \"2027-03-31\"\n }\n },\n \"view_id\": 2\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.statisfy.com/v1/objects/account/records/bulk-updates/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fields\": {\n \"tier__c_\": \"gold\"\n },\n \"list_type\": \"my_book\",\n \"customer_types\": [\n \"Customer\"\n ],\n \"filter\": {\n \"renewal_date\": {\n \"lte\": \"2027-03-31\"\n }\n },\n \"view_id\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/objects/account/records/bulk-updates/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields\": {\n \"tier__c_\": \"gold\"\n },\n \"list_type\": \"my_book\",\n \"customer_types\": [\n \"Customer\"\n ],\n \"filter\": {\n \"renewal_date\": {\n \"lte\": \"2027-03-31\"\n }\n },\n \"view_id\": 2\n}"
response = http.request(request)
puts response.read_body{
"hard_ceiling": 123,
"matched_count": 123
}Authorizations
An API key, sent as Authorization: Bearer stfy_live_…. See Authentication for how to get one and which scopes it needs.
Body
Which accounts, as the app's Accounts page picks them; all_customers is a 403 for a role that sees only its book. A role that sees only its book updates only the accounts on its book, as its PATCH does, on every tab
my_book, team_book, all_customers, unset, other, churned "my_book"
Was this page helpful?