> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itspropel.com/llms.txt.
> For full documentation content, see https://docs.itspropel.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itspropel.com/_mcp/server.

# Create Rule

POST https://leads/automation/rules
Content-Type: multipart/form-data

Create a new automation rule for leads.

**Payload fields:**
- `name` (required): Rule name - max 191 chars
- `description` (optional): Free text - max 1000 chars
- `entity_type` (required): "lead" for this endpoint
- `trigger_type` (required): Valid TriggerType enum (e.g. LEAD_CREATED)
- `priority` (optional): Integer 0-100 - lower fires first - default 50
- `is_active` (optional): Boolean - default true
- `stop_subsequent_rules` (optional): Boolean - if true, halts rule chain on match
- `cooldown_hours` (optional): Integer hours - dedupe within window - null = no cooldown
- `conditions[]` (required, min 1): Array of condition rows
  - `field_path` (required): Dotted accessor (e.g. lead.lead_source_id)
  - `operator` (required): EQUALS|NOT_EQUALS|IN|NOT_IN|GT|GTE|LT|LTE|CONTAINS|EXISTS|...
  - `value_int` / `value_string` / `value_array` / `value_bool` / `value_datetime` (one required, polymorphic by operator)
  - `sort_order` (optional): Integer - default 0
- `actions[]` (required, min 1): Array of action rows
  - `action_type` (required): ASSIGN_USER|CHANGE_STAGE|TAG|NOTIFY|...
  - `sort_order` (optional): Integer
  - `assign_pool_id` (conditional): UUID of user pool when action_type=ASSIGN_USER
  - Other action_type-specific keys vary

**Payload fields:**
- `name` (required): Rule name - max 191 chars
- `description` (optional): Free text - max 1000 chars
- `entity_type` (required): "lead" or "opportunity" matching the route
- `trigger_type` (required): Valid TriggerType enum case
- `priority` (optional): Integer 0-100 - lower fires first - default 50
- `is_active` (optional): Boolean - default true
- `stop_subsequent_rules` (optional): Boolean - halts chain when true
- `cooldown_hours` (optional): Integer hours - dedupe within window - blank = no cooldown
- `conditions[i][...]` (required, min 1): condition rows. Each row has `field_path`, `operator`, one of `value_int|value_string|value_array|value_bool|value_datetime` (polymorphic by operator), and optional `sort_order`.
- `actions[i][...]` (required, min 1): action rows. Each row has `action_type`, `sort_order`, and action_type-specific keys (e.g. `assign_pool_id` for `ASSIGN_USER`).

Reference: https://docs.itspropel.com/propel-biz/34-leads/automation/leads-rules-executions/create-rule

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: PropelBiz
  version: 1.0.0
paths:
  /leads/automation/rules:
    post:
      operationId: create-rule
      summary: Create Rule
      description: >-
        Create a new automation rule for leads.


        **Payload fields:**

        - `name` (required): Rule name - max 191 chars

        - `description` (optional): Free text - max 1000 chars

        - `entity_type` (required): "lead" for this endpoint

        - `trigger_type` (required): Valid TriggerType enum (e.g. LEAD_CREATED)

        - `priority` (optional): Integer 0-100 - lower fires first - default 50

        - `is_active` (optional): Boolean - default true

        - `stop_subsequent_rules` (optional): Boolean - if true, halts rule
        chain on match

        - `cooldown_hours` (optional): Integer hours - dedupe within window -
        null = no cooldown

        - `conditions[]` (required, min 1): Array of condition rows
          - `field_path` (required): Dotted accessor (e.g. lead.lead_source_id)
          - `operator` (required): EQUALS|NOT_EQUALS|IN|NOT_IN|GT|GTE|LT|LTE|CONTAINS|EXISTS|...
          - `value_int` / `value_string` / `value_array` / `value_bool` / `value_datetime` (one required, polymorphic by operator)
          - `sort_order` (optional): Integer - default 0
        - `actions[]` (required, min 1): Array of action rows
          - `action_type` (required): ASSIGN_USER|CHANGE_STAGE|TAG|NOTIFY|...
          - `sort_order` (optional): Integer
          - `assign_pool_id` (conditional): UUID of user pool when action_type=ASSIGN_USER
          - Other action_type-specific keys vary

        **Payload fields:**

        - `name` (required): Rule name - max 191 chars

        - `description` (optional): Free text - max 1000 chars

        - `entity_type` (required): "lead" or "opportunity" matching the route

        - `trigger_type` (required): Valid TriggerType enum case

        - `priority` (optional): Integer 0-100 - lower fires first - default 50

        - `is_active` (optional): Boolean - default true

        - `stop_subsequent_rules` (optional): Boolean - halts chain when true

        - `cooldown_hours` (optional): Integer hours - dedupe within window -
        blank = no cooldown

        - `conditions[i][...]` (required, min 1): condition rows. Each row has
        `field_path`, `operator`, one of
        `value_int|value_string|value_array|value_bool|value_datetime`
        (polymorphic by operator), and optional `sort_order`.

        - `actions[i][...]` (required, min 1): action rows. Each row has
        `action_type`, `sort_order`, and action_type-specific keys (e.g.
        `assign_pool_id` for `ASSIGN_USER`).
      tags:
        - >-
          subpackage_34Leads.subpackage_34Leads/automation.subpackage_34Leads/automation/leadsRulesExecutions
      parameters:
        - name: '{{tenant_key_name}}'
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/34 Leads_Automation_Leads — Rules +
                  Executions_Create Rule_Response_200
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Required: Rule name - max 191 chars'
                priority:
                  type: string
                  description: 'Optional: Integer 0-100 - lower fires first - default 50'
                is_active:
                  type: string
                  description: 'Optional: bool - default true'
                description:
                  type: string
                  description: 'Optional: Free text - max 1000 chars'
                entity_type:
                  type: string
                  description: 'Required: "lead" for this endpoint'
                trigger_type:
                  type: string
                  description: 'Required: Valid TriggerType enum case'
                stop_subsequent_rules:
                  type: string
                  description: 'Optional: bool - halts chain on match'
                actions[0][sort_order]:
                  type: string
                  description: 'Optional: Integer - default 0'
                actions[0][action_type]:
                  type: string
                  description: 'Required: ASSIGN_USER|CHANGE_STAGE|TAG|NOTIFY|...'
                conditions[0][operator]:
                  type: string
                  description: >-
                    Required:
                    EQUALS|NOT_EQUALS|IN|NOT_IN|GT|GTE|LT|LTE|CONTAINS|EXISTS|...
                conditions[0][field_path]:
                  type: string
                  description: 'Required: Dotted accessor (e.g. lead.lead_source_id)'
                conditions[0][sort_order]:
                  type: string
                  description: 'Optional: Integer - default 0'
                actions[0][assign_pool_id]:
                  type: string
                  description: >-
                    Conditional: required when action_type=ASSIGN_USER. User
                    pool UUID.
              required:
                - name
                - priority
                - is_active
                - description
                - entity_type
                - trigger_type
                - stop_subsequent_rules
                - actions[0][sort_order]
                - actions[0][action_type]
                - conditions[0][operator]
                - conditions[0][field_path]
                - conditions[0][sort_order]
                - actions[0][assign_pool_id]
servers:
  - url: https:/
components:
  schemas:
    34 Leads_Automation_Leads — Rules + Executions_Create Rule_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: 34 Leads_Automation_Leads — Rules + Executions_Create Rule_Response_200

```

## SDK Code Examples

```python
import requests

url = "https://https/leads/automation/rules"

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nNew Lead Assignment Rule\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"priority\"\r\n\r\n10\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"is_active\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\nAutomatically assign new leads from website form submissions to the North America sales pool.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity_type\"\r\n\r\nlead\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"trigger_type\"\r\n\r\nLEAD_CREATED\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stop_subsequent_rules\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][sort_order]\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][action_type]\"\r\n\r\nASSIGN_USER\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][operator]\"\r\n\r\nEQUALS\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][field_path]\"\r\n\r\nlead.lead_source_id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][sort_order]\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][assign_pool_id]\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001--\r\n"
headers = {
    "{{tenant_key_name}}": "{{tenant_key_value1}}|{{tenant_key_value2}}",
    "Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://https/leads/automation/rules';
const form = new FormData();
form.append('name', 'New Lead Assignment Rule');
form.append('priority', '10');
form.append('is_active', 'true');
form.append('description', 'Automatically assign new leads from website form submissions to the North America sales pool.');
form.append('entity_type', 'lead');
form.append('trigger_type', 'LEAD_CREATED');
form.append('stop_subsequent_rules', 'true');
form.append('actions[0][sort_order]', '0');
form.append('actions[0][action_type]', 'ASSIGN_USER');
form.append('conditions[0][operator]', 'EQUALS');
form.append('conditions[0][field_path]', 'lead.lead_source_id');
form.append('conditions[0][sort_order]', '0');
form.append('actions[0][assign_pool_id]', '3fa85f64-5717-4562-b3fc-2c963f66afa6');

const options = {
  method: 'POST',
  headers: {'{{tenant_key_name}}': '{{tenant_key_value1}}|{{tenant_key_value2}}'}
};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://https/leads/automation/rules"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nNew Lead Assignment Rule\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"priority\"\r\n\r\n10\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"is_active\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\nAutomatically assign new leads from website form submissions to the North America sales pool.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity_type\"\r\n\r\nlead\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"trigger_type\"\r\n\r\nLEAD_CREATED\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stop_subsequent_rules\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][sort_order]\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][action_type]\"\r\n\r\nASSIGN_USER\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][operator]\"\r\n\r\nEQUALS\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][field_path]\"\r\n\r\nlead.lead_source_id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][sort_order]\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][assign_pool_id]\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://https/leads/automation/rules")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["{{tenant_key_name}}"] = '{{tenant_key_value1}}|{{tenant_key_value2}}'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nNew Lead Assignment Rule\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"priority\"\r\n\r\n10\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"is_active\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\nAutomatically assign new leads from website form submissions to the North America sales pool.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity_type\"\r\n\r\nlead\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"trigger_type\"\r\n\r\nLEAD_CREATED\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stop_subsequent_rules\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][sort_order]\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][action_type]\"\r\n\r\nASSIGN_USER\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][operator]\"\r\n\r\nEQUALS\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][field_path]\"\r\n\r\nlead.lead_source_id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][sort_order]\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][assign_pool_id]\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/leads/automation/rules")
  .header("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nNew Lead Assignment Rule\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"priority\"\r\n\r\n10\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"is_active\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\nAutomatically assign new leads from website form submissions to the North America sales pool.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity_type\"\r\n\r\nlead\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"trigger_type\"\r\n\r\nLEAD_CREATED\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stop_subsequent_rules\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][sort_order]\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][action_type]\"\r\n\r\nASSIGN_USER\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][operator]\"\r\n\r\nEQUALS\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][field_path]\"\r\n\r\nlead.lead_source_id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][sort_order]\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][assign_pool_id]\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/leads/automation/rules', [
  'multipart' => [
    [
        'name' => 'name',
        'contents' => 'New Lead Assignment Rule'
    ],
    [
        'name' => 'priority',
        'contents' => '10'
    ],
    [
        'name' => 'is_active',
        'contents' => 'true'
    ],
    [
        'name' => 'description',
        'contents' => 'Automatically assign new leads from website form submissions to the North America sales pool.'
    ],
    [
        'name' => 'entity_type',
        'contents' => 'lead'
    ],
    [
        'name' => 'trigger_type',
        'contents' => 'LEAD_CREATED'
    ],
    [
        'name' => 'stop_subsequent_rules',
        'contents' => 'true'
    ],
    [
        'name' => 'actions[0][sort_order]',
        'contents' => '0'
    ],
    [
        'name' => 'actions[0][action_type]',
        'contents' => 'ASSIGN_USER'
    ],
    [
        'name' => 'conditions[0][operator]',
        'contents' => 'EQUALS'
    ],
    [
        'name' => 'conditions[0][field_path]',
        'contents' => 'lead.lead_source_id'
    ],
    [
        'name' => 'conditions[0][sort_order]',
        'contents' => '0'
    ],
    [
        'name' => 'actions[0][assign_pool_id]',
        'contents' => '3fa85f64-5717-4562-b3fc-2c963f66afa6'
    ]
  ]
  'headers' => [
    '{{tenant_key_name}}' => '{{tenant_key_value1}}|{{tenant_key_value2}}',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://https/leads/automation/rules");
var request = new RestRequest(Method.POST);
request.AddHeader("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nNew Lead Assignment Rule\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"priority\"\r\n\r\n10\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"is_active\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\nAutomatically assign new leads from website form submissions to the North America sales pool.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity_type\"\r\n\r\nlead\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"trigger_type\"\r\n\r\nLEAD_CREATED\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stop_subsequent_rules\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][sort_order]\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][action_type]\"\r\n\r\nASSIGN_USER\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][operator]\"\r\n\r\nEQUALS\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][field_path]\"\r\n\r\nlead.lead_source_id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conditions[0][sort_order]\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"actions[0][assign_pool_id]\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["{{tenant_key_name}}": "{{tenant_key_value1}}|{{tenant_key_value2}}"]
let parameters = [
  [
    "name": "name",
    "value": "New Lead Assignment Rule"
  ],
  [
    "name": "priority",
    "value": "10"
  ],
  [
    "name": "is_active",
    "value": "true"
  ],
  [
    "name": "description",
    "value": "Automatically assign new leads from website form submissions to the North America sales pool."
  ],
  [
    "name": "entity_type",
    "value": "lead"
  ],
  [
    "name": "trigger_type",
    "value": "LEAD_CREATED"
  ],
  [
    "name": "stop_subsequent_rules",
    "value": "true"
  ],
  [
    "name": "actions[0][sort_order]",
    "value": "0"
  ],
  [
    "name": "actions[0][action_type]",
    "value": "ASSIGN_USER"
  ],
  [
    "name": "conditions[0][operator]",
    "value": "EQUALS"
  ],
  [
    "name": "conditions[0][field_path]",
    "value": "lead.lead_source_id"
  ],
  [
    "name": "conditions[0][sort_order]",
    "value": "0"
  ],
  [
    "name": "actions[0][assign_pool_id]",
    "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://https/leads/automation/rules")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```