Skip to main content

Create Automation

Create an automation: a trigger, and the steps a contact goes through after it. Contacts enter through the trigger. For example, a custom_event trigger starts a run each time you send that event for a contact.

Send steps and connections to build the automation here, or leave them out to create an empty draft and build it in the Arsel Dashboard. The format of both is described in Automation Steps.

The automation is created as a draft, which lets no contacts in. A draft may be unfinished: its issues list what is left before it can be enabled. Enable it with Update Automation, or send status: "enabled" to enable it in the same call.

Endpoint​

POST /automations

Returns: 201 Created

Headers​

HeaderValueRequired
AuthorizationBearer <your-api-key>Yes
Content-Typeapplication/jsonYes

Body Parameters​

ParameterTypeRequiredDescription
namestringYesAutomation name. Max 255 characters.
statusstringNoenabled to enable the automation as it is created. Left out, it is a draft.
stepsarrayNoThe steps, trigger included. Send it with connections. See Automation Steps.
connectionsarrayNoWhich step follows which. Send it with steps.

Steps that break a structural rule, such as a missing trigger, a connection to an unknown step or a loop, are refused with automation_graph_invalid. Nothing is created. See Rules.

Enabling on create​

With status: "enabled", the automation is created and enabled in one step. It starts letting in contacts who match the trigger, so it sends messages. If the automation has issues, the request is refused with automation_not_ready and nothing is created.

Each contact that enters uses one of your plan's monthly automation runs. See Get Usage.

Without steps​

Without steps, the automation is an empty draft. Its issues say that a trigger is missing:

"issues": [
{ "step_key": null, "path": "", "message": "Choose what starts this automation" }
]

Response​

The new automation, with its steps and issues. See List Automations for the field reference.

{
"id": "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a",
"name": "Welcome series",
"status": "draft",
"created_at": "2026-03-08T12:00:00.000Z",
"updated_at": "2026-03-08T12:00:00.000Z",
"steps": [
{
"key": "trigger",
"type": "trigger",
"name": "Joined the newsletter",
"config": {
"event": "list_added",
"list_id": "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f72",
"reentry": { "mode": "once" }
}
},
{
"key": "welcome_email",
"type": "send_email",
"name": "Welcome email",
"config": {
"template_id": "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f70",
"from_domain": "mail.example.com",
"from_prefix": "hello",
"from_name": "Acme",
"subject": "Welcome to Acme, {{firstName|there}}"
}
},
{
"key": "wait_2_days",
"type": "delay",
"name": "Wait 2 days",
"config": { "duration": { "value": 2, "unit": "days" } }
},
{
"key": "tips_email",
"type": "send_email",
"name": "Getting started tips",
"config": {
"template_id": "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f71",
"from_domain": "mail.example.com",
"from_prefix": "hello",
"from_name": "Acme"
}
}
],
"connections": [
{ "from": "trigger", "to": "welcome_email", "type": "default" },
{ "from": "welcome_email", "to": "wait_2_days", "type": "default" },
{ "from": "wait_2_days", "to": "tips_email", "type": "default" }
],
"issues": []
}

Examples​

Create a welcome series as a draft:

curl -X POST "https://api.arsel.sa/v1/automations" \
-H "Authorization: Bearer $ARSEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome series",
"steps": [
{
"key": "trigger",
"type": "trigger",
"name": "Joined the newsletter",
"config": {
"event": "list_added",
"list_id": "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f72",
"reentry": {
"mode": "once"
}
}
},
{
"key": "welcome_email",
"type": "send_email",
"name": "Welcome email",
"config": {
"template_id": "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f70",
"from_domain": "mail.example.com",
"from_prefix": "hello",
"from_name": "Acme",
"subject": "Welcome to Acme, {{firstName|there}}"
}
},
{
"key": "wait_2_days",
"type": "delay",
"name": "Wait 2 days",
"config": {
"duration": {
"value": 2,
"unit": "days"
}
}
},
{
"key": "tips_email",
"type": "send_email",
"name": "Getting started tips",
"config": {
"template_id": "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f71",
"from_domain": "mail.example.com",
"from_prefix": "hello",
"from_name": "Acme"
}
}
],
"connections": [
{
"from": "trigger",
"to": "welcome_email",
"type": "default"
},
{
"from": "welcome_email",
"to": "wait_2_days",
"type": "default"
},
{
"from": "wait_2_days",
"to": "tips_email",
"type": "default"
}
]
}'

Create an empty draft, to build in the dashboard:

curl -X POST "https://api.arsel.sa/v1/automations" \
-H "Authorization: Bearer $ARSEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Win-back"
}'

More complete graphs are in Automation Examples.


Error Responses​

{
"status_code": 422,
"name": "automation_graph_invalid",
"message": "This automation cannot be saved as drawn. trigger: A connection ends at \"nowhere\", which is not a step"
}