Unomi Node
1.0.1
1.0.1
  • Apache Unomi Node.js SDK
  • Contribute
  • API
    • Profile
      • Create
      • Delete
      • Get
      • Count
      • Existing Properties
      • All Properties
      • Sessions
      • Get by Single Property
      • Query
    • Rule
      • Create
      • Get
      • Get All
    • Segment
Powered by GitBook
On this page
  • Usage
  • Response

Was this helpful?

  1. API
  2. Rule

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.

PreviousRuleNextGet

Last updated 5 years ago

Was this helpful?