Skip to content

Write Display Condition

Tool name: update-email-editor-display-condition

Writes one named display condition of an email -- what the editor calls dynamic content -- and answers with its decisionId. Give the choices only: conditionType, condition, entity, action and timeframe as get-email-editor-display-condition-capabilities lists them; the operator, the seconds and the smart-tag field are derived. Every value is checked against the account, and an entity it does not own is refused rather than stored as a condition that matches nobody. Writing a decisionId replaces that condition whole. This alone shows no row: bind one with configure-email-editor-row-display-condition. Bound to the contentRevision of the read and refused whole if anything in it fails, so nothing half-written is stored. Drafts only. Saves the draft; publishing is publish-newsletter-email-content.

Input schema

editorUrlstring, [ 12 .. 500 ] charactersrequired

Editor URL of the email, as a read returned it

contentRevisionstring, [ 7 .. 100 ] charactersrequired

The contentRevision of the read this change is based on

namestring, [ 1 .. 250 ] charactersrequired

What the editor shows for this condition; a person reads it

segmentsArray of objects, [ 1 .. 10 ] itemsrequired

Each {conditions: [{conditionType, condition, entity, action, timeframe}], conditionsOpAND}; a contact matches a segment when its conditions match

segmentsOpANDnull or boolean

true when every segment has to match, false when one is enough; defaults to true

Default:null
decisionIdnull or string, <= 50 characters

decisionId of an existing condition to replace whole; omit to create one

Default:null
descriptionnull or string, <= 1000 characters

A note for the person editing this email later

Default:null
accountIdnull or integer, >= 1

User ID of the account; omit for the account the access token works in

Default:null
Input example
{ "editorUrl": "stringstring", "contentRevision": "strings", "name": "string", "segments": [ { "conditionsOpAND": true, "conditions": [ { "conditionType": "string", "condition": "string", "entity": 1, "action": "string", "timeframe": "string" } ] } ], "segmentsOpAND": null, "decisionId": null, "description": null, "accountId": null }

Output schema

One of:
operationstringrequired

"replaced": the stored document is a new one; "unchanged": nothing was persisted.

Enum:"replaced""unchanged"
previousContentStatusstringrequired
Enum:"draft""published""unpublished_changes"
contentStatusstringrequired
Enum:"draft""published""unpublished_changes"
emailIdintegerrequired
contentRevisionstringrequired
warningsArray of stringsrequired
editorUrlstringrequired
createdArray of objectsrequired

What this write created, with uuids: after "addRow" the row and its columns, after "addModule" the block, plus the contentRevision the next write needs. Empty when nothing was created.

nextActionstringrequired

The content action still open: "review_and_publish_content" while the stored draft is not the dispatch content.

Enum:"review_and_publish_content""none"
Output example
{ "operation": "replaced", "previousContentStatus": "draft", "contentStatus": "draft", "emailId": 0, "contentRevision": "string", "warnings": [ "string" ], "editorUrl": "string", "created": [ { "operation": 0, "type": "row", "uuid": "string", "kind": "string", "columns": [ "string" ] } ], "nextAction": "review_and_publish_content" }