API DocsRESTRule service

UpdateRule

Updates an existing rule.

PUT
/api/v1/rules

Request Body

application/jsonRequired

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.

ruleIdstring

name
Required
string

description
Required
string

assetIdstring

Deprecated - use asset_configuration instead.

isEnabled
Required
boolean

conditions
Required
array<object>

organizationIdstring

versionNotesstring

clientKeyclient_key is a client provided identifier for the rule. It is immutable after being set

assetConfigurationobject

contextualChannelsobject

curl -X PUT "<API_URL>/api/v1/rules" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "ruleId": "string",
    "name": "string",
    "description": "string",
    "assetId": "string",
    "isEnabled": true,
    "conditions": [
      {
        "ruleConditionId": "string",
        "expression": {
          "singleChannelComparison": {
            "channelComponent": "string",
            "channelName": "string",
            "comparator": "CONDITION_COMPARATOR_UNSPECIFIED",
            "double": 0.1,
            "string": "string",
            "lastValue": {}
          },
          "calculatedChannel": {
            "channelReferences": {
              "property1": {
                "name": "string",
                "component": "string"
              },
              "property2": {
                "name": "string",
                "component": "string"
              }
            },
            "expression": "string"
          }
        },
        "actions": [
          {
            "ruleActionId": "string",
            "actionType": "ACTION_KIND_UNSPECIFIED",
            "configuration": {
              "notification": {
                "recipientUserIds": [
                  "string"
                ]
              },
              "annotation": {
                "tagIds": [
                  "string"
                ],
                "annotationType": "ANNOTATION_TYPE_UNSPECIFIED",
                "assignedToUserId": "string"
              }
            }
          }
        ]
      }
    ],
    "organizationId": "string",
    "versionNotes": "string",
    "clientKey": "string",
    "assetConfiguration": {
      "assetIds": [
        "string"
      ],
      "tagIds": [
        "string"
      ]
    },
    "contextualChannels": {
      "channels": [
        {
          "name": "string",
          "component": "string"
        }
      ]
    }
  }'

A successful response.

{
  "ruleId": "string"
}