curl --request PATCH \
--url https://east.sandbox.spade.com/users/{userId}/category-action-triggers \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"operation": "add",
"categoryTriggers": [
{
"id": "travel-reward-1",
"categoryId": "020-001-000-000",
"action": {
"type": "REWARD",
"rewardPercent": 3,
"offerId": "travel-3x-promo"
}
}
],
"triggerIds": [
"travel-reward-1",
"block-gambling"
]
}
'import requests
url = "https://east.sandbox.spade.com/users/{userId}/category-action-triggers"
payload = {
"operation": "add",
"categoryTriggers": [
{
"id": "travel-reward-1",
"categoryId": "020-001-000-000",
"action": {
"type": "REWARD",
"rewardPercent": 3,
"offerId": "travel-3x-promo"
}
}
],
"triggerIds": ["travel-reward-1", "block-gambling"]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operation: 'add',
categoryTriggers: [
{
id: 'travel-reward-1',
categoryId: '020-001-000-000',
action: {type: 'REWARD', rewardPercent: 3, offerId: 'travel-3x-promo'}
}
],
triggerIds: ['travel-reward-1', 'block-gambling']
})
};
fetch('https://east.sandbox.spade.com/users/{userId}/category-action-triggers', 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://east.sandbox.spade.com/users/{userId}/category-action-triggers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'operation' => 'add',
'categoryTriggers' => [
[
'id' => 'travel-reward-1',
'categoryId' => '020-001-000-000',
'action' => [
'type' => 'REWARD',
'rewardPercent' => 3,
'offerId' => 'travel-3x-promo'
]
]
],
'triggerIds' => [
'travel-reward-1',
'block-gambling'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://east.sandbox.spade.com/users/{userId}/category-action-triggers"
payload := strings.NewReader("{\n \"operation\": \"add\",\n \"categoryTriggers\": [\n {\n \"id\": \"travel-reward-1\",\n \"categoryId\": \"020-001-000-000\",\n \"action\": {\n \"type\": \"REWARD\",\n \"rewardPercent\": 3,\n \"offerId\": \"travel-3x-promo\"\n }\n }\n ],\n \"triggerIds\": [\n \"travel-reward-1\",\n \"block-gambling\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.patch("https://east.sandbox.spade.com/users/{userId}/category-action-triggers")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operation\": \"add\",\n \"categoryTriggers\": [\n {\n \"id\": \"travel-reward-1\",\n \"categoryId\": \"020-001-000-000\",\n \"action\": {\n \"type\": \"REWARD\",\n \"rewardPercent\": 3,\n \"offerId\": \"travel-3x-promo\"\n }\n }\n ],\n \"triggerIds\": [\n \"travel-reward-1\",\n \"block-gambling\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://east.sandbox.spade.com/users/{userId}/category-action-triggers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operation\": \"add\",\n \"categoryTriggers\": [\n {\n \"id\": \"travel-reward-1\",\n \"categoryId\": \"020-001-000-000\",\n \"action\": {\n \"type\": \"REWARD\",\n \"rewardPercent\": 3,\n \"offerId\": \"travel-3x-promo\"\n }\n }\n ],\n \"triggerIds\": [\n \"travel-reward-1\",\n \"block-gambling\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "succeeded",
"version": 5
}{
"status": "succeeded",
"version": 1,
"categoryTriggers": [
{
"id": "travel-reward-1",
"categoryId": "020-001-000-000",
"action": {
"type": "REWARD",
"rewardPercent": 3
}
}
],
"totalCount": 10
}{
"invalidField": [
"This field is required."
]
}{
"details": "Incorrect authentication credentials."
}{
"details": "Internal server error."
}Incremental category trigger operations at user scope
Perform incremental operations on category action triggers at the user scope.
See the account-scope PATCH endpoint for full documentation on supported operations (add, remove).
curl --request PATCH \
--url https://east.sandbox.spade.com/users/{userId}/category-action-triggers \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"operation": "add",
"categoryTriggers": [
{
"id": "travel-reward-1",
"categoryId": "020-001-000-000",
"action": {
"type": "REWARD",
"rewardPercent": 3,
"offerId": "travel-3x-promo"
}
}
],
"triggerIds": [
"travel-reward-1",
"block-gambling"
]
}
'import requests
url = "https://east.sandbox.spade.com/users/{userId}/category-action-triggers"
payload = {
"operation": "add",
"categoryTriggers": [
{
"id": "travel-reward-1",
"categoryId": "020-001-000-000",
"action": {
"type": "REWARD",
"rewardPercent": 3,
"offerId": "travel-3x-promo"
}
}
],
"triggerIds": ["travel-reward-1", "block-gambling"]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operation: 'add',
categoryTriggers: [
{
id: 'travel-reward-1',
categoryId: '020-001-000-000',
action: {type: 'REWARD', rewardPercent: 3, offerId: 'travel-3x-promo'}
}
],
triggerIds: ['travel-reward-1', 'block-gambling']
})
};
fetch('https://east.sandbox.spade.com/users/{userId}/category-action-triggers', 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://east.sandbox.spade.com/users/{userId}/category-action-triggers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'operation' => 'add',
'categoryTriggers' => [
[
'id' => 'travel-reward-1',
'categoryId' => '020-001-000-000',
'action' => [
'type' => 'REWARD',
'rewardPercent' => 3,
'offerId' => 'travel-3x-promo'
]
]
],
'triggerIds' => [
'travel-reward-1',
'block-gambling'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://east.sandbox.spade.com/users/{userId}/category-action-triggers"
payload := strings.NewReader("{\n \"operation\": \"add\",\n \"categoryTriggers\": [\n {\n \"id\": \"travel-reward-1\",\n \"categoryId\": \"020-001-000-000\",\n \"action\": {\n \"type\": \"REWARD\",\n \"rewardPercent\": 3,\n \"offerId\": \"travel-3x-promo\"\n }\n }\n ],\n \"triggerIds\": [\n \"travel-reward-1\",\n \"block-gambling\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.patch("https://east.sandbox.spade.com/users/{userId}/category-action-triggers")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operation\": \"add\",\n \"categoryTriggers\": [\n {\n \"id\": \"travel-reward-1\",\n \"categoryId\": \"020-001-000-000\",\n \"action\": {\n \"type\": \"REWARD\",\n \"rewardPercent\": 3,\n \"offerId\": \"travel-3x-promo\"\n }\n }\n ],\n \"triggerIds\": [\n \"travel-reward-1\",\n \"block-gambling\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://east.sandbox.spade.com/users/{userId}/category-action-triggers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operation\": \"add\",\n \"categoryTriggers\": [\n {\n \"id\": \"travel-reward-1\",\n \"categoryId\": \"020-001-000-000\",\n \"action\": {\n \"type\": \"REWARD\",\n \"rewardPercent\": 3,\n \"offerId\": \"travel-3x-promo\"\n }\n }\n ],\n \"triggerIds\": [\n \"travel-reward-1\",\n \"block-gambling\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "succeeded",
"version": 5
}{
"status": "succeeded",
"version": 1,
"categoryTriggers": [
{
"id": "travel-reward-1",
"categoryId": "020-001-000-000",
"action": {
"type": "REWARD",
"rewardPercent": 3
}
}
],
"totalCount": 10
}{
"invalidField": [
"This field is required."
]
}{
"details": "Incorrect authentication credentials."
}{
"details": "Internal server error."
}Authorizations
Path Parameters
Your unique identifier for the user
512Body
Request body for incremental category action trigger operations.
- For
add:categoryTriggersis required.triggerIdsis optional and ignored if provided. - For
remove:triggerIdsis required and must be a non-empty list.
The operation to perform:
add: Register new category triggers or update existing onesremove: Remove category triggers (excluded from enrichment lookups)
add, remove "add"
List of category triggers to add. Required for the add operation.
If a trigger ID already exists, the old registration is replaced (upsert behavior).
Field requirements:
id,categoryId, andactionare always required
1 - 300 elementsShow child attributes
Show child attributes
List of trigger IDs to remove. Required and must be non-empty for the remove operation.
Trigger IDs that are not currently active are silently ignored (idempotent).
For add operations, this field is optional and ignored if provided — you may pass null, [], or omit it entirely.
512["travel-reward-1", "block-gambling"]

