Lifecycle
Flows are versioned, so you can edit safely while the old version keeps running.- Create with
POST /api/v1/automations. The flow starts as aDRAFTand never runs. - Save changes with
PATCH /api/v1/automations/:idand adefinition. This saves a draft. If the flow is already live, the live version keeps running untouched. - Publish with
POST /api/v1/automations/:id/publish. We validate the draft, make it the live version and set the flow toACTIVE.
The Flow Object
Every flow endpoint exceptDELETE returns the flow with its current versions:
publishedVersionis what runs. It’s missing until the first publish.draftVersionis your latest saved draft. It stays after publishing, so right after a publish both usually carry the same definition. The nextPATCHoverwrites the draft in place, so the draft keeps itsversionnumber while each publish creates a new, higher one.- Every run in the execution logs records the
flowVersionIdit used, so you can tell which version answered.
List Flows
Endpoint:GET /api/v1/automations?teamId=team_123
Optional filters: status, platformScope, socialAccountId (matches flows whose published version listens on that account, so drafts don’t show up here), plus offset and limit (default 10). Returns { items, total }, newest first. Archived flows are included, filter with status if you don’t want them.
Endpoint: GET /api/v1/automations/:id returns a single flow.
Create, Edit, Publish
platformScope is the flow’s platform label: INSTAGRAM, FACEBOOK, TIKTOK, or BOTH (Instagram or Facebook). It has to fit the trigger’s platform. A flow has exactly one trigger, so it listens on one account. Want the same automation on Instagram and Facebook? Create two flows. The flow name can be up to 120 characters.
PATCH accepts name, platformScope and definition, all optional. A definition always replaces the whole draft, so send the full trigger and all steps, not just the part you changed.
Validation runs on create and on every PATCH that carries a definition, and again on publish. It happens in two stages:
- Shape (field types, lengths, counts, duplicate step ids): a
400with anissuesarray, one entry per problem with itspath. - Everything else (accounts, permissions, the post, whether steps fit the trigger), once the shape is valid: all problems come back in one
400whosemessagejoins them with;, so you can fix them in one go.
definition in the body returns 400.
Pause, Activate, Archive, Delete
None of these take a body.
Copy Flows Between Teams
Endpoint:POST /api/v1/automations/copy
flowId to copy every flow of the source team (archived ones included). Copies land as drafts in the target team, with the account-specific bits cleared (socialAccountId, postId, senderExternalIds). Point them at the new team’s accounts with PATCH, then publish. Perfect for agencies rolling out the same automations to many clients.
Create and copy answer 201. Copy returns { items, total } with the new flows. Source and target team must be different.