Skip to main content
POST
/
experience-manager
/
rules
Update or create a rule
import requests

url = "https://{FUSION HOST}/api/experience-manager/rules"

payload = {
    "campaign_id": "<string>",
    "createdOn": "2023-11-07T05:31:56Z",
    "deployed": True,
    "description": "<string>",
    "effective_range": ["<string>"],
    "filters": [
        {
            "key": "<string>",
            "value": "<string>"
        }
    ],
    "groups": "<string>",
    "id": "<string>",
    "matching": "keywords",
    "name": "<string>",
    "priority": 123,
    "query_profile_id_ss": ["<string>"],
    "response_values": [
        {
            "key": "<string>",
            "value": "<string>"
        }
    ],
    "review": "approved",
    "search_terms": ["<string>"],
    "tags": ["<string>"],
    "target_segments": ["<string>"],
    "updatedOn": "2023-11-07T05:31:56Z",
    "variant_id": "<string>"
}
headers = {
    "Authorization": "Basic <encoded-value>",
    "Content-Type": "application/json"
}

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

print(response.json())
{}

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

commitWithin
string

Time in milliseconds within which the update should be committed.

context
string
required

Application context for the rule request.

staging
boolean
required

Indicates whether the rule should be applied in a staging environment.

version
integer

Optional version number of the rule update.

Body

application/json

Details of the rule to be created or updated.

Represents a request to create or update a rule in the Experience Manager.

campaign_id
string

Unique identifier of the campaign associated with this rule.

createdOn
string<date-time>

Timestamp indicating when the rule was created.

deployed
boolean

Indicates whether the rule is currently deployed.

description
string

A brief description of the rule.

effective_range
string[]

Defines the time range during which the rule is active.

filters
object[]

A list of filter conditions for applying the rule.

groups
string

User groups associated with this rule.

id
string

Unique identifier for the rule.

matching
enum<string>

Defines the matching criteria for the rule.

Available options:
keywords,
phrase,
text
name
string

The name of the rule.

priority
integer

Used when multiple rules could take effect for a given query - higher number means higher precedence. For example, a rule with precedence of 10 will take effect before a rule with precedence of 3. Ties on precedence are broken based on creation time - the more recently created rule will take effect before the older rule.

query_profile_id_ss
string[]

A list of query profile IDs associated with this rule.

response_values
object[]

Key/Value pairs to set in the fusion section of the response.

review
enum<string>

The review status of the rule.

Available options:
approved,
auto,
denied,
pending,
supplied
search_terms
string[]

A list of search terms that trigger this rule.

tags
string[]

A list of tags associated with the rule.

target_segments
string[]

A list of unique target segments for the rule.

updatedOn
string<date-time>

Timestamp indicating when the rule was last updated.

variant_id
string

Unique identifier for the variant of this rule.

Response

Rule successfully updated.

The response is of type object.