curl --request POST \
--url https://api.statisfy.com/v1/objects/account/records/bulk-updates \
--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"
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', 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",
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"
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")
.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")
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{
"already_set": 123,
"error": "<string>",
"failed": 123,
"field": "<string>",
"finished_at": "2023-11-07T05:31:56Z",
"id": 123,
"kept_newer": 123,
"processed": 123,
"started_at": "2023-11-07T05:31:56Z",
"state": "NEW",
"total_targeted": 123,
"updated": 123,
"has_more": false,
"next_cursor": "<string>",
"results": [
{
"id": "<string>",
"outcome": "updated",
"error": "<string>"
}
]
}Set one custom field on every account a filter selects
Starts the app’s bulk update over 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 answers 202 with the job; poll GET …/bulk-updates/. Only a person’s key whose role may run a filter-wide bulk update in the app; any other key is a 403. One account bulk update runs at a time per workspace: a second is a 409 naming the running job. No match is a 422. More matches than the configured ceiling (the preview’s hard_ceiling, 10,000 by default) is a 422. Send an Idempotency-Key header to make a retry safe.
curl --request POST \
--url https://api.statisfy.com/v1/objects/account/records/bulk-updates \
--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"
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', 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",
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"
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")
.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")
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{
"already_set": 123,
"error": "<string>",
"failed": 123,
"field": "<string>",
"finished_at": "2023-11-07T05:31:56Z",
"id": 123,
"kept_newer": 123,
"processed": 123,
"started_at": "2023-11-07T05:31:56Z",
"state": "NEW",
"total_targeted": 123,
"updated": 123,
"has_more": false,
"next_cursor": "<string>",
"results": [
{
"id": "<string>",
"outcome": "updated",
"error": "<string>"
}
]
}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"
Response
Successful Response
Was this page helpful?