API DocsRESTRule evaluation service

EvaluateRulesPreview

Perform a dry run evaluation for existing rules or rule configurations against a run and return the annotations that would be generated.

POST
/api/v1/rules/evaluate-rules:preview

Request Body

application/jsonRequired

runobject

rulesobject

ruleVersionsobject

reportTemplateobject

ruleConfigsobject

organizationIdOnly required if your user belongs to multiple organizations

curl -X POST "<API_URL>/api/v1/rules/evaluate-rules:preview" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "run": {
      "id": "string",
      "clientKey": "string"
    },
    "rules": {
      "rules": {
        "ids": {
          "ids": [
            "string"
          ]
        },
        "clientKeys": {
          "clientKeys": [
            "string"
          ]
        }
      }
    },
    "ruleVersions": {
      "ruleVersionIds": [
        "string"
      ]
    },
    "reportTemplate": {
      "reportTemplate": {
        "id": "string",
        "clientKey": "string"
      }
    },
    "ruleConfigs": {
      "configs": [
        {
          "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"
              }
            ]
          }
        }
      ]
    },
    "organizationId": "string"
  }'

A successful response.

{
  "createdAnnotationCount": 0,
  "dryRunAnnotations": [
    {
      "conditionId": "string",
      "name": "string",
      "startTime": "2019-08-24T14:15:22Z",
      "endTime": "2019-08-24T14:15:22Z",
      "conditionVersionId": "string"
    }
  ]
}