younifyd
Menu

Create Custom Rule

Create a custom rule.

POST/organizations/{organizationId}/zones/{zoneId}/firewall-custom/rules

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Create Custom Rule action (under Zones (Data API)).
  3. Fill in the fields below, then reference the result from later steps as {{createCustomRule.response.data}}.

Request

Path parameters

zoneIdstringrequired
organizationIdstringrequired

An identifier for the organization the request is being made by

Request body

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

descriptionstringrequired

A description of the custom rule.

expressionstringrequired

The expression that determines the custom rule's behavior.

actionsarray<string>required

The action(s) applied by the custom rule.

enabledboolean

Whether or not the custom rule is enabled.

positionobject

Used to specify the position of a rule.

beforestring

Insert the current rule before this ruleId.

afterstring

Insert the current rule after this ruleId.

json
{
  "description": "Block traffic for malformed URL requests",
  "expression": "(http.request.uri.path matches \\\"^/path1/.*\\\")",
  "actions": [
    "block"
  ],
  "enabled": true,
  "position": {
    "before": "2c0fc9fa937b11eaa1b71c4d701ab86e",
    "after": "2c0fc9fa937b11eaa1b71c4d701ab86e"
  }
}

Response

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

dataobject

A custom rule.

ruleIdstringrequired

The ID of the custom rule.

descriptionstringrequired

The description of the custom rule.

expressionstringrequired

The expression that determines the custom rule's behavior.

actionsarray<string>required

The action(s) applied by the custom rule.

lastUpdatedstring (date-time)required

Date when the custom rule was last updated.

enabledbooleanrequired

Whether or not the custom rule is enabled.

json
{
  "data": {
    "ruleId": "2c0fc9fa937b11eaa1b71c4d701ab86e",
    "description": "Block traffic for malformed URL requests.",
    "expression": "(http.request.uri.path matches \\\"^/path1/.*\\\")",
    "actions": [
      "block"
    ],
    "lastUpdated": "2022-01-01T05:20:00Z",
    "enabled": true
  }
}

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

Create Custom Rule — Salesforce Commerce Cloud — Documentation