Skip to main content
POST
/
api
/
templates
/
external
/
message
/
send
curl --request POST \
  --url https://api.automatechats.com/api/templates/external/message/send \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "templateId": "123e4567-e89b-12d3-a456-426614174000",
  "recipientPhoneNumber": "9876543210",
  "countryCode": "+91",
  "variables": [
    "John",
    "Order #12345"
  ]
}
'
{
  "status": "<string>",
  "message": "<string>",
  "data": {}
}
Use this endpoint to send WhatsApp template messages to your contacts.

Fetch sample payload dynamically

To easily construct the required payload structure for any type of template message (including those with media headers, dynamic buttons, or carousels), you do not need to manually construct the variableMapping object or variables list. Instead, you can fetch a pre-formatted, ready-to-use sample payload skeleton for any template using the Fetch Payload Skeleton endpoint (GET /api/templates/{templateId}/payload-skeleton). This endpoint returns the exact JSON structure required by this endpoint (/api/templates/external/message/send). You can simply copy the returned payload skeleton, replace the sample variables and recipient details with your actual values, and send it directly.

Authorizations

X-API-Key
string
header
required

Body

application/json
templateId
string<uuid>
required
recipientPhoneNumber
string
required
countryCode
string
required
variables
string[]

Provide EITHER variables OR variableMapping. This is for simple sequential variable mapping (Header -> Body -> Buttons).

variableMapping
object

Provide EITHER variables OR variableMapping. This is for precise variable mapping by sections for complex templates.

Response

200 - application/json

Message sent successfully

status
string
message
string
data
object