I would like to know if it is possible to update a Flow messages using the API.
Best answer by retention
To change the message dynamically without user intervention, you can do one of the three methods below:
Use Show/Hide Blocks or Conditional Logic
If the set of things you want to change are discrete (a limited set of text), you can use Show/Hide conditions for the relevant Blocks in your message to change the output based on those conditions. Or, you can use Django Template Language to do similar If/ElseIf/Then template code to wrap elements based on those conditions. Here are some documention on those:
- How to Show or Hide Template Blocks Based on Dynamic Variables
- Template Tags and Variable Syntax : If-Else-Blocks
Use a Custom Web Feed
Alternatively, you can use a Custom Web Feed to populate content within your template. Unfortunately, you can’t pass parameters to the Web Feed, but you can dynamically change the contents of the Web Feed which in turn changes the content within Flow Messages. Each time a Flow Message is sent, it will pull in the most recent data from your Web Feed source. Here’s documentation on the Custom Web Feed:
Create a Custom Metric as the Flow Trigger
This method might be the most cumbersome method, but it will give you the most control over the message contents. If your Flow is based on a Metric to trigger the Flow (and not a List/Segment, or Date Property), you can create your Custom Metric via the “Track API” to include the dynamic message in the event data payload. Then, you can simply reference that event field in your Template and you can change/update its value(s) on a per event basis. In other words, what you send to Klaviyo as a metric, then becomes the available data to be used in the Template. Here’s more details on creating your own custom metric:
- Track and Identify API Reference : Track API
- Type of Information Exchanged Between Klaviyo and Apps : Where to View Event Data
Hope this helps!