Add or change a Proactive Messages rule
save_proactive_messageAdd a Proactive Messages rule, or change one (pass rule_id from list_proactive_messages; fields you leave out keep their value). The chatbot then writes first, live for every visitor at once, when the trigger happens. For a general greeting bubble shown to everyone, use update_widget_settings instead. Pro and Enterprise only. A fixed text shows at once and costs nothing; an AI rule spends one AI reply each time it shows. On phones the message always shows in a bubble. For trigger_type event, the website must send the event in its code: window.Asyntai = window.Asyntai || {}; (window.Asyntai.events = window.Asyntai.events || []).push({ name: 'added_to_cart', data: { product: 'Running shoes' } });
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Name only the owner sees, to find the rule in the list. | |
| display | No | bubble: a bubble above the chat button. open: the chat opens with the message (on phones it is always a bubble). | |
| enabled | No | Whether the rule is on. New rules are on. | |
| rule_id | No | Id of the rule to change, from list_proactive_messages. Omit to add a new rule. | |
| frequency | No | session: once per visit. visitor: once per visitor. always: every time (never twice within 30 seconds). | |
| website_id | No | Numeric id of the website, from list_websites. Omit to use the account's primary website. | |
| message_mode | No | fixed: the visitor sees message_text exactly. ai: message_text is an instruction and the AI writes the message in the visitor's language. | |
| message_text | No | The fixed text, or the instruction for the AI. | |
| translations | No | Fixed text only: language code to translated text, for example {"de": "...", "cs": "..."}. Each visitor sees the text of their browser language, and the main text when there is none. Replaces the whole set. | |
| trigger_type | No | When the chatbot writes: event (the website code sends an event name), click (a click on a CSS selector), url (the page address contains a text) or time (seconds on the page). | |
| trigger_value | No | The event name (for example added_to_cart), the CSS selector (for example #copy-code), the text in the page address (for example /pricing) or the number of seconds (for example 30). |