Messages
Send a WhatsApp message to a phone number. Unlike the dashboard's internal send route, this endpoint takes a phone number — what an external automation actually has — and finds-or-creates the contact and conversation for you before sending.
POST
/api/v1/messagesscope: messages:sendSend a text message
curl -X POST https://app.vyaparping.com/api/v1/messages \
-H "Authorization: Bearer vp_live_xxx" \
-H "Content-Type: application/json" \
-d '{ "to": "+14155550123", "type": "text", "text": "Hi 👋" }'type is text (default), template, or a media kind (image / video / document / audio). Media needs media_url (and optional filename); text doubles as the caption.
Send a template message
{
"to": "+14155550123",
"type": "template",
"template": {
"name": "order_update",
"language": "en_US",
"params": ["A123"] // positional body vars, or a structured object
},
"reply_to_message_id": "<uuid>" // optional; must be in the same conversation
}Response
201 Created
{
"data": {
"message_id": "…",
"whatsapp_message_id": "wamid.…",
"conversation_id": "…",
"contact_id": "…",
"contact_created": true
}
}Domain error codes beyond the standard table:
whatsapp_not_configured (400), meta_error (502 — the request reached Meta and it rejected the send), and template_malformed (500).