Create

Create new rule

Usage

unomi.rule.create({
  metadata: {
    id: <string>,
    name: <string>,
    description: <string>
  },
  condition: {
    parameterValues: {
      subConditions: [
        {
          parameterValues: {
            propertyName: <string>,
            comparisonOperator: <string>,
            <propertyValueInt>: <number>
          },
          type: <string>
        }
      ],
      operator : <string>
    },
    type: <string>
  },
  actions: [
    {
      parameterValues: {
        setPropertyName: <string>
        setPropertyValue: <string>
      },
      type: <string>
    }
  ]
}
});

Response

{
  success: <boolean>,
  status: <number>,
  data: <string>
}

If rule is successfully created, Unomi returns an empty string and a 204 status code.

Last updated