Append automation steps
Appends steps to an automation or a branch lane. Appending to a live automation is safe — in-flight contacts advance by stable step id, so they are never disturbed. Use after_position to insert, or parent_step_id + lane_key to target a branch lane.
bearerAuth writeAuthorizationBearer <token>An API key from the dashboard under Settings → API keys, sent as Authorization: Bearer aem_….
Authorization has two independent axes.
The scope is ranked — a key satisfies any requirement at or below its own tier:
read— see messages, contacts and metrics. Changes nothing, and cannot send.write— everythingreaddoes, plus managing templates, contacts, automations, segments and suppressions. This is what editing a template needs.admin— everythingwritedoes, plus sending configuration: domains, senders, webhook registration, kill switch, daily cap, brand.
There is no approve scope. It was a rung once; it is not one now, and a key requested with it is rejected.
The approval grant (can_approve) is a separate boolean, not a rung. Delivering mail to a real inbox needs write and the grant. Keeping them on separate axes is what makes the review gate a control rather than a convention: a key that may propose is not automatically a key that may approve its own proposal.
Give your application the lowest tier that works. Most need write and the grant — the dashboard mints that combination as Send + manage; Manage only is the same rung with the grant withheld.
Scope: write
application/json- body
automation*stringAutomation id or name.
1 <= lengthsteps*array<|||||||>Steps to append, in order.
1 <= items <= 100after_position?integerInsert after this position instead of appending. Requires a paused automation.
-9007199254740991 <= value <= 9007199254740991parent_step_id?stringAppend into a branch lane owned by this step.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$uuidlane_key?stringWhich lane of the parent branch — e.g. yes / no, or a multi-branch key.
Steps appended.
application/json- response
added?integertotal_steps?integercurl -X POST 'https://sendandretain.com/api/v1/automations/steps' \ -H 'Content-Type: application/json' \ -d '{ "automation": "Win back", "steps": [ { "type": "send", "templateSlug": "win-back-3", "delaySeconds": 0 } ]}'{ "added": 1, "total_steps": 4}