I’m receiving a 500 `A server error occurred` when trying to create a simple flow with an A/B test on an email.
Here’s the response
{
"errors": r
{
"id": "2e63cd65-34e9-4885-8301-7865b80b9990",
"status": 500,
"code": "error",
"title": "A server error occurred.",
"detail": "A server error occurred.",
"source": {
"pointer": "/data/"
}
}
]
}
I obtained my input by creating a flow using the UI editor (to ensure the metrics and templates exist).
I used this as starting point to form the data as per the https://developers.klaviyo.com/en/reference/create_flow API spec.
It should be noted that whilst some of the properties (e.g. cc_email) say they must be a string, the definition of the existing flow has this property as null.
Here’s full API request to the create flows API.
{
"data": {
"type": "flow",
"attributes": {
"name": "My test flow",
"definition": {
"triggers": t
{
"type": "metric",
"id": "WwaLQR",
"trigger_filter": null
}
],
"profile_filter": null,
"actions": "
{
"temporary_id": "84231258",
"type": "ab-test",
"data": {
"main_action": {
"temporary_id": "84231212",
"type": "send-email",
"data": {
"message": {
"from_email": "hello@email.com",
"from_label": "My email",
"reply_to_email": null,
"cc_email": null,
"bcc_email": null,
"subject_line": "Email #1 Subject1",
"preview_text": "",
"template_id": "QQcUiY",
"smart_sending_enabled": true,
"transactional": false,
"add_tracking_params": false,
"custom_tracking_params": null,
"additional_filters": null,
"name": "Email #1"
}
},
"links": {
"next": null
}
},
"current_experiment": {
"name": null,
"variations": r
{
"temporary_id": "84231433",
"type": "send-email",
"data": {
"message": {
"from_email": "hello@email.com",
"from_label": "My email",
"reply_to_email": null,
"cc_email": null,
"bcc_email": null,
"subject_line": "Email #1 Subject - 1",
"preview_text": "",
"template_id": "TVh9fA",
"smart_sending_enabled": true,
"transactional": false,
"add_tracking_params": false,
"custom_tracking_params": null,
"additional_filters": null,
"name": "Email #1 Test #2 July 03, 2025 Variation A"
}
},
"links": {
"next": null
}
},
{
"temporary_id": "84231440",
"type": "send-email",
"data": {
"message": {
"from_email": "hello@email.com",
"from_label": "My email",
"reply_to_email": null,
"cc_email": null,
"bcc_email": null,
"subject_line": "Email #1 Subject - 2",
"preview_text": "",
"template_id": "RbjbJU",
"smart_sending_enabled": true,
"transactional": false,
"add_tracking_params": false,
"custom_tracking_params": null,
"additional_filters": null,
"name": "Email #1 Test #2 July 03, 2025 Variation B"
}
},
"links": {
"next": null
}
}
],
"allocations": {
"84231433": 0.5,
"84231440": 0.5
},
"winner_metric": "unique-clicks",
"automatic_winner_selection_settings": {
"enabled": true,
"automatic_end_date": null,
"automatic_end_statistical_certainty": true
}
}
},
"links": {
"next": null
}
}
],
"entry_action_id": "84231258"
}
}
}
}
Any insights on what might be wrong here?