Skip to content

Enroll one contact (by `contact_id`, `email` or `phone_e164`) in an active flow. Idempotent with `Idempotency-Key`

POST
/v1/brands/{brand}/flows/{flow}/enrollments
curl --request POST \
--url https://api.replifier.com/v1/brands/brd_01hx0000000000000000000000/flows/flw_01hx0000000000000000000000/enrollments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "contact_id": "example", "email": "hello@example.com", "phone_e164": "example" }'

Responds 409 if the contact is already active in the flow and 422 flow_enroll_no_consent if the contact has no consent (or is suppressed) for the channel of the flow’s first step.

brand
required
string
/^brd_[a-z0-9]{26}$/

Example

brd_01hx0000000000000000000000
flow
required
string
/^flw_[a-z0-9]{26}$/

Example

flw_01hx0000000000000000000000
Media typeapplication/json
object
contact_id
string
/^con_[a-z0-9]{26}$/
email
string format: email
<= 254 characters
phone_e164
string
/^\+[1-9]\d{6,14}$/

Example generated

{
"contact_id": "example",
"email": "hello@example.com",
"phone_e164": "example"
}

Enrolled

Media typeapplication/json
object
id
required
string
flowId
required
string
versionId
required
string
contactId
required
string
status
required
string
Allowed values: active waiting completed exited failed cancelled
currentNode
required
string
nullable
nextRunAt
required
string
nullable
source
required
string
attempts
required
number
lastError
required

Code of the node’s last failure (failed after 5 attempts)

string
nullable
exitReason
required
string
nullable
enteredAt
required
string
finishedAt
required
string
nullable

Example

{
"status": "active"
}

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"
}
}

Conflict

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"
}
}

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"
}
}

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"
}
}