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
const url = 'https://api.replifier.com/v1/brands/brd_01hx0000000000000000000000/flows/flw_01hx0000000000000000000000/enrollments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"contact_id":"example","email":"hello@example.com","phone_e164":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”brand
required
string
Example
brd_01hx0000000000000000000000flow
required
string
Example
flw_01hx0000000000000000000000Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
contact_id
string
email
string format: email
phone_e164
string
Example generated
{ "contact_id": "example", "email": "hello@example.com", "phone_e164": "example"}Responses
Section titled “Responses”Enrolled
Media typeapplication/json
object
id
required
string
flowId
required
string
versionId
required
string
contactId
required
string
status
required
string
currentNode
required
string
nextRunAt
required
string
source
required
string
attempts
required
number
lastError
required
Code of the node’s last failure (failed after 5 attempts)
string
exitReason
required
string
enteredAt
required
string
finishedAt
required
string
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" }}