Update widget
update_widgetChange a widget. Only the fields sent are changed, with one exception: sending ANY of questions, quizQuestions, quizTiers or calcInputs replaces ALL FOUR with exactly what is sent, so send the complete set you want to end up with. Publishing is a separate action. Views and completions cannot be set — they are counted from real traffic. The result lists issues — what is still missing before it could go live. What each kind needs (send only name and kind and the rest starts from sensible defaults): lead-magnet — headline, description, buttonText, contentUrl (a link to the file), optional questions; type "ai" personalises the delivery and needs at least one question. popup — headline, description, buttonText, plus trigger (immediate | exit-intent | scroll | time) with triggerValue (seconds for time, percent for scroll) and placement (center | bottom-right | bottom-left | top-right | top-left); a popup defaults to a time trigger of 8 seconds. For more than one condition, or a click/hover trigger, send triggers (an array of {type: immediate | exit-intent | scroll | time | click | hover, value, selector}; selector is a CSS selector on the host page, only meaningful for click/hover) with triggerMode "any" (the default — opens on the first one met) or "all" (waits for every one). startAt/endAt (epoch milliseconds) bound when a widget runs at all; leave both unset to run with no date limit. survey — questions, each {text, type: short | long | single | multi, options: [] (labels, only for single and multi)}; asks for an email afterwards only if requireEmail is true. quiz — quizQuestions [{text, options: [{label, score}]}] with at least two options each, and quizTiers [{minScore, maxScore, label, message}]; the visitor's total is the sum of the chosen options' scores, and the tiers must cover every possible total from the lowest to the highest with no gap. calculator — calcInputs [{label, min, max, step, default}] (integers), calcFormula using the inputs BY POSITION as a, b, c… with + - * / and brackets (e.g. "a * b * 12"), and calcOutputTemplate where {{result}} is replaced by the answer (e.g. "You could save ${{result}} a year"). announcement-bar — barMessage, barCtaText (the link label), barCtaUrl, barPosition (top | bottom). Popups and bars load sitewide from the one install snippet and can be kept off pages: hideOnValue lists URL pieces they never show on (e.g. "/checkout, /thank-you"), and showOn "url" with showOnValue limits them to pages whose URL contains one of the pieces; showOn "all" is every page. Style is optional and inherits the account's brand when omitted: theme, accentColor, backgroundColor, textColor (hex), cornerStyle, logoUrl.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | ||
| name | No | ||
| type | No | ||
| endAt | No | ||
| theme | No | ||
| layout | No | ||
| showOn | No | ||
| article | No | ||
| logoUrl | No | ||
| project | No | A project id from list_projects. Runs this call in that project instead of the connection default. | |
| startAt | No | ||
| subject | No | ||
| trigger | No | ||
| headline | No | ||
| position | No | ||
| triggers | No | ||
| widgetId | Yes | ||
| barCtaUrl | No | ||
| emailBody | No | ||
| firstStep | No | ||
| placement | No | ||
| questions | No | ||
| quizTiers | No | ||
| textColor | No | ||
| barCtaText | No | ||
| barMessage | No | ||
| buttonText | No | ||
| calcInputs | No | ||
| contentUrl | No | ||
| popupWidth | No | ||
| rewardCode | No | ||
| rewardType | No | ||
| senderName | No | ||
| accentColor | No | ||
| barPosition | No | ||
| buttonStyle | No | ||
| calcFormula | No | ||
| consentText | No | ||
| cornerStyle | No | ||
| description | No | ||
| emailFormat | No | ||
| hideOnValue | No | ||
| showOnValue | No | ||
| triggerMode | No | ||
| cooldownDays | No | ||
| hookQuestion | No | ||
| requireEmail | No | ||
| triggerValue | No | ||
| audienceRules | No | ||
| maxDismissals | No | ||
| quizQuestions | No | ||
| rewardPercent | No | ||
| wheelSegments | No | ||
| floatingButton | No | ||
| questionRoutes | No | ||
| successMessage | No | ||
| backgroundColor | No | ||
| successHeadline | No | ||
| calcOutputTemplate | No |