younifyd
Menu

Create or update a query rule

Create or update a query rule

PUT/_query_rules/{ruleset_id}/_rule/{rule_id}

Use it in a workflow

  1. Add a step and choose the Elasticsearch connector.
  2. Pick the Create or update a query rule action (under query_rules).
  3. Fill in the fields below, then reference the result from later steps as {{createOrUpdateAQueryRule.response.data}}.

Request

Path parameters

ruleset_idstringrequired

The unique identifier of the query ruleset containing the rule to be created or updated.

rule_idstringrequired

The unique identifier of the query rule within the specified ruleset to be created or updated.

Request body

Enter the body as JSON in the step's Body field.

typeanyrequired

The type of rule.

criteriaoneOfrequired

The criteria that must be met for the rule to be applied. If multiple criteria are specified for a rule, all criteria must be met for the rule to be applied.

actionsanyrequired

The actions to take when the rule is matched. The format of this action depends on the rule type.

prioritynumber
json
{
  "type": null,
  "criteria": null,
  "actions": null,
  "priority": 0
}

Response

Returns 200 with an object. Read it in later steps with {{createOrUpdateAQueryRule.response.data.<field>}}.

resultany
json
{
  "result": null
}

Need more? See the Elasticsearch guide for connection setup and behaviour shared by every action.

Create or update a query rule — Elasticsearch — Documentation