Skip to main content
POST
/
custom-rule-types
Create a custom rule type
import requests

url = "https://{FUSION HOST}/api/custom-rule-types"

payload = {
    "id": "custom-rule-type",
    "pipeline_id": "custom-rule-pipeline",
    "display_type": "My Custom Rule",
    "schema": {
        "type": "object",
        "properties": {
            "custom_param1": {
                "type": "string",
                "title": "Manufacturer",
                "description": "The manufacturer of the product this rule action applies to."
            },
            "custom_param2": {
                "type": "string",
                "title": "Type",
                "description": "The type of product this rule action applies to."
            }
        }
    }
}
headers = {
    "Authorization": "Basic <encoded-value>",
    "Content-Type": "application/json"
}

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

print(response.json())
{
  "id": "<string>",
  "display_type": "<string>",
  "pipeline_id": "<string>",
  "schema": {}
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Query Parameters

context
string

The app to which this object belongs, as app:SomeApp.

Body

application/json
id
string

The custom rule type ID. This value must be unique across all apps in Fusion (global namespace).

display_type
string

A user-friendly name for the custom rule type.

pipeline_id
string

The ID of the pipeline that is invoked during rule processing.

schema
object

Represents a structured object type definition used in the Experience Manager.

Response

200 - application/json

OK

id
string

The custom rule type ID. This value must be unique across all apps in Fusion (global namespace).

display_type
string

A user-friendly name for the custom rule type.

pipeline_id
string

The ID of the pipeline that is invoked during rule processing.

schema
object

Represents a structured object type definition used in the Experience Manager.