> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siftstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Step 4: Create Rule and view it in Sift

export const SiftIcon = ({className}) => <span className={`inline-flex items-center align-middle text-black dark:text-white ${className || ''}`}>
    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Artwork" x="0px" y="0px" viewBox="0 0 1005.58 733.96" style={{
  enableBackground: "new 0 0 1005.58 733.96",
  width: "2em",
  height: "2em"
}} xmlSpace="preserve">
      <path fill="currentColor" d="M552.16,150.89c-165.6,0-180.29,160.61-300.62,192.32v2.67h601.24v-2.67C747.74,324.18,717.72,150.89,552.16,150.89z   M453.46,583.08c165.6,0,180.29-160.61,300.62-192.32v-2.67H152.84v2.67C257.88,409.78,287.91,583.08,453.46,583.08z" />
    </svg>
  </span>;

## Overview

As observed in the first tutorial, there was a sharp and sudden decline in both `max_air_temp(C)` and `max_ground_temp(C)`.
On October 6, 2021, at 17:00:00, both signals dropped well below their normal range, possibly reflecting an unexpected environmental condition or a brief telemetry issue.
To capture this behavior, let's create the same Rule as in [Step 4](../tutorial-1/step-4) of the first tutorial, but this time using the REST API instead of the UI.
The endpoint we will use to create the Rule is: [CreateRule](/api-reference/ruleservice/createrule).

## Create Rule

Run the cURL command below to create the Rule.

```bash theme={null}
curl -X POST "YOUR_REST_API_URL_HERE/api/v1/rules" \
  -H "Authorization: Bearer YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "update": {
      "name": "fl_demo_rule",
      "isEnabled": true,
      "assetConfiguration": {
        "assetIds": ["ASSET_ID"]
      },
      "conditions": [
        {
          "ruleConditionId": "condition-1",
          "expression": {
            "calculatedChannel": {
              "expression": "$1 < -50 && $2 < -60",
              "channelReferences": {
                "$1": { "name": "max_air_temp(C)" },
                "$2": { "name": "max_ground_temp(C)" }
              }
            }
          },
          "actions": [
            {
              "ruleActionId": "action-1",
              "actionType": "ANNOTATION",
              "configuration": {}
            }
          ]
        }
      ]
    }
  }'
```

**Placeholders**

* Replace `YOUR_REST_API_URL_HERE` with your REST API URL obtained in the previous step.
* Replace `YOUR_API_KEY_HERE` with your API key obtained in the previous step.
* Replace `fl` (in `fl_demo_rule`) with your initials.
* Replace `ASSET_ID` with the Asset ID you copied in [Step 3](./step-3#view-imported-data-in-sift).

<Accordion title="A successful response">
  ```bash theme={null}
  {
  "ruleId": "string" 
  }
  ```
</Accordion>

## View created Rule in Sift

Now that we have created the Rule using the REST API, let's view the created Rule in Sift.

1. In **Sift**, click <SiftIcon className="icon-sift" />.
2. Click the <Icon icon="code-simple" /> **Rules** tab.
3. In the **Rule name** box, enter the name of the Rule.
4. In the **Rules** tab, click the name of the Rule.
