Sync Rules
Update Sync Rules
Replace the company’s sync rules
PUT
/
api
/
v1
/
sync-rules
Update Sync Rules
curl --request PUT \
--url https://api.sequenzy.com/api/v1/sync-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"syncRules": {}
}
'import requests
url = "https://api.sequenzy.com/api/v1/sync-rules"
payload = { "syncRules": {} }
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({syncRules: {}})
};
fetch('https://api.sequenzy.com/api/v1/sync-rules', 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.sequenzy.com/api/v1/sync-rules",
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([
'syncRules' => [
]
]),
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.sequenzy.com/api/v1/sync-rules"
payload := strings.NewReader("{\n \"syncRules\": {}\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.sequenzy.com/api/v1/sync-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"syncRules\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/sync-rules")
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 \"syncRules\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Saved 1 sync rule.",
"syncRules": [
{
"triggerEvent": "ecommerce.order_placed",
"actions": { "addTags": ["vinyl-collector"], "removeTags": [] },
"conditions": {
"purchasedProduct": { "tags": ["Vinyl"] }
}
}
],
"isDefault": false
}
{
"success": false,
"error": "syncRules.0.triggerEvent: String must contain at least 1 character(s)"
}
{
"success": false,
"error": "Unauthorized"
}
Replaces the full sync rule set, or opts into the legacy SaaS/ecommerce platform
preset when
Tag buyers of a product tag:
Opt into the platform preset:
null is sent. This is not a partial update - fetch the current rules with
Get Sync Rules, edit them, and send the
whole set back.
Request
Full replacement rule set. Send
[] to disable sync rules, or null to opt
into the inherited SaaS/ecommerce platform preset. Each rule has
triggerEvent, actions.addTags, actions.removeTags, and optional
conditions (requiresTags, requiresNotTags, and purchasedProduct with
tags, collectionIds, productTypes, or vendors for commerce events that
carry products).curl -X PUT "https://api.sequenzy.com/api/v1/sync-rules" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"syncRules": [
{
"triggerEvent": "ecommerce.order_placed",
"actions": { "addTags": ["vinyl-collector"], "removeTags": [] },
"conditions": {
"purchasedProduct": { "tags": ["Vinyl"] }
}
}
]
}'
curl -X PUT "https://api.sequenzy.com/api/v1/sync-rules" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"syncRules": null}'
Responses
{
"success": true,
"message": "Saved 1 sync rule.",
"syncRules": [
{
"triggerEvent": "ecommerce.order_placed",
"actions": { "addTags": ["vinyl-collector"], "removeTags": [] },
"conditions": {
"purchasedProduct": { "tags": ["Vinyl"] }
}
}
],
"isDefault": false
}
{
"success": false,
"error": "syncRules.0.triggerEvent: String must contain at least 1 character(s)"
}
{
"success": false,
"error": "Unauthorized"
}
Previous
Get Shopify Automation SettingsGet the connected Shopify store's browse-abandonment and price-drop settings
Next
⌘I
Update Sync Rules
curl --request PUT \
--url https://api.sequenzy.com/api/v1/sync-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"syncRules": {}
}
'import requests
url = "https://api.sequenzy.com/api/v1/sync-rules"
payload = { "syncRules": {} }
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({syncRules: {}})
};
fetch('https://api.sequenzy.com/api/v1/sync-rules', 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.sequenzy.com/api/v1/sync-rules",
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([
'syncRules' => [
]
]),
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.sequenzy.com/api/v1/sync-rules"
payload := strings.NewReader("{\n \"syncRules\": {}\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.sequenzy.com/api/v1/sync-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"syncRules\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/sync-rules")
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 \"syncRules\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Saved 1 sync rule.",
"syncRules": [
{
"triggerEvent": "ecommerce.order_placed",
"actions": { "addTags": ["vinyl-collector"], "removeTags": [] },
"conditions": {
"purchasedProduct": { "tags": ["Vinyl"] }
}
}
],
"isDefault": false
}
{
"success": false,
"error": "syncRules.0.triggerEvent: String must contain at least 1 character(s)"
}
{
"success": false,
"error": "Unauthorized"
}