POST https://api.usecommune.com/newsletters/{newsletter}/automations Production. There is no separate sandbox host.

Create an automation

Writes an automation: what starts it, and what it does. Needs sending: write, and is a write.

It is created draft, and nothing it writes can email anybody. The engine only ever starts a run of an active automation, and the only way to that status is POST /automations/{automation}/activate, which runs every gate again and is the one operation in this contract charged to a daily cap of its own.

The graph arrives whole. steps is every step the automation will have, and every edge between them is written down: a null next means there is no edge and the run ends there, so a sequence wires each step to the one after it. There is no operation that adds one step: a step is only meaningful against the edges pointing at it.

The emails arrive inline, as body_markdown, converted by the same strict parser POST /newsletters/{newsletter}/articles uses. An automation email is not listed, not addressable and not reusable between steps, so there is no id to send instead.

Every gate runs before anything is stored. The graph (422 unprocessable): every edge points at a step that exists, every path ends, and no cycles. Each condition, against the closed keyword subset and against the paths its trigger can actually produce. Each email, against the unsubscribe-and-address footer the law requires and against a probe of every image in it. A body that would ship a compliance violation never reaches the table, which matters here more than it does for an article: an automation email is written once and then sent unattended for months.

Publishes no event.

Path parameters

  • string Required

Request Headers

  • string Required
  • string

Body

  • string Required
  • string Required
  • object | null
  • boolean
POST /newsletters/{newsletter}/automations
Loading...

Share your request

Use this link to easily share a pre-filled request of this operation. Everything you filled will be shared apart from the authentication fields.

Request URL

https://api-reference.usecommune.dev/explorer/operation/operation-createautomation

Send a delete request

It looks like you’re about to send a DELETE request to this API. This type of request carries a risk of permanent and irreversible data loss.

Are you sure you want to continue?
Response
Waiting for a request to be sent.