Skip to main content
PUT
/
api
/
v1
/
rules:batchUpdate
BatchUpdateRules
curl --request PUT \
  --url https://your-sift-api-url.com/api/v1/rules:batchUpdate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "rules": [
    {
      "ruleId": "<string>",
      "name": "<string>",
      "description": "<string>",
      "assetId": "<string>",
      "isEnabled": true,
      "conditions": [
        {
          "ruleConditionId": "<string>",
          "expression": {
            "singleChannelComparison": {
              "channelComponent": "<string>",
              "channelName": "<string>",
              "comparator": "CONDITION_COMPARATOR_UNSPECIFIED",
              "double": 123,
              "string": "<string>",
              "lastValue": {}
            },
            "calculatedChannel": {
              "channelReferences": {},
              "expression": "<string>",
              "functionDependencies": [
                {
                  "userDefinedFunctionVersionId": "<string>"
                }
              ]
            }
          },
          "actions": [
            {
              "ruleActionId": "<string>",
              "actionType": "ACTION_KIND_UNSPECIFIED",
              "configuration": {
                "notification": {
                  "recipientUserIds": [
                    "<string>"
                  ]
                },
                "annotation": {
                  "tagIds": [
                    "<string>"
                  ],
                  "annotationType": "ANNOTATION_TYPE_UNSPECIFIED",
                  "assignedToUserId": "<string>",
                  "metadata": [
                    {
                      "key": "<any>",
                      "stringValue": "<any>",
                      "numberValue": "<any>",
                      "booleanValue": "<any>",
                      "archivedDate": "<any>"
                    }
                  ]
                }
              }
            }
          ]
        }
      ],
      "organizationId": "<string>",
      "versionNotes": "<string>",
      "clientKey": "<string>",
      "assetConfiguration": {
        "assetIds": [
          "<string>"
        ],
        "tagIds": [
          "<string>"
        ]
      },
      "contextualChannels": {
        "channels": [
          {
            "name": "<string>",
            "component": "<string>"
          }
        ]
      },
      "isExternal": true,
      "metadata": [
        {
          "key": {},
          "stringValue": "<string>",
          "numberValue": 123,
          "booleanValue": true,
          "archivedDate": "2023-11-07T05:31:56Z"
        }
      ]
    }
  ],
  "validateOnly": true,
  "overrideExpressionValidation": true
}'
{
  "success": true,
  "rulesCreatedCount": 123,
  "rulesUpdatedCount": 123,
  "validateOnly": true,
  "validationResults": [
    {
      "ruleId": "<string>",
      "clientKey": "<string>",
      "assetExpressionValidationResults": [
        {
          "assetId": "<string>",
          "assetName": "<string>",
          "assetTagId": "<string>",
          "error": "<string>"
        }
      ],
      "error": "<string>"
    }
  ],
  "createdRuleIdentifiers": [
    {
      "ruleId": "<string>",
      "name": "<string>",
      "clientKey": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
rules
rules are limited 1000 rules at a time · object[]
required
overrideExpressionValidation
boolean
required

If override_expression_validation is true, the request will save the rules even if the expressions are invalid. This can be useful for multi-asset rules where an invalid expression for one asset should not prevent the rule from being saved.

validateOnly
boolean

If validate_only is true, the request will only validate the request and not save the rules.

Response

A successful response.

success
boolean
required
rulesCreatedCount
integer
required

The total number of rules created in the request. If validate_only is true, this will indicate how many rules would have been created.

rulesUpdatedCount
integer
required

The total number of rules updated in the request. If validate_only is true, this will indicate how many rules would have been updated.

validateOnly
boolean
required

This will be true if the request only validated the request and did not save the rules.

validationResults
One ValidationResult per rule in the request will be returned · object[]
required
createdRuleIdentifiers
object[]
required

The created rule id, name, version, and client key.