rules

Store a new rule

Creates a new rule. The data required can be submitted as a JSON body or as a list of parameters.

post/v1/rules

Headers

X-Trace-Idstring uuid
Example:40c71bbb-c676-4f24-83cf-cc725d7d7a00

Unique identifier associated with this request.

Request body

titlestring string required
descriptionstring string
rule_group_idstring string required

ID of the rule group under which the rule must be stored. Either this field or rule_group_title is mandatory.

rule_group_titlestring string

Title of the rule group under which the rule must be stored. Either this field or rule_group_id is mandatory.

orderinteger
trigger'store-journal' | 'update-journal' | 'manual-activation' string required

Which action is necessary for the rule to fire? Use either store-journal, update-journal or manual-activation.

activeboolean

Whether or not the rule is even active. Default is true.

strictboolean

If the rule is set to be strict, ALL triggers must hit in order for the rule to fire. Otherwise, just one is enough. Default value is true.

stop_processingboolean

If this value is true and the rule is triggered, other rules after this one in the group will be skipped. Default value is false.

Example request

{
  "title": "First rule title.",
  "description": "First rule description",
  "rule_group_id": "81",
  "rule_group_title": "New rule group",
  "order": 5,
  "trigger": "store-journal",
  "active": true,
  "strict": true,
  "triggers": [
    {
      "type": "user_action",
      "value": "tag1",
      "order": 5,
      "active": true
    }
  ],
  "actions": [
    {
      "type": "set_category",
      "value": "Daily groceries",
      "order": 5,
      "active": true
    }
  ]
}

Response

New rule stored, result in response.

Changes