Skip to content

Create a draft flow

POST
/v1/brands/{brand}/flows
curl --request POST \
--url https://api.replifier.com/v1/brands/brd_01hx0000000000000000000000/flows \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "graph": { "triggers": [ { "type": "list_subscribed", "listId": "example", "filter": { "additionalProperty": "example" } } ], "goals": [ { "condition": { "additionalProperty": "example" }, "then": "exit", "node": "example" } ], "start": "example", "nodes": { "additionalProperty": { "type": "example", "config": "example", "next": "example", "timeoutNext": "example", "branches": { "additionalProperty": "example" }, "label": "example", "ui": { "additionalProperty": "example" } } } }, "settings": { "reentry": "after_exit", "timezone": "example", "gdprSafeSwitch": true }, "templateId": "welcome", "target": "example", "email": { "connectionId": "example", "fromEmail": "hello@example.com", "fromName": "example", "content": { "additionalProperty": "example" } }, "subjects": [ "example" ] }'
brand
required
string
/^brd_[a-z0-9]{26}$/

Example

brd_01hx0000000000000000000000
Media typeapplication/json
object
name
required
string
>= 1 characters <= 200 characters /^[^\x00-\x1f\x7f]*$/
graph

Flow graph: start and nodes (id → node). See README, M9.

object
triggers
Array
<= 20 items
One of:
object
type
required
string
Allowed values: list_subscribed
listId
required
string
/^lst_[a-z0-9]{26}$/
filter
object
key
additional properties
nullable
goals
Array<object>
<= 10 items
object
condition
required
object
key
additional properties
nullable
then
required
string
Allowed values: exit jump
node
string
/^[A-Za-z0-9_-]{1,40}$/
start
required
string
nullable /^[A-Za-z0-9_-]{1,40}$/
nodes
required
object
key
additional properties
object
type
required
string
<= 40 characters
config
nullable
next
string
nullable /^[A-Za-z0-9_-]{1,40}$/
timeoutNext
string
nullable /^[A-Za-z0-9_-]{1,40}$/
branches
object
key
additional properties
string
nullable /^[A-Za-z0-9_-]{1,40}$/
label
string
<= 200 characters
ui
object
key
additional properties
nullable
settings
object
reentry

Re-enter after finishing (default after_exit). Never twice at the same time.

string
Allowed values: after_exit never
timezone

Time zone for contacts without a valid one (otherwise, the brand’s)

string
<= 64 characters
gdprSafeSwitch

GDPR safe switch: the flow’s emails are not sent to contacts tagged gdpr without current consent (new flows are created with true; if missing, it is off)

boolean
templateId

Builds the graph from a template (see GET /v1/brands/{brand}/flow-templates). Excludes graph.

string
Allowed values: welcome abandoned_cart reactivation birthday post_purchase saas_onboarding email_whatsapp
target

With templateId: the list (lst_…), segment (seg_…), contact date field or event name the trigger needs.

string
>= 1 characters <= 128 characters
email

Sending data shared by the template’s emails: connection, sender and email content.

object
connectionId
required
string
>= 1 characters <= 64 characters
fromEmail
required
string format: email
<= 320 characters
fromName
string
<= 200 characters
content
required
object
key
additional properties
nullable
subjects

With templateId: one subject per template email, in order (emailCount).

Array<string>
<= 10 items

Flow

Media typeapplication/json
object
id
required
string
brandId
required
string
name
required
string
status
required
string
Allowed values: draft pending_approval active paused archived
currentVersionId
required
string
nullable
currentVersion
required
number
nullable
draftGraph
required
object
key
additional properties
nullable
settings
required
object
key
additional properties
nullable
approval
required

If awaiting approval: what was requested (activate, version or resume), by whom, and the estimated reach against the threshold. With version the flow stays active or paused on its previous version until the new one is approved

object
kind
required
string
Allowed values: activate version resume
requestedBy
required
string
requestedAt
required
string
recipients
required
integer
threshold
required
integer
version
required
integer
nullable
statusInfo
required

Unified status with reason (if applicable) and recommended action as i18n keys, same as Campaign.statusInfo

object
status
required
string
Allowed values: draft pending_approval active paused archived
reason
required

Full i18n key of the reason (e.g. flow.pause_reason.manual or flow.approval_reason.activate); null if not applicable

string
nullable
recommendedAction
required

Full i18n key of the recommended action (e.g. flow.action.resume_or_archive)

string
createdBy
required
string
nullable
createdAt
required
string
updatedAt
required
string

Example

{
"status": "draft",
"approval": {
"kind": "activate"
},
"statusInfo": {
"status": "draft"
}
}

Invalid data

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

No session, expired session, or invalid, expired or revoked API key

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Not allowed, API key missing the scope, IP not allowed, or request rejected (csrf_rejected)

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Does not exist or is not visible to you

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Internal error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}