Skip to main content
PUT
/
api
/
v1
/
rules
UpdateRule
curl --request PUT \
  --url https://your-sift-api-url.com/api/v1/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "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": {
                    "name": "<string>",
                    "type": "METADATA_KEY_TYPE_UNSPECIFIED",
                    "archivedDate": "2023-11-07T05:31:56Z"
                  },
                  "stringValue": "<string>",
                  "numberValue": 123,
                  "booleanValue": true,
                  "archivedDate": "2023-11-07T05:31:56Z"
                }
              ]
            }
          }
        }
      ]
    }
  ],
  "organizationId": "<string>",
  "versionNotes": "<string>",
  "clientKey": "<string>",
  "assetConfiguration": {
    "assetIds": [
      "<string>"
    ],
    "tagIds": [
      "<string>"
    ]
  },
  "contextualChannels": {
    "channels": [
      {
        "name": "<string>",
        "component": "<string>"
      }
    ]
  },
  "isExternal": true,
  "metadata": [
    {
      "key": {
        "name": "<string>",
        "type": "METADATA_KEY_TYPE_UNSPECIFIED",
        "archivedDate": "2023-11-07T05:31:56Z"
      },
      "stringValue": "<string>",
      "numberValue": 123,
      "booleanValue": true,
      "archivedDate": "2023-11-07T05:31:56Z"
    }
  ]
}'
{
  "ruleId": "<string>"
}

Authorizations

Authorization
string
header
required

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

Body

application/json

UpdateRuleRequest is used to create or update a rule. If the rule_id or client_key is provided, the rule will be updated. If not, a new rule will be created.

name
string
required
description
string
required
conditions
object[]
required
metadata
object[]
required
ruleId
string
assetId
string

Deprecated - use asset_configuration instead.

isEnabled
boolean

Deprecated - use DeleteRule instead.

organizationId
string
versionNotes
string
clientKey
string
assetConfiguration
object
contextualChannels
object
isExternal
boolean

Response

A successful response.

ruleId
string
required