Send WhatsApp Message
Send a text or template message to a WhatsApp contact.
POST /whatsapp/send-whatsapp-message/
Headers
| Name | Value |
|---|---|
| Authorization | Bearer Access Token |
| Content-Type | application/json |
Payload
phone_numberrequiredRecipient phone number in E.164 format
messagerequiredMessage text or template data with variables replaced with actual values
sender_numberrequiredSender WhatsApp number (number registered with WhatsApp Business)
typeMessage type
text- texttemplate- template
templateobjectTemplate data (required if type is 'template')
templateTemplate data (required if type is 'template')
namerequiredTemplate name (determines which template to send)
languagerequiredobject
languagerequiredcoderequiredLanguage and locale code (e.g., en or en_US)
componentsrequiredarray of objectTemplate components (body, header, etc.)
componentsrequiredTemplate components (body, header, etc.)
typerequiredComponent type (e.g., body)
parametersrequiredarray of objectList of parameters for template variables (empty list if no variables in template)
parametersrequiredList of parameters for template variables (empty list if no variables in template)
typerequiredParameter type (e.g., text)
textrequiredValue for the template variable
Response
{ "message": "Message sent successfully", "data": { "id": 1, "message": "Hello World", "message_id": "wamid.XXXXX", "status": "<status (SENT/RECEIVED)>", "contact": "<contact_id>", "phone_number_id": "<phone_number_id>", "created_at": "<timestamp>" }, "success": true}Send authentication template messages for OTP codes and verification purposes.
POST /whatsapp/send-whatsapp-message/
Headers
| Name | Value |
|---|---|
| Authorization | Bearer Access Token |
| Content-Type | application/json |
Payload
phone_numberrequiredRecipient phone number in E.164 format (e.g., 919876543210)
messagerequiredMessage you want to store from your side. This message will show in API responses and FreJun WhatsApp Dashboard
sender_numberrequiredSender WhatsApp number (Virtual Number in E.164 format)
typeMessage type (must be 'template' for authentication templates)
template- template
templaterequiredobjectTemplate data for AUTHENTICATION templates (OTP, verification codes)
templaterequiredTemplate data for AUTHENTICATION templates (OTP, verification codes)
namerequiredName of the authentication template
languagerequiredobject
languagerequiredcoderequiredLanguage and locale code (e.g., en_US)
componentsrequiredarray of objectTemplate components for authentication (body with OTP parameter, button for copy code)
componentsrequiredTemplate components for authentication (body with OTP parameter, button for copy code)
typerequiredComponent type (e.g., body for OTP value, button for copy code button)
sub_typeSub-type for button components (e.g., 'url')
indexButton index (e.g., '0' for the first button)
parametersrequiredarray of objectList of parameters - typically contains the OTP code
parametersrequiredList of parameters - typically contains the OTP code
typerequiredParameter type (always 'text' for OTP codes)
textrequiredThe OTP code or authentication value to send
Response
{ "message": "Message sent successfully", "data": { "id": "<Message ID in FreJun>", "message": "<OTP with default message from whatsapp>", "user_id": "<WhatsApp contact ID in FreJun>", "message_id": "<message ID in whatsapp E.g, wamid.XXXXXXXXXXXXXXXX>", "status": "QUEUED", "read_by_user": true, "created_at": "<timestamp E.g, 2026-02-18T16:48:22.369571>", "updated_at": "<timestamp E.g, 2026-02-18T16:48:22.369586>", "template": "<Associated template ID>", "phone_number_id": "<Associated phone number ID in FreJun>", "contact": "<Associated contact ID in FreJun>", "owner": { "id": "<User ID in FreJun>", "email": "<email of the frejun account used to send the message>", "name": "<Name in FreJun account>" } }, "success": true}