Contacts
Start a chatbot for a contact
POST
/contacts/{phone}/trigger-flowScope flows:triggerStarts a published chatbot for this contact, as if they had triggered it. Anything in variables is available in the chatbot as {{name}}.
Path parameters
phonestringrequiredThe contact's phone number with country code. Anything other than digits is ignored, so
+91 98765 43210works.
Body
flowIdstringrequiredThe chatbot's id, shown in its URL in the dashboard.
variablesobjectValues for the chatbot to use. Strings, numbers or booleans.
Good to know
- The response is
{ "status": "skipped", "reason": "..." }instead when the chatbot is not published, your plan does not include chatbots, or the contact cannot be messaged.
Errors
Plus the errors any endpoint can return, such as a missing key or scope. See Errors.
Request
# macOS, Linux or Git Bash, with WAMAFY_API_KEY set. The quoting does not work in Windows cmd or PowerShell.
curl -X POST "https://api.wamafy.com/api/v1/public/contacts/919876543210/trigger-flow" \
-H "Authorization: Bearer $WAMAFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"flowId": "7a1b3c5d-2e4f-4a6b-8c0d-1e3f5a7b9c2d",
"variables": {
"order_id": "#1043"
}
}'Response 200
{
"success": true,
"data": {
"status": "started"
}
}Base URL https://api.wamafy.com/api/v1/public