Skip to main content
POST
https://api-ai.textyess.com
/
webhooks
/
flows
/
{id}
Webhook for flows
curl --request POST \
  --url https://api-ai.textyess.com/webhooks/flows/{id} \
  --header 'Content-Type: application/json' \
  --header 'x-auth-token: <api-key>' \
  --data '
{
  "first_name": "<string>",
  "phone_number": "<string>",
  "country_code": "<string>",
  "custom_url": "<string>",
  "discount_code": "<string>"
}
'
{
  "status": 200,
  "success": true
}

Overview

Webhook Flow enables automatic WhatsApp message flows by sending HTTP POST requests. When a valid request is received, the system processes the data and initiates flow execution, sending template messages through WhatsApp and performing various other actions.

Path Parameters

id
string
required
The ID of the flow you want to trigger.You cab find the flow id by clicking on the trigger, if the flow you created is a webhook type.

Body Parameters

first_name
string
required
The first name of the recipient
phone_number
string
required
The recipient’s phone number
country_code
string
required
The two-letter country code. Must match the template message language.
custom_url
string
Optional URL for custom redirects. For abandoned cart automations, this should be the cart recovery URL.
discount_code
string
Optional discount code that you can send to the user. This will allow you to send unique discount code for each user directly into the WhatsApp template.

Response

status
number
HTTP status code indicating the result of the request
message
string
A message describing the result of the request
{
  "status": 200,
  "success": true
}

Important Notes

  1. Rate Limiting: The same phone number cannot receive identical template messages within a 3-hour window.
  2. Abandoned Cart Automation: When building abandoned cart flows:
    • The custom_url in the payload must be the cart recovery URL
    • In the “Send template message” action of type “Abandoned checkout”, only call-to-action text can be customized (not the link)
  3. Language Requirements: The template language must match the country code in the payload:
    • Example: If the template is in Italian (IT), the country_code must be “IT”
    • Mismatched languages will prevent template message delivery