Personalization Rules

Create a personalization rule

Creates a rule with its conditions and actions in a single transaction. If the requested name collides with an existing rule, the server auto-appends a suffix. If priority is omitted, the server places the new rule at the end of the list.

post/api/sites/multiscreen/site/{site_name}/personalizations

Request

  • Base URL
    https://api.duda.co
  • URL
    https://api.duda.co/api/sites/multiscreen/site/{site_name}/personalizations
  • Auth
    HTTP basic

Path parameters

site_namestring required

The site's unique name (its ID), returned when the site is created.

Request body

descriptionstring

Optional human-readable description.

namestring

Rule name. Required on create; if it collides with an existing rule on the site, the server appends a suffix.

priorityinteger

Optional priority. If omitted on create, the server assigns max(priority)+1.

show_onceboolean

If true, actions fire at most once per visitor session.

status'DRAFT' | 'ACTIVE' | 'PAUSED'

Lifecycle status. DRAFT = saved but inactive, ACTIVE = running on the site, PAUSED = temporarily disabled.

Example request

{
  "action": {
    "html": "<b>40% OFF this weekend!</b>",
    "background_color": "#FFEB3B",
    "duration_seconds": 5
  },
  "conditions": [
    {
      "visit_number": 1
    }
  ],
  "name": "Welcome popup for new visitors",
  "priority": 5,
  "show_once": true
}

Response

The created rule

creation_timestring date-time

When the rule was created.

descriptionstring

Optional human-readable description.

idstring

Stable per-site rule identifier.

manageable_via_apiboolean

True if every condition and action on this rule is exposed by this API. If false, the rule can be deleted/reordered/renamed but its conditions and actions must be edited in the editor UI.

namestring

User-facing rule name. Unique per site.

priorityinteger

Priority within the site. Lower numbers run earlier.

show_onceboolean

If true, actions fire at most once per visitor session.

status'DRAFT' | 'ACTIVE' | 'PAUSED'

Lifecycle status. DRAFT = saved but inactive, ACTIVE = running on the site, PAUSED = temporarily disabled.

Example response

{
  "action": {
    "html": "<b>40% OFF this weekend!</b>",
    "background_color": "#FFEB3B",
    "duration_seconds": 5
  },
  "conditions": [
    {
      "visit_number": 1
    }
  ],
  "id": "12345",
  "manageable_via_api": true,
  "name": "Welcome popup for new visitors",
  "priority": 1,
  "show_once": true
}

Changes

No recorded changes to this operation across all 1 revision of this API.