WhatsApp API

Send rich media messages and transactional notifications via WhatsApp Business API.

Send Message

POST/messages/whatsapp

Sends a WhatsApp message using a pre-approved template.

Parameters

ParameterTypeRequiredDescription
tostringYesThe recipient phone number (E.164).
template_idstringYesThe ID of the approved template.
variablesobjectNoKey-value pairs for template variables.

Example Request

bash
curl -X POST https://api.devsecit.com/v1/messages/whatsapp \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "template_id": "otp_verification_v2",
    "variables": {
      "code": "5678"
    }
  }'

Example Response

json
{
  "id": "msg_wa_456789123",
  "status": "delivered",
  "timestamp": "2023-10-27T10:05:00Z"
}