curl --location '/smartflows/generate' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"language": "cs",
"name": "Abandoned cart recovery",
"folderId": "35a5d0e7-934f-4d50-9f4d-8c370ca72111",
"useCase": "cart-abandon",
"channels": [
"email"
],
"audienceHint": {
"audienceId": "0469ab2c-9ee4-4923-a470-9fbebbbb5252"
},
"products": {
"productIds": [
412458425,
412458426
],
"useCartItemsWhenAvailable": true
},
"constraints": {
"maxSteps": 8,
"includeABTest": false,
"includeWaitNodes": true,
"maxSubjectLength": 55,
"includePreheader": true
},
"inputs": {
"brief": "Navrhnout retenční smartflow pro opuštěný košík: 1) připomenutí po 2 hodinách, 2) druhé připomenutí po 24 hodinách s dopravou zdarma, 3) ukončit po 3 dnech. Respektovat noční klid 22:00–08:00.",
"brandName": "Incomaker Shop",
"tone": "friendly"
},
"downtime": {
"from": "22:00:00+02:00",
"to": "08:00:00+02:00"
}
}'{
"smartflowId": "7b2e9f7a-2b9a-4d63-8d9c-0f8f8b5b2c11",
"state": "draft",
"generated": true,
"graph": {
"nodes": [
{
"id": "n1",
"type": "trigger",
"name": "Cart abandoned"
},
{
"id": "n2",
"type": "delay",
"name": "Wait 2 hours"
},
{
"id": "n3",
"type": "action",
"name": "Send email #1"
},
{
"id": "n4",
"type": "delay",
"name": "Wait 24 hours"
},
{
"id": "n5",
"type": "action",
"name": "Send email #2"
}
],
"edges": [
{
"from": "n1",
"to": "n2"
},
{
"from": "n2",
"to": "n3"
},
{
"from": "n3",
"to": "n4"
},
{
"from": "n4",
"to": "n5"
}
]
}
}