Contacts

Start a chatbot for a contact

POST/contacts/{phone}/trigger-flowScope flows:trigger

Starts a published chatbot for this contact, as if they had triggered it. Anything in variables is available in the chatbot as {{name}}.

Path parameters

  • phonestringrequired

    The contact's phone number with country code. Anything other than digits is ignored, so +91 98765 43210 works.

Body

  • flowIdstringrequired

    The chatbot's id, shown in its URL in the dashboard.

  • variablesobject

    Values 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.

# 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

    Start a chatbot for a contact - Wamafy API