Test mode: run the draft for a real or fictitious contact with a compressed clock and return the path with the reason for each decision and its text. Sends no emails, calls no webhooks and stores nothing (up to 50 steps)
POST
/v1/flows/{flow}:test
const url = 'https://api.replifier.com/v1/flows/flw_01hx0000000000000000000000:test';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"contactId":"example","contact":{"firstName":"example","locale":"example","timezone":"example","fields":{"additionalProperty":"example"},"tags":["example"]},"assumeEvents":true,"message":{"body":"example","buttonId":"example","firstMessage":true,"outsideHours":true,"referral":{"sourceId":"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/flows/flw_01hx0000000000000000000000:test \ --header 'Content-Type: application/json' \ --data '{ "contactId": "example", "contact": { "firstName": "example", "locale": "example", "timezone": "example", "fields": { "additionalProperty": "example" }, "tags": [ "example" ] }, "assumeEvents": true, "message": { "body": "example", "buttonId": "example", "firstMessage": true, "outsideHours": true, "referral": { "sourceId": "example" } } }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”flow
required
string
Example
flw_01hx0000000000000000000000Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
contactId
Contact of the brand. Without it, a fictitious one built from contact
string
contact
assumeEvents
Event waits follow the “happened” branch (default: “did not happen”)
boolean
message
Incoming WhatsApp message to try against the draft’s whatsapp_message_received trigger (the answer comes in trigger)
object
body
string
buttonId
string
firstMessage
boolean
outsideHours
boolean
referral
object
sourceId
required
string
Example generated
{ "contactId": "example", "contact": { "firstName": "example", "locale": "example", "timezone": "example", "fields": { "additionalProperty": "example" }, "tags": [ "example" ] }, "assumeEvents": true, "message": { "body": "example", "buttonId": "example", "firstMessage": true, "outsideHours": true, "referral": { "sourceId": "example" } }}Responses
Section titled “Responses”Flow after the action
Media typeapplication/json
object
contactId
required
string
fictitious
required
boolean
end
required
string
eligibility
required
object
key
additional properties
trigger
Only with message: whether that WhatsApp message would fire the draft’s whatsapp_message_received trigger
object
type
required
string
matched
required
boolean
eligibilityText
required
string
path
required
Array<object>
object
node
required
string
type
required
string
outcome
required
string
reason
required
object
key
additional properties
text
required
string
Example
{ "end": "completed"}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" }}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" }}