curl --request POST \
--url https://cloudapi.mailercloud.com/v1/automations \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"name": "Welcome series for new subscribers",
"timezone": "Asia/Kolkata",
"auto_publish": true,
"nodes": [
{
"id": "n1",
"type": "trigger",
"trigger": "list_subscribed",
"list": "Newsletter Subscribers"
},
{
"id": "n2",
"parent_id": "n1",
"type": "wait_for_period",
"days": 1
},
{
"id": "n3",
"parent_id": "n2",
"type": "if_else",
"filters": [
[
{
"condition": "subscriber_status",
"operator": "is",
"status_value": "active"
}
]
]
},
{
"id": "n4",
"parent_id": "n3",
"branch": "yes",
"type": "add_tag",
"tag": "Welcomed-Active"
},
{
"id": "n5",
"parent_id": "n3",
"branch": "no",
"type": "add_tag",
"tag": "Welcomed-Inactive"
}
]
}
'{
"id": "wHKw",
"status": "draft"
}Create Automation
API to create an advanced automation in a single request. name and nodes are required. auto_publish is optional (defaults to false = draft). timezone, start_time, end_time, allow_re_enrollment, re_enroll_interval, re_enroll_unit are optional.
The automation is declared as a directed graph of nodes: exactly one trigger node, plus any number of action / wait / condition nodes wired via parent_id. Caller-supplied node ids (id, parent_id, target_id) are short strings used only to wire the graph in the request; they are not stored.
Plan gate: the caller’s plan must include advanced automation, otherwise a 403 is returned.
POST
/
automations
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/automations \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"name": "Welcome series for new subscribers",
"timezone": "Asia/Kolkata",
"auto_publish": true,
"nodes": [
{
"id": "n1",
"type": "trigger",
"trigger": "list_subscribed",
"list": "Newsletter Subscribers"
},
{
"id": "n2",
"parent_id": "n1",
"type": "wait_for_period",
"days": 1
},
{
"id": "n3",
"parent_id": "n2",
"type": "if_else",
"filters": [
[
{
"condition": "subscriber_status",
"operator": "is",
"status_value": "active"
}
]
]
},
{
"id": "n4",
"parent_id": "n3",
"branch": "yes",
"type": "add_tag",
"tag": "Welcomed-Active"
},
{
"id": "n5",
"parent_id": "n3",
"branch": "no",
"type": "add_tag",
"tag": "Welcomed-Inactive"
}
]
}
'{
"id": "wHKw",
"status": "draft"
}Authorizations
Body
application/json