Skip to main content
PATCH
/
users
/
{userId}
/
cards
/
{cardId}
/
category-action-triggers
Incremental category trigger operations at card scope
curl --request PATCH \
  --url https://east.sandbox.spade.com/users/{userId}/cards/{cardId}/category-action-triggers \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "categoryTriggers": [
    {
      "id": "<string>",
      "categoryId": "<string>",
      "action": {
        "type": "<string>"
      }
    }
  ],
  "triggerIds": [
    "<string>"
  ]
}
'
{
  "status": "succeeded",
  "version": 123
}

Authorizations

X-Api-Key
string
header
required

Path Parameters

userId
string
required

Your unique identifier for the user

Maximum string length: 512
cardId
string
required

Your unique identifier for the card

Maximum string length: 512

Body

application/json

Request body for incremental category action trigger operations.

  • For add: categoryTriggers is required. triggerIds is optional and ignored if provided.
  • For remove: triggerIds is required and must be a non-empty list.
operation
enum<string>
required

The operation to perform:

  • add: Register new category triggers or update existing ones
  • remove: Remove category triggers (excluded from enrichment lookups)
Available options:
add,
remove
Example:

"add"

categoryTriggers
object[]

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, and action are always required
Required array length: 1 - 300 elements
triggerIds
string[] | null

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.

Maximum string length: 512
Example:
["travel-reward-1", "block-gambling"]

Response

Remove operation completed successfully

Response for the remove PATCH operation.

status
enum<string>
Available options:
succeeded
Example:

"succeeded"

version
integer

The version number of this operation.

Example:

5