Endpoint to send a template message to a recipient.
POST
https://api.trypopcorn.ai/template/:templateId
templateId
(string) - Unique ID of the template to send.recipientNumber
(string, required) - Phone number of the recipient.variables
(array, optional) - Custom variables to be used in the template body. Include this only if the template is dynamic and requires variables. The array of values should be ordered, with each variable corresponding sequentially to the placeholders in the template.buttonValues
(object, optional) - Key-value pairs for dynamic button URLs. The keys should match the button text in your template (e.g., “Learn More”, “Get Started”). For parameterized URLs with {{1}}
placeholders, provide only the parameter value. For static URLs, provide the complete URL.enableAutoPilot
(boolean, optional) - If set to true
, the AI agent will continue the conversation if the recipient responds. If set to false
, the conversation will be assigned to a human agent. Defaults to false
if not provided.buttonValues
parameter.
For parameterized URLs (with {{1}}
placeholders):
https://trypopcorn.ai/{{1}}
and you provide "Learn More": "pricing"
, the final URL will be https://trypopcorn.ai/pricing
"Visit Website": "https://trypopcorn.ai/special-offer"
POPCORN-PHONE-NUMBER
header to use your default WhatsApp numberPOPCORN-PHONE-NUMBER
header with a specific phone number to send from that number971501234567
) without +